summaryrefslogtreecommitdiffstats
path: root/progs
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2006-05-17 22:44:18 +0000
committerBrian Paul <[email protected]>2006-05-17 22:44:18 +0000
commit4c6319db9cea911609d97fca20eeac142a575d44 (patch)
tree98d2ed0cae4e30366baa613f80fcfdbc87124401 /progs
parentb99c801f733be48520af9ee9efe53edaef5d756f (diff)
call reshape() after init() to set initial projection/viewing transform (see bug 6941)
Diffstat (limited to 'progs')
-rw-r--r--progs/xdemos/glxgears.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/progs/xdemos/glxgears.c b/progs/xdemos/glxgears.c
index feae773a5fd..75d63e51a2e 100644
--- a/progs/xdemos/glxgears.c
+++ b/progs/xdemos/glxgears.c
@@ -473,7 +473,6 @@ event_loop(Display *dpy, Window win)
switch (event.type) {
case Expose:
/* we'll redraw below */
- reshape(event.xexpose.width, event.xexpose.height);
break;
case ConfigureNotify:
reshape(event.xconfigure.width, event.xconfigure.height);
@@ -555,6 +554,7 @@ usage(void)
int
main(int argc, char *argv[])
{
+ const int winWidth = 300, winHeight = 300;
Display *dpy;
Window win;
GLXContext ctx;
@@ -589,7 +589,7 @@ main(int argc, char *argv[])
return -1;
}
- make_window(dpy, "glxgears", 0, 0, 300, 300, &win, &ctx);
+ make_window(dpy, "glxgears", 0, 0, winWidth, winHeight, &win, &ctx);
XMapWindow(dpy, win);
glXMakeCurrent(dpy, win, ctx);
@@ -602,6 +602,12 @@ main(int argc, char *argv[])
init();
+ /* Set initial projection/viewing transformation.
+ * We can't be sure we'll get a ConfigureNotify event when the window
+ * first appears.
+ */
+ reshape(winWidth, winHeight);
+
event_loop(dpy, win);
glDeleteLists(gear1, 1);