Opengl Initialization Problem

Why the opengl window could not be created at out of the screen(desktop)?

There is no problem if i use PFD_SUPPORT_GDI.
But, PFD_SUPPORT_GDI and PFD_DOUBLEBUFFER flags are mutually exclusive in the current generic implementation. It means you can not use these two flags at same time.

1- create a window
2- move your window to out of the screen
3- create an opengl window as a child of your window (use PFD_DOUBLEBUFFER)
4- move your window to the desktop area

after these steps, i got a black uninitialized ogl window but if i use PFD_SUPPORT_GDI insted of PFD_DOUBLEBUFFER, everythig works well.

also everythig works if you initialize your opengl window in the desktop area with PFD_DOUBLEBUFFER flag.

during the initializatin of the opengl window, no any error occurs at out of the desktop area or in the desktop area.

is anybody know something about it?

thanks

acraft

try to use these settings:

PIXELFORMATDESCRIPTOR pfd;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_TYPE_RGBA;

sorry-

pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_TYPE_RGBA;

is wrong; this is right:

pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;

PFD_TYPE_RGBA must be used as

pfd.iPixelType = PFD_TYPE_RGBA;

anyway, you can’t use PFD_SUPPORT_GDI and PFD_SUPPORT_DOUBLEBUFFER together, because GDI functions cannot draw into the backbuffer. so if you want to use GDI functions together with OPENGL functions, you must use a single buffer.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.