PDA

View Full Version : Don' know how to fill DEVMODE parameter in ChangeDisplaySettings()?



Least Lee
11-08-2001, 05:04 AM
Hello, I am a beginner in opengl..
I have to display the result in full screen.
I have search for "ChangeDisplaySettings()"
but none of them answer how to fill the
DEVMODE parameter...

I am newbie to opengl and an beginner to mfc
(or win32) as well.
Can anybody give me a simple example on how to fill DEVMODE parameter?

Help please..I am stuck for long hours over full screen..

ByteZero
11-08-2001, 05:14 AM
Maybe this code would help you

DEVMODE dmScreenSettings; //acess for the struct

//INIT THE FULLSCREEN
memset(&dmScreenSettings, 0, sizeof(dmScreenSettings)); dmScreenSettings.dmSize = sizeof(DEVMODE);
dmScreenSettings.dmPelsWidth = SCREEN_WIDTH;
dmScreenSettings.dmPelsHeight= SCREEN_HEIGHT;
dmScreenSettings.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;

//FULLSCREEN flag
ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN);

Bob
11-08-2001, 05:19 AM
Other usefull fields are dmBitsPerPel (colordepth) and dmFrequency (refresh rate). Just make sure you or in DM_BITSPERPEL and/or DM_FREQUENCY.

Least Lee
11-08-2001, 05:30 AM
Great!Fast and excellent response...

Furthermore, I am using MFC with mulitple document.
In which position should i place this code
into ...

in fact, i have tried to put those
inside onpaint. But that the screen area outside the window is
flickering ...
it seems that there are some other code reset
to original window size ...

Can you help please..?

ByteZero
11-08-2001, 06:36 AM
Do you have tried to use SwapBuffer(hDC);

maybe that would help to solve your Problem