PDA

Click to See Complete Forum and Search --> : FullScreen ?


slx47
May 11th, 2002, 03:50 PM
i am making a opengl program and was wondering how would i make it full screen. When i put this code in the compiler says its wrong:


DEVMODE devModeScreen;
memset(&devModeScreen,0,sizeof(devModeScreen));
devModeScreen.dmSize = sizeof(devModeScreen);
devModeScreen.dmPelsWidth = screenWidth;
devModeScreen.dmpelsHeight = screenHeight;
devModeScreen.dmBitsPerPel = screenBpp;
devModeScreen.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL;

if (ChangeDisplaySettings(&devModeScreen, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
fullscreen = false;

HarryW
May 11th, 2002, 05:21 PM
I've never written any OpenGL code before but I did notice an inconsistency on yoru code:

devModeScreen.dmpelsHeight = screenHeight;
probably ought to be:
devModeScreen.dmPelsHeight = screenHeight;

parksie
May 11th, 2002, 06:14 PM
Just as a quick request, next time you have a problem with compilation if you could post the compiler errors as well it makes it a bit easier since most of the time it's something obvious.

Check out http://nehe.gamedev.net for some helpful tips for OpenGL :)