summaryrefslogtreecommitdiff
path: root/FL/win32.H
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-02-18 16:21:51 +0000
committerManolo Gouy <Manolo>2016-02-18 16:21:51 +0000
commitf33b45f1d30653fb5da4817089e38ff0a2413cfb (patch)
tree9edc759690defa581b00b6ada80bb334f4ac5da8 /FL/win32.H
parent6ce27012a9412c4964e0ae40c81ea92ff39a61d3 (diff)
Remove all uses of the fl_gc global variable. Towards a clean driver model.
fl_gc remains usable by the application as a hook into the system. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11189 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL/win32.H')
-rw-r--r--FL/win32.H14
1 files changed, 8 insertions, 6 deletions
diff --git a/FL/win32.H b/FL/win32.H
index 657a66d9f..3707f81f7 100644
--- a/FL/win32.H
+++ b/FL/win32.H
@@ -3,7 +3,7 @@
//
// WIN32 header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2012 by Bill Spitzak and others.
+// Copyright 1998-2016 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -132,15 +132,17 @@ extern FL_EXPORT HDC fl_makeDC(HBITMAP);
// off-screen pixmaps: create, destroy, draw into, copy to window
typedef HBITMAP Fl_Offscreen;
#define fl_create_offscreen(w, h) \
- CreateCompatibleBitmap( (fl_gc ? fl_gc : fl_GetDC(0) ) , w, h)
+ CreateCompatibleBitmap( (fl_graphics_driver->get_gc() ? (HDC)fl_graphics_driver->get_gc() : fl_GetDC(0) ) , w, h)
# define fl_begin_offscreen(b) \
- HDC _sgc=fl_gc; Window _sw=fl_window; \
- Fl_Surface_Device *_ss = Fl_Surface_Device::surface(); Fl_Display_Device::display_device()->set_current(); \
- fl_gc=fl_makeDC(b); int _savedc = SaveDC(fl_gc); fl_window=(HWND)b; fl_push_no_clip()
+ void* _sgc=fl_graphics_driver->get_gc(); Window _sw=fl_window; \
+ Fl_Surface_Device *_ss = Fl_Surface_Device::surface(); \
+HDC _tmp_gc = fl_makeDC(b); int _savedc = SaveDC(_tmp_gc); \
+Fl_Display_Device::display_device()->set_current(); \
+ fl_graphics_driver->set_gc(_tmp_gc); fl_window=(HWND)b; fl_push_no_clip()
# define fl_end_offscreen() \
- fl_pop_clip(); RestoreDC(fl_gc, _savedc); DeleteDC(fl_gc); _ss->set_current(); fl_window=_sw; fl_gc = _sgc
+ fl_pop_clip(); RestoreDC((HDC)fl_graphics_driver->get_gc(), _savedc); DeleteDC((HDC)fl_graphics_driver->get_gc()); _ss->set_current(); fl_window=_sw; fl_graphics_driver->set_gc(_sgc);
FL_EXPORT void fl_copy_offscreen(int x,int y,int w,int h,HBITMAP pixmap,int srcx,int srcy);