diff options
| author | Manolo Gouy <Manolo> | 2016-03-21 17:06:03 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-03-21 17:06:03 +0000 |
| commit | 9ba3889ae5a7054b4d75c0ccb0f54e16b9b99159 (patch) | |
| tree | b2ce871a08ae2dea72d686ed7fe4a50a5eaa47be /src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx | |
| parent | ec0b695709edee8aaf1a85c7c4c284e15502fadc (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/Fl_WinAPI_Window_Driver.cxx')
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx | 20 |
1 files changed, 20 insertions, 0 deletions
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$". // |
