Skip to main content
GameDev.net gamedev.net
🔒 Locked

resultion switching errors

Started by Damocles Jul 22, 2003 at 7:21 AM 1 replies 250+ views
Original Post
Damocles
Damocles
I'm trying to create a fullscreen display at a set resolution and am changing the display resolution. I use:
DEVMODE dmScreenSettings;								// Device Mode

		memset(&dmScreenSettings,0,sizeof(dmScreenSettings));	// Makes Sure Memory's Cleared

		dmScreenSettings.dmSize=sizeof(dmScreenSettings);		// Size Of The Devmode Structure

		dmScreenSettings.dmPelsWidth	= width;				// Selected Screen Width

		dmScreenSettings.dmPelsHeight	= height;				// Selected Screen Height

		dmScreenSettings.dmBitsPerPel	= bits;					// Selected Bits Per Pixel

		dmScreenSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;

		// Try To Set Selected Mode And Get Results.  NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.

		ChangeDisplaySettings(&dmScreenSettings,CDS_FULLSCREEN)
 
The resolution changes but weird errors occur. If I switch to 640x480 the mouse pointer cannot move to the lower right area of the screen (it's as if the mouse area is smaller than the resolution). If I switch to 1024x768 the screen displays down and to the left by about 400 pixels So what's the stupidly obvious error I'm making this time? [edited by - damocles on July 22, 2003 12:48:48 PM]
------------------------------------------[New Delta Games] | [Sliders]
Damocles
Damocles
Ok, the mouse problem at 640x480 was my bad, and is now fixed, but I still can''t figure out why the screen is displayed completely out of place at 1024x768.

On a side note - why do the code bb tags sometimes make it so the code isn''t displayed in a handy scroll box like it''s supossed to?
------------------------------------------[New Delta Games] | [Sliders]
Damocles
Damocles
D''oh, that''ll teach me to visit other forums I got used to using the code tags and forgot it''s source around here
------------------------------------------[New Delta Games] | [Sliders]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.