Advertisement

Fullscreen OpenGL

Started by January 18, 2000 05:20 PM
5 comments, last by acw83 25 years, 1 month ago
I can get a fullscreen app in the current video resolution but how can I change the resolution? Direct X? Windows API? Thanks.
Use the ChangeDisplaySettings function.
Advertisement
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
Thanks
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
Advertisement
There is some code on 3DGameDev in the Source Code section showing how to use OpenGL in Fullscreen.

Link

-Dan Smith
dans@3dgamedev.com

D. Smith

This topic is closed to new replies.

Advertisement