Jump to content
  • Advertisement
Sign in to follow this  
Shawn619

OpenGL Lock window size

This topic is 2053 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

A couple questions about window sizes in OpenGL and GLUT:

(1) How can i lock a window at 720x480 OR fullscreen(windowed)? (ie: take over manual resize and only have maximize/minimize)

(2) How can i lock a window at 720x480? (take away resize AND maximize button)

(3) How can i lock a window at fullscreen(windowed)?

Share this post


Link to post
Share on other sites
Advertisement

You have to control this at the windowing level, OpenGL has nothing to do with this. Since you mention GLUT, you are stuck with what it provides, which is next to nothing in this case. The best you can do it resize the window back to its original size if the user changes it.

Share this post


Link to post
Share on other sites

The best you can do it resize the window back to its original size if the user changes it.

 

Thanks for the info!

 

That might work for me. I tried

void handleResize(int w, int h) {
    glViewport(0, 0, 720, 480);
    windowWidth=720;
    windowHeight=480;
}

 

But that doesn't work. How do you propose I do what you say?

Share this post


Link to post
Share on other sites

You need to resize the window. Call glutReshapeWindow if the size is not the correct one.

Edited by Brother Bob

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!