PDA

View Full Version : what should i do when window is resized? (under windows)



miko
04-15-2003, 09:11 AM
what should i do when user decides to resize my window (with opengl context)? should i delete old device context, old gl context and then create new ones? or what... please i really need your help!

shinpaughp
04-15-2003, 10:18 AM
You shouldn't need to delete the context. It should be as simple as calling glViewport with the new size of the window.

nexusone
04-15-2003, 10:49 AM
Under GLUT it is all handled in a resize routine, all you do is tell it what to do when there is a window resize.
And the same in Windows you do not need to delete and create new context.

Just adjust the viewport to render only in the new area.



Originally posted by miko:
what should i do when user decides to resize my window (with opengl context)? should i delete old device context, old gl context and then create new ones? or what... please i really need your help!



[This message has been edited by nexusone (edited 04-15-2003).]

miko
04-15-2003, 11:25 AM
ok, you helped me much. THANKS!