summaryrefslogtreecommitdiff
path: root/src/drivers/WinAPI
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/WinAPI')
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H1
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx20
2 files changed, 21 insertions, 0 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H
index 31f3b1db2..c7726d170 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H
+++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H
@@ -76,6 +76,7 @@ public:
virtual void flush_double();
virtual void flush_overlay();
virtual void draw_begin();
+ virtual void make_current();
virtual void shape(const Fl_Image* img);
virtual void icons(const Fl_RGB_Image *icons[], int count);
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
index 1de3046f3..f259b62ac 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
@@ -29,6 +29,11 @@
#include "Fl_WinAPI_Window_Driver.H"
#include <windows.h>
+#if USE_COLORMAP
+extern HPALETTE fl_select_palette(void); // in fl_color_win32.cxx
+#endif
+
+
Fl_Window_Driver *Fl_Window_Driver::newWindowDriver(Fl_Window *w)
{
return new Fl_WinAPI_Window_Driver(w);
@@ -374,6 +379,21 @@ void Fl_WinAPI_Window_Driver::wait_for_expose() {
}
}
+
+void Fl_WinAPI_Window_Driver::make_current() {
+ fl_GetDC(fl_xid(pWindow));
+
+#if USE_COLORMAP
+ // Windows maintains a hardware and software color palette; the
+ // SelectPalette() call updates the current soft->hard mapping
+ // for all drawing calls, so we must select it here before any
+ // code does any drawing...
+ fl_select_palette();
+#endif // USE_COLORMAP
+
+ fl_graphics_driver->clip_region(0);
+}
+
//
// End of "$Id$".
//