summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2006-08-25 09:11:42 +0000
committerMatthias Melcher <fltk@matthiasm.com>2006-08-25 09:11:42 +0000
commit961391ac0804f708e46fa3b8c54d84e26ab392e6 (patch)
tree3f49ce742e2ac8d079969b9927a4e7211ff8f39f /src
parent4fae32c85cd2ac14879cc0855d1a7e348cac21fd (diff)
Fixed GLUT behavior on window creation (STR #1267)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5363 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/glut_compatability.cxx27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/glut_compatability.cxx b/src/glut_compatability.cxx
index 90d2d80ca..85ea3cb6d 100644
--- a/src/glut_compatability.cxx
+++ b/src/glut_compatability.cxx
@@ -42,6 +42,7 @@
#define MAXWINDOWS 32
static Fl_Glut_Window *windows[MAXWINDOWS+1];
+static unsigned char reshaped[MAXWINDOWS+1];
Fl_Glut_Window *glut_window;
int glut_menu;
@@ -60,8 +61,17 @@ static int indraw;
void Fl_Glut_Window::draw() {
glut_window = this;
indraw = 1;
- if (!valid()) {reshape(w(),h()); valid(1);}
- display();
+ 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);
+ }
+ display();
+ }
indraw = 0;
}
@@ -71,8 +81,17 @@ void glutSwapBuffers() {
void Fl_Glut_Window::draw_overlay() {
glut_window = this;
- if (!valid()) {reshape(w(),h()); valid(1);}
- overlaydisplay();
+ 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();
+ }
}
static void domenu(int, int, int);