Advertisement

ChangeScreenResolution

Started by May 17, 2003 05:05 AM
2 comments, last by Godvalve 21 years, 9 months ago
Hey guys / gals...... I''m looking for information about the ChangeScreenResolution function used in the base code. if (ChangeScreenResolution (window->init.width, window-> init.height, window->init.bitsPerPixel) == FALSE) { I''ve done a search on MSDN and was unable to turn up anthing. I did a search on this forum to see if the topic has been covered previously but did not find anything either. I also have a copy of Petzold''s Programming Windows 5th Ed. but was unable to find anything. I''m using VC++ 6 and so using the built in search function, I did a generic search on the compiler location on the drive to see if I could find the string in any of the source files. I didn''t even turn anything up with that. Any information would be great! Thx.
Cruz''n the scene.....
Anything?
Quite strange. My MSDN reports a lot of useful things on ChangeDisplaySettings. Hey, here's the problem.

The function you are searching for is problably designed by NeHe so everything look better and more portable.
By searching the SRC, you should be able to find a place in which it recalls something like
"...if(ChangeDisplaySettings(&fullScreenMode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)..."

Keywords: ChangeDisplaySettings (documented on MSDN), CDS_FULLSCREEN, DISP_CHANGE_SUCCESSFUL.

Search for that and see if you can understand more... See you.

EDIT: uh-oh, forgot that you are unable to find the func definition in the code. This is bad. I never used that 'basecode' so I cannot help you more than this. Sorry.

[edited by - Krohm on May 17, 2003 7:37:37 AM]

Previously "Krohm"

Advertisement
check the file NeHeGL.cpp it contains the code that you need or want to look at. The function name is just something that NeHe and other people have put together to clean up the code.

Just incase you can''t find it here it is.

  BOOL ChangeScreenResolution (int width, int height, int bitsPerPixel)	// Change The Screen Resolution{	DEVMODE dmScreenSettings;											// Device Mode	ZeroMemory (&dmScreenSettings, sizeof (DEVMODE));					// Make Sure Memory Is Cleared	dmScreenSettings.dmSize				= sizeof (DEVMODE);				// Size Of The Devmode Structure	dmScreenSettings.dmPelsWidth		= width;						// Select Screen Width	dmScreenSettings.dmPelsHeight		= height;						// Select Screen Height	dmScreenSettings.dmBitsPerPel		= bitsPerPixel;					// Select Bits Per Pixel	dmScreenSettings.dmFields			= DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;	if (ChangeDisplaySettings (&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)	{		return FALSE;													// Display Change Failed, Return False	}	return TRUE;														// Display Change Was Successful, Return True}  


Hope this helps.
Paulhttp://members.lycos.co.uk/p79
I''m an idiot. Thx for all your help!
Cruz''n the scene.....

This topic is closed to new replies.

Advertisement