WIN32 RGB color fixes from Vincent.

git-svn-id: file:///fltk/svn/fltk/trunk@115 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 1998-12-02 16:04:03 +00:00
parent e467c3e8a9
commit 892664ca26
2 changed files with 16 additions and 8 deletions

View File

@ -1,5 +1,5 @@
//
// "$Id: fl_color_win32.cxx,v 1.6 1998/11/08 17:02:40 mike Exp $"
// "$Id: fl_color_win32.cxx,v 1.7 1998/12/02 16:04:02 mike Exp $"
//
// WIN32 color functions for the Fast Light Tool Kit (FLTK).
//
@ -47,9 +47,17 @@ Fl_XMap fl_xmap[256];
Fl_XMap* fl_current_xmap;
HPALETTE fl_palette;
HPEN tmppen=0;
HBRUSH tmpbrush=0;
static void clear_xmap(Fl_XMap& xmap) {
if (xmap.pen) {
if(!tmppen) tmppen = CreatePen(PS_SOLID, 1, 0);
if(!tmpbrush) tmpbrush = CreateSolidBrush(0);
HPEN oldpen = SelectObject(fl_gc, tmppen); // Push out the current pen of the gc
if(oldpen != xmap.pen) SelectObject(fl_gc, oldpen); // Put it back if it is not the one we are about to delete
SelectObject(fl_gc, tmpbrush); // Push out the old pen of the gc
//fl_current_xmap = 0;
DeleteObject((HGDIOBJ)(xmap.pen));
xmap.pen = 0;
xmap.brush = -1;
@ -225,5 +233,5 @@ fl_select_palette(void)
#endif
//
// End of "$Id: fl_color_win32.cxx,v 1.6 1998/11/08 17:02:40 mike Exp $".
// End of "$Id: fl_color_win32.cxx,v 1.7 1998/12/02 16:04:02 mike Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: checkers.cxx,v 1.5 1998/10/21 14:21:18 mike Exp $"
// "$Id: checkers.cxx,v 1.6 1998/12/02 16:04:03 mike Exp $"
//
// Checkers game for the Fast Light Tool Kit (FLTK).
//
@ -921,10 +921,10 @@ void draw_piece(int which, int x, int y) {
case WHITEKING: which = 3; break;
default: return;
}
fl_color(FL_BLACK); bm[which][0]->draw(x, y);
fl_color(FL_INACTIVE_COLOR); bm[which][1]->draw(x, y);
fl_color(FL_SELECTION_COLOR);bm[which][2]->draw(x, y);
fl_color(FL_WHITE); bm[which][3]->draw(x, y);
fl_color(0, 1, 0); bm[which][0]->draw(x, y);
fl_color(200, 100, 2000); bm[which][1]->draw(x, y);
fl_color(100, 100, 200);bm[which][2]->draw(x, y);
fl_color(200, 200, 100); bm[which][3]->draw(x, y);
}
//----------------------------------------------------------------
@ -1366,5 +1366,5 @@ int main(int argc, char **argv) {
}
//
// End of "$Id: checkers.cxx,v 1.5 1998/10/21 14:21:18 mike Exp $".
// End of "$Id: checkers.cxx,v 1.6 1998/12/02 16:04:03 mike Exp $".
//