summaryrefslogtreecommitdiff
path: root/src/Fl_Gl_Window.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 /src/Fl_Gl_Window.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 'src/Fl_Gl_Window.cxx')
-rw-r--r--src/Fl_Gl_Window.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx
index 7564f1a3a..f59b69244 100644
--- a/src/Fl_Gl_Window.cxx
+++ b/src/Fl_Gl_Window.cxx
@@ -359,8 +359,7 @@ void Fl_Gl_Window::draw_overlay() {}
*/
void Fl_Gl_Window::draw() {
#ifdef FL_CFG_GFX_OPENGL
- Fl_Surface_Device *prev_device = Fl_Surface_Device::surface();
- Fl_OpenGL_Display_Device::display_device()->set_current();
+ Fl_Surface_Device::push_current( Fl_OpenGL_Display_Device::display_device() );
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_DEPTH_TEST);
glPushMatrix();
@@ -375,7 +374,7 @@ void Fl_Gl_Window::draw() {
glPopMatrix();
glPushAttrib(GL_ENABLE_BIT);
- prev_device->set_current();
+ Fl_Surface_Device::pop_current();
#else
Fl::fatal("Fl_Gl_Window::draw() *must* be overriden. Please refer to the documentation.");
#endif