Sign in to follow this  

Reshaping a window along with it's subwindows

Recommended Posts

Hi i am a novice and using opengl with glut.. smne plz tell me how can i reshape a window along with its that each dispay on the scrren (including those visible in the subwindows) are changed proportionatly....

Share this post

Link to post
Share on other sites
Unfortunately this is something you need to do yourself (unless you use some advanced GUI framework). The advanced GUI frameworks usually let you pin the sides of the window to the borders. What you want to do sounds like proportionally size the controls.

It boils down to:

On startup remember all the control positions and sizes

On the size event (WM_SIZE), glut probably offers a callback use the given new size to calculate the new positions and sizes. You might want to use BeginDeferWindowPos and EndDeferWindowPos around SetWindowPos if the number of controls is not a small number to keep flickering down.
Use the remembered sizes for the calculation, otherwise rounding errors will creep in.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this