what should i do when window is resized? (under windows)

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!

You shouldn’t need to delete the context. It should be as simple as calling glViewport with the new size of the window.

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).]

ok, you helped me much. THANKS!