summaryrefslogtreecommitdiff
path: root/src/xdemos/glxgears.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-05-17 22:44:18 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-05-17 22:44:18 +0000
commitd959476d666a3037cd4bc8f7efbab3f428dcb90d (patch)
treec29e96abab614a0fe83825b1961c5dd2eaa38369 /src/xdemos/glxgears.c
parent1736879910f81ec1bf9bc83675295fa26254c980 (diff)
call reshape() after init() to set initial projection/viewing transform (see bug 6941)
Diffstat (limited to 'src/xdemos/glxgears.c')
-rw-r--r--src/xdemos/glxgears.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/xdemos/glxgears.c b/src/xdemos/glxgears.c
index feae773a..75d63e51 100644
--- a/src/xdemos/glxgears.c
+++ b/src/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);