Jump to content
  • Advertisement
Sign in to follow this  
nickme

opengl screen resolution.

This topic is 2536 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,

when i opened a window in vc++ 2010 express with glut, the window size was 600x600, it occupied almost all the vertical screen space. but my monitor resolution is 1920x1080. how can i open a window in opengl with the true pixel count as what my monitor is capable of?

thanks.

Share this post


Link to post
Share on other sites
Advertisement
There are several concepts going on, and it isn't immediately clear which one you are referring to.



Window size can mean several things.

There is the OS window size (that's the border containing menus and minimize/maximize/close buttons), and there is the viewing matrix window size used for the matrix math. There can be additional intermediate window sizes, such a DC/RC that is involved in the process.




If you are talking about the OS window size, in glut make sure you are calling all of glutInitWindowPosition(), glutInitWindowSize() glutInitDisplayMode(), all of them before calling glutCreateWindow().

Getting the current screen resolution on Windows can be interesting. For starting out you can use GetSystemMetrics() with SM_CXBORDER and SM_CYBORDER, respectively. If there are multiple monitors installed you will need to do additional steps to enumerate the monitors and get the correct one.


Finally there is the issue of setting your numeric view matrix to what you expect. If you were using an orthographic projection, setting it to the window size is not hard with glOrtho() and glViewport(), but you will need to know the size of the OS window that was created. Quick link to OpenGL.org FAQ on this subject.

Share this post


Link to post
Share on other sites
hi GDNet+,
i just checked the start Menu->control panel->display->property of my win7 os. it clearly shows that the resolution of my monitor is 1920x1080. but when i opened a 600x600 window with glut, the window was almost covered all the height of the monitor (the width is just covered about 1/3.) my question is, how can i open a 1920x1080 window which my samsung e2220 is capable of ?

i tried the GetSystemMetrics call. it showed SM_CXSCREEN and SM_CYSCREEN to be 1280x720. is that because glut only supports that resolution?

thank for your help.

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!