Jump to content
  • Advertisement
Sign in to follow this  
Olivegreen

Reshaping a window along with it's subwindows

This topic is 3473 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 a novice and using opengl with glut.. smne plz tell me how can i reshape a window along with its subwindows...so 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
Advertisement
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:

1)
On startup remember all the control positions and sizes

2)
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!