diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Gl_Window.cxx | 10 | ||||
| -rw-r--r-- | src/fl_rect.cxx | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/Fl_Gl_Window.cxx b/src/Fl_Gl_Window.cxx index e74065ac6..82b38fd14 100644 --- a/src/Fl_Gl_Window.cxx +++ b/src/Fl_Gl_Window.cxx @@ -187,6 +187,8 @@ public: } void push_clip(int x, int y, int w, int h) { // TODO: implement OpenGL clipping + if (rstackptr < region_stack_max) rstack[++rstackptr] = 0L; + else Fl::warning("Fl_OpenGL_Graphics_Driver::push_clip: clip stack overflow!\n"); } int clip_box(int x, int y, int w, int h, int &X, int &Y, int &W, int &H) { // TODO: implement OpenGL clipping @@ -199,12 +201,20 @@ public: } void push_no_clip() { // TODO: implement OpenGL clipping + if (rstackptr < region_stack_max) rstack[++rstackptr] = 0; + else Fl::warning("Fl_OpenGL_Graphics_Driver::push_no_clip: clip stack overflow!\n"); + restore_clip(); } void pop_clip() { // TODO: implement OpenGL clipping + if (rstackptr > 0) { + rstackptr--; + } else Fl::warning("Fl_OpenGL_Graphics_Driver::pop_clip: clip stack underflow!\n"); + restore_clip(); } void restore_clip() { // TODO: implement OpenGL clipping + fl_clip_state_number++; } }; diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx index 7979c1085..771cc6a8b 100644 --- a/src/fl_rect.cxx +++ b/src/fl_rect.cxx @@ -45,9 +45,9 @@ // This is defined in src/fl_line_style.cxx extern int fl_line_width_; + void Fl_Graphics_Driver::restore_clip() { fl_clip_state_number++; - Fl_Region r = rstack[rstackptr]; } void Fl_Graphics_Driver::clip_region(Fl_Region r) { |
