Jump to content

  • Log In with Google      Sign In   
  • Create Account

Lock window size


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Shawn619   Members   -  Reputation: 342

Like
0Likes
Like

Posted 01 May 2013 - 05:06 PM

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)?



Sponsor:

#2 Brother Bob   Moderators   -  Reputation: 8632

Like
3Likes
Like

Posted 01 May 2013 - 05:53 PM

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.



#3 Shawn619   Members   -  Reputation: 342

Like
0Likes
Like

Posted 01 May 2013 - 09:32 PM

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?



#4 Brother Bob   Moderators   -  Reputation: 8632

Like
1Likes
Like

Posted 02 May 2013 - 01:04 AM

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


Edited by Brother Bob, 02 May 2013 - 01:04 AM.


#5 Shawn619   Members   -  Reputation: 342

Like
0Likes
Like

Posted 02 May 2013 - 03:01 AM

Ah, that works. Thanks!






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS