Jump to content

  • Log In with Google      Sign In   
  • Create Account

GLUI and window resize


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 nycjay   Members   -  Reputation: 122

Like
Likes
Like

Posted 25 July 2001 - 12:19 PM

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

Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS