From dccfdf93e30154405a13f30a705bc29263acd917 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Fri, 6 Nov 1998 14:32:17 +0000 Subject: Added fl_select_palette() to the WM_PAINT processing to make 8-bit windows draw properly under Windows. git-svn-id: file:///fltk/svn/fltk/trunk@64 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_win32.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Fl_win32.cxx b/src/Fl_win32.cxx index 64c0d379f..30d6209eb 100644 --- a/src/Fl_win32.cxx +++ b/src/Fl_win32.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_win32.cxx,v 1.11 1998/11/05 16:04:50 mike Exp $" +// "$Id: Fl_win32.cxx,v 1.12 1998/11/06 14:32:17 mike Exp $" // // WIN32-specific code for the Fast Light Tool Kit (FLTK). // @@ -251,6 +251,14 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPar return 0; case WM_PAINT: { +#if USE_COLORMAP + // Before we do a paint we need to tell Windows what color palette to + // use. This is because Windows will map our color indices to the + // correct colors in the current hardware color palette. This is + // confusing to say the least, but that's Winders for ya! + + fl_GetDC(hWnd); + fl_select_palette(); // This might be a better alternative, where we fully ignore NT's // "facilities" for painting. MS expects applications to paint according @@ -775,5 +783,5 @@ void Fl_Window::flush() { } // -// End of "$Id: Fl_win32.cxx,v 1.11 1998/11/05 16:04:50 mike Exp $". +// End of "$Id: Fl_win32.cxx,v 1.12 1998/11/06 14:32:17 mike Exp $". // -- cgit v1.2.3