PDA

View Full Version : TRUE MODE



Azazel
01-27-2004, 05:36 AM
Does everybody know how to switch screen in a true hardware fullscreen mode, like Q3 does? They say that that is more faster... Anyway, I have to do that cause I will port my programm on WindowsXPEmbedded system. Or, even worse - on Linux MESA

zeckensack
01-27-2004, 06:17 AM
1)Switch screen mode

DEVMODE dm;
memset(&dm,0,sizeof(dm));
dm.dmSize=sizeof(dm);
dm.dmPelsWidth=xres;
dm.dmPelsHeight=yres;
dm.dmBitsPerPel=32; //or 16
dm.dmFields=DM_PELSWIDTH|DM_PELSHEIGHT|DM_BITSPERP EL;
//optional:
dm.dmDisplayFrequency=85; //or whatever
dm.dmFields|=DM_DISPLAYFREQUENCY;

int shmoo=ChangeDisplaySettings(&dm,CDS_FULLSCREEN);

2)create your window without borders or other decoration. WS_POPUP is the way to go.

3)when exiting, first destroy the rendering context, device context and window and then switch back to the original desktop resolution. The easiest and safest way to do this:


int shmoo=ChangeDisplaySettings(NULL,0);

Azazel
01-27-2004, 10:46 PM
Oh yes. Sorry, but I knew that long before. It is the first lession to my talmidim (if someone dont know, I am a teacher). When I do like that desktop still remains accessible, just press something like Ctrl+Esc... http://www.opengl.org/discussion_boards/ubb/frown.gif

Azazel
01-27-2004, 10:47 PM
Q3 surely do not go that way. How adout to use ChangeDisplaySettingsEX?

[This message has been edited by Azazel (edited 01-28-2004).]