summaryrefslogtreecommitdiff
path: root/src/drivers/WinAPI
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-21 17:06:03 +0000
committerManolo Gouy <Manolo>2016-03-21 17:06:03 +0000
commit9ba3889ae5a7054b4d75c0ccb0f54e16b9b99159 (patch)
treeb2ce871a08ae2dea72d686ed7fe4a50a5eaa47be /src/drivers/WinAPI
parentec0b695709edee8aaf1a85c7c4c284e15502fadc (diff)
Implement Fl_Window::make_current() under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11393 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
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$".
//