diff options
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/win32.H | 7 | ||||
| -rw-r--r-- | FL/x.H | 16 |
2 files changed, 15 insertions, 8 deletions
diff --git a/FL/win32.H b/FL/win32.H index 8ad6ccf45..cd9233179 100644 --- a/FL/win32.H +++ b/FL/win32.H @@ -121,16 +121,19 @@ extern FL_EXPORT void fl_save_dc( HWND w, HDC dc); // off-screen pixmaps: create, destroy, draw into, copy to window typedef HBITMAP Fl_Offscreen; -#define fl_create_offscreen(w, h) CreateCompatibleBitmap(fl_gc, w, h) +#define fl_create_offscreen(w, h) \ + CreateCompatibleBitmap( (fl_gc ? fl_gc : fl_GetDC(0) ) , w, h) extern FL_EXPORT HDC fl_makeDC(HBITMAP); # define fl_begin_offscreen(b) \ HDC _sgc=fl_gc; Window _sw=fl_window; \ + Fl_Surface_Device *_ss = fl_surface; fl_display_device->set_current(); \ fl_gc=fl_makeDC(b); int _savedc = SaveDC(fl_gc); fl_window=(HWND)b; fl_push_no_clip() # define fl_end_offscreen() \ - fl_pop_clip(); RestoreDC(fl_gc, _savedc); DeleteDC(fl_gc); fl_window=_sw; fl_gc = _sgc + fl_pop_clip(); RestoreDC(fl_gc, _savedc); DeleteDC(fl_gc); _ss->set_current(); fl_window=_sw; fl_gc = _sgc + FL_EXPORT void fl_copy_offscreen(int x,int y,int w,int h,HBITMAP pixmap,int srcx,int srcy); FL_EXPORT void fl_copy_offscreen_with_alpha(int x,int y,int w,int h,HBITMAP pixmap,int srcx,int srcy); @@ -110,16 +110,20 @@ extern FL_EXPORT ulong fl_event_time; // off-screen pixmaps: create, destroy, draw into, copy to window: typedef ulong Fl_Offscreen; -#define fl_create_offscreen(w,h) \ - XCreatePixmap(fl_display, fl_window, w, h, fl_visual->depth) +# define fl_create_offscreen(w,h) \ + XCreatePixmap(fl_display, \ + (fl_surface->type() == Fl_Display_Device::device_type ? \ + fl_window : fl_xid(Fl::first_window()) ) , \ + w, h, fl_visual->depth) // begin/end are macros that save the old state in local variables: # define fl_begin_offscreen(pixmap) \ - Window _sw=fl_window; fl_window=pixmap; fl_push_no_clip() + Window _sw=fl_window; fl_window=pixmap; \ + Fl_Surface_Device *_ss = fl_surface; fl_display_device->set_current(); \ + fl_push_no_clip() # define fl_end_offscreen() \ - fl_pop_clip(); fl_window = _sw + fl_pop_clip(); fl_window = _sw; _ss->set_current() -# define fl_copy_offscreen(x,y,w,h,pixmap,srcx,srcy) \ - XCopyArea(fl_display, pixmap, fl_window, fl_gc, srcx, srcy, w, h, x, y) +extern void fl_copy_offscreen(int x, int y, int w, int h, Fl_Offscreen pixmap, int srcx, int srcy); # define fl_delete_offscreen(pixmap) XFreePixmap(fl_display, pixmap) // Bitmap masks |
