From 43935dffeb7cb54a97b2a8a610c2e453743c0da9 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 7 Dec 2016 15:09:52 +0000 Subject: Add static void Fl_Surface_Device::push_current(Fl_Surface_Device *new_current) and pop_current() to set/unset the current drawing surface. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12140 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- examples/shapedwindow.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/shapedwindow.cxx b/examples/shapedwindow.cxx index 384a5561c..200899666 100644 --- a/examples/shapedwindow.cxx +++ b/examples/shapedwindow.cxx @@ -76,8 +76,7 @@ Fl_RGB_Image* prepare_shape(int w) { // draw a white circle with a hole in it on black background Fl_Image_Surface *surf = new Fl_Image_Surface(w, w); - Fl_Surface_Device* current = Fl_Surface_Device::surface(); - surf->set_current(); + Fl_Surface_Device::push_current(surf); fl_color(FL_BLACK); fl_rectf(-1, -1, w+2, w+2); fl_color(FL_WHITE); @@ -86,7 +85,7 @@ Fl_RGB_Image* prepare_shape(int w) fl_pie(0.7*w,w/2,w/4,w/4,0,360); Fl_RGB_Image* img = surf->image(); delete surf; - current->set_current(); + Fl_Surface_Device::pop_current(); return img; // return white image on black background } -- cgit v1.2.3