• Advertisement


This topic is now archived and is closed to further replies.

GLUI and window resize

This topic is 6084 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi. i am using glui to make my ui. anyway, i just noticed (after a few weeks) that when i resize my window, the image gets stretched, it does not maintain the correct aspect ratio. i know, i know, i should have found this sooner, but i was spending all my time on programming, i never thought to resize. my code to resize is: void reshape(int w1, int h1){ int tx, ty, tw, th; GLUI_Master.get_viewport_area( &tx, &ty, &tw, &th); h = tw; w = tw; if (h == 0) h = 1; ratio = 1.0f * w/h; glMatrixMode(GL_PROJECTION); glLoadIdentity(); GLUI_Master.auto_set_viewport(); gluPerspective(45, ratio, 0.1,1000); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt(x,y,z,x+lx,y+ly,z+lz,0.0f,1.0f,0.0f); } i know that GLUI does some thingss to automatically make keep itself the same size. does anyone know a way to fix the stretch problem? also, is there way to find the dimensions of the window, without the UI? i want to hide the mouse when it is over hte opengl, but not when i go to the UI. by the way, my glui window is attached if that makes a difference. Thanks in advance. Jason

Share this post

Link to post
Share on other sites

  • Advertisement