Fullscreen OpenGL
I can get a fullscreen app in the current video resolution but how can I change the resolution? Direct X? Windows API? Thanks.
Specifically, do something like this:
DEVMODE devMode;
memset( &devMode, 0, sizeof( devMode ) );
devMode.dmSize = sizeof( devMode );
devMode.dmPelsWidth =;
devMode.dmPelsHeight =;
devMode.dmFields = DM_PELSWIDTH / DM_PELSHEIGHT;
( note that the slash in the above line is really a vertical OR symbol--it just won't display correctly on this site )
ChangeDisplaySettings( &devMode, CDS_FULLSCREEN );
I'm not sure if CDS_FULLSCREEN actually does anything or not, but it can't hurt. This will succeed only if your video card and monitor are capable of the resolution you specify. To find out what resolutions are available, use the EnumDisplaySettings function.
--Heinzah
Edited by - Heinzah on 1/21/00 11:37:01 AM
DEVMODE devMode;
memset( &devMode, 0, sizeof( devMode ) );
devMode.dmSize = sizeof( devMode );
devMode.dmPelsWidth =
devMode.dmPelsHeight =
devMode.dmFields = DM_PELSWIDTH / DM_PELSHEIGHT;
( note that the slash in the above line is really a vertical OR symbol--it just won't display correctly on this site )
ChangeDisplaySettings( &devMode, CDS_FULLSCREEN );
I'm not sure if CDS_FULLSCREEN actually does anything or not, but it can't hurt. This will succeed only if your video card and monitor are capable of the resolution you specify. To find out what resolutions are available, use the EnumDisplaySettings function.
--Heinzah
Edited by - Heinzah on 1/21/00 11:37:01 AM
If you''re using glut, glutFullScreen() will make the app fullscreen in whatever the current screen resolution is.
There can be some strange results depending on which order you call all the functions to set up OpenGL and then change the resolution - moving and resizing windows is one of the most annoying.
It would be a good idea to take a look at Ryan Haksi''s setup code in his gldemo. That''s the best freely available implementation I''ve seen. Plus he has a lot of other really useful code in there.
http://members.home.com/borealis/opengl.html
Scott Franke [druid-]
sfranke@usc.edu
druid-'s GL Journal
http://www.gamedev.net/opengl
It would be a good idea to take a look at Ryan Haksi''s setup code in his gldemo. That''s the best freely available implementation I''ve seen. Plus he has a lot of other really useful code in there.
http://members.home.com/borealis/opengl.html
Scott Franke [druid-]
sfranke@usc.edu
druid-'s GL Journal
http://www.gamedev.net/opengl
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement