diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2006-08-29 07:36:51 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2006-08-29 07:36:51 +0000 |
| commit | 3ae2d9cc7b95bcb7a885719a20a588e93cf6001f (patch) | |
| tree | 25385df1acdf5e46dde3895e595b9fb02dee9763 | |
| parent | 345e0d7c8d8710ec6428e628769c72a11e6d9e67 (diff) | |
STR #1403: GLUT window creation code - better fix.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5376 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | CHANGES | 2 | ||||
| -rw-r--r-- | src/glut_compatability.cxx | 31 |
2 files changed, 7 insertions, 26 deletions
@@ -1,6 +1,6 @@ CHANGES IN FLTK 1.1.8 - - Fixed GLUT behavior on window creation (STR #1267) + - Fixed GLUT behavior on window creation (STR #1403) - Fixed OS X bug that would hide tooltips before they were shown (STR #1392) - Fixed Fl_Tabs tooltip reappearing (STR #1324) diff --git a/src/glut_compatability.cxx b/src/glut_compatability.cxx index 373beb438..25997eaa8 100644 --- a/src/glut_compatability.cxx +++ b/src/glut_compatability.cxx @@ -42,7 +42,6 @@ #define MAXWINDOWS 32 static Fl_Glut_Window *windows[MAXWINDOWS+1]; -static unsigned char reshaped[MAXWINDOWS+1]; Fl_Glut_Window *glut_window; int glut_menu; @@ -61,19 +60,8 @@ static int indraw; void Fl_Glut_Window::draw() { glut_window = this; indraw = 1; - if (!reshaped[number] ) { - // ignore the first show event on glutCreateWindow - // avoid flickering: - glClear(GL_COLOR_BUFFER_BIT); - reshaped[number] = 1; - } else { - if( !valid() || reshaped[number] == 1 ) { - reshaped[number] = 2; - reshape(w(),h()); - valid(1); - } - display(); - } + if (!valid()) {reshape(w(),h()); valid(1);} + display(); indraw = 0; } @@ -83,17 +71,8 @@ void glutSwapBuffers() { void Fl_Glut_Window::draw_overlay() { glut_window = this; - if (!reshaped[number] ) { - // ignore the first show event on glutCreateWindow - reshaped[number] = 1; - } else { - if( !valid() || reshaped[number] == 1 ) { - reshaped[number] = 2; - reshape(w(),h()); - valid(1); - } - overlaydisplay(); - } + if (!valid()) {reshape(w(),h()); valid(1);} + overlaydisplay(); } static void domenu(int, int, int); @@ -260,6 +239,8 @@ int glutCreateWindow(const char *title) { } else { W->show(); } + W->valid(0); + W->context_valid(0); W->make_current(); return W->number; } |
