summaryrefslogtreecommitdiff
path: root/examples/shapedwindow.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-12-07 15:09:52 +0000
committerManolo Gouy <Manolo>2016-12-07 15:09:52 +0000
commit43935dffeb7cb54a97b2a8a610c2e453743c0da9 (patch)
tree9f132039b9cf120263bf03965c152ac17853969c /examples/shapedwindow.cxx
parent0a1eed150a9d9215f70f1e50db2ec555199aee7d (diff)
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
Diffstat (limited to 'examples/shapedwindow.cxx')
-rw-r--r--examples/shapedwindow.cxx5
1 files changed, 2 insertions, 3 deletions
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
}