PDA

View Full Version : Some questions about wglMakeCurrent



FoxDie
01-13-2001, 11:32 PM
If I use this function ,is OpenGL
rendered over DirectDraw?
I don't understand why it using
handle on device context as parameter.
It's like DirectDraw conventions.
If it true ,how I can disable
DirectDraw in OpenGL(without GLUT)?

Elixer
01-14-2001, 10:04 AM
??? Um, have a look at the docs for that.
Making something for openGL or DX is a different process, it depends on how you set it up.

Why would you want to disable directdraw anyway? If you aren't using it, then it won't load it.

FoxDie
01-15-2001, 08:11 AM
Elixer
you understand my question.
I don't want disbale DirectDraw,
but I want init OpenGL without DirectDraw.
Anyway ,how I can create fullscreen
window?

daveg
01-15-2001, 08:23 AM
I'm not sure how DirectDraw plays into your question... wglMakeCurrent is a way for OpenGL to know which Windows rendering context should recieve the drawing calls.

As far as making a window fullscreen, you need to do something like this:

DEVMODE gWindowMode;

gWindowMode.dmSize = sizeof(DEVMODE);
gWindowMode.dmBitsPerPel = 0;
gWindowMode.dmPelsWidth = width;
gWindowMode.dmPelsHeight = height;
gWindowMode.dmDisplayFlags = 0;
gWindowMode.dmDisplayFrequency = 0;
gWindowMode.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT;

ChangeDisplaySettings(&gWindowMode, CDS_FULLSCREEN);

I generally do this upon WM_ACTIVATE when the LOWORD(wParam) is WA_ACTIVE.

Make sure you change it back to non-fullscreen when you are finished.

ChangeDisplaySettings(NULL, 0);

You also probably want to make sure your window style (passed into CreateWindow) does not contain WS_BORDER or WS_CAPTION.

dave

FoxDie
01-15-2001, 08:47 AM
DaveG
thank you very much.