Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Gnome Programmer

Fullscreen using Win32?

This topic is 5679 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


just create your windows with WS_POPUP style and use this code to switch to fullscreen:

bool EnterFullscreen ()
DEVMODE newSettings;
// now fill the DEVMODE with standard settings, mainly monitor frequenzy

EnumDisplaySettings ( NULL, 0, &newSettings );
// set desired screen size/res

newSettings.dmPelsWidth = 800;
newSettings.dmPelsHeight = 600;
newSettings.dmBitsPerPel = 16;
//set those flags to let the next function know what we want to change

// and apply the new settings

if ( ChangeDisplaySettings ( &newSettings, CDS_FULLSCREEN )
return false; // in case of error

else return true;

// and to reset the screen on program exit:

void ResetScreen ()
// this resets the screen to the registry-stored values

ChangeDisplaySettings ( NULL, 0 );

just substitute the 800/600/16 with the screen res you want

Runicsoft -- home of my open source Function Parser and more

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!