PDA

View Full Version : resizeGL()



mickey
6th April 2006, 16:46
Hi, myWidgetGl has resizeGL() but when I resize width window, in my scene Perspective seems don't take action; it works if I resize the hieght of window. Why this?



void MyWidget::resizeGL(int width,int height) {
printf("resizeGL...\n");
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
//cout << width << height << endl;
GLdouble ratio=((GLdouble)width/(GLdouble)height);
gluPerspective(45,ratio,3,40);
glViewport (0, 0, (GLdouble) width, (GLdouble) height);
glMatrixMode (GL_MODELVIEW);
glLoadIdentity ();
}

mickey
12th April 2006, 14:48
Any hints about this?
Thanks