Jump to content
  • Advertisement

Archived

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

Gnome Programmer

Fullscreen using Win32?

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

Advertisement
Hi

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

newSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT"
// and apply the new settings

if ( ChangeDisplaySettings ( &newSettings, CDS_FULLSCREEN )
!= DISP_CHANGE_SUCCESSFUL )
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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!