call reshape() after init() to set initial projection/viewing transform (see bug 6941)
This commit is contained in:
@@ -473,7 +473,6 @@ event_loop(Display *dpy, Window win)
|
|||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case Expose:
|
case Expose:
|
||||||
/* we'll redraw below */
|
/* we'll redraw below */
|
||||||
reshape(event.xexpose.width, event.xexpose.height);
|
|
||||||
break;
|
break;
|
||||||
case ConfigureNotify:
|
case ConfigureNotify:
|
||||||
reshape(event.xconfigure.width, event.xconfigure.height);
|
reshape(event.xconfigure.width, event.xconfigure.height);
|
||||||
@@ -555,6 +554,7 @@ usage(void)
|
|||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
const int winWidth = 300, winHeight = 300;
|
||||||
Display *dpy;
|
Display *dpy;
|
||||||
Window win;
|
Window win;
|
||||||
GLXContext ctx;
|
GLXContext ctx;
|
||||||
@@ -589,7 +589,7 @@ main(int argc, char *argv[])
|
|||||||
return -1;
|
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);
|
XMapWindow(dpy, win);
|
||||||
glXMakeCurrent(dpy, win, ctx);
|
glXMakeCurrent(dpy, win, ctx);
|
||||||
|
|
||||||
@@ -602,6 +602,12 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
init();
|
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);
|
event_loop(dpy, win);
|
||||||
|
|
||||||
glDeleteLists(gear1, 1);
|
glDeleteLists(gear1, 1);
|
||||||
|
Reference in New Issue
Block a user