PDA

View Full Version : About PIXELFORMATDESCRIPTOR



Meu
05-28-2005, 02:32 PM
Hello,
* About PIXELFORMATDESCRIPTOR is it dedicated only to the windows that handle openGL rendering??, because I searched the MSDN for it and I found that it lies only in the OpenGL documentation.
Thanks,
Mustafa ELBanna

powerpad
05-29-2005, 12:15 AM
I would guess so, although nobody hinders you use it for whatever you are up to.

Meu
05-29-2005, 12:51 AM
Thanks for replying,
But there is something make me confused.PIXELFORMATDESCRIPTOR has a dwFlags member has some flags like:
* PFD_SUPPORT_OPENGL: If I remove this flag what the PFD would be useful for??!!
* PFD_DOUBLE_BUFFERED: If I remove this parameter and my window now has no support for double buffering, OpenGL will work as single buffered (FLICKERING), or it will not work for the beginning?
I really feeling confused about the initialization..
Thanks,
Mustafa ELBanna

Ehsan Kamrani
05-29-2005, 01:15 AM
I sereched this structure in google.All the topics refer to the OpenGL.I also searched in MSDN:
Each window in the Microsoft implementation of *OpenGL* for Windows NT and Windows 95 has its own current pixel format. A pixel format is defined by a PIXELFORMATDESCRIPTOR data structure.

I don't know that why microsoft has written that PFD_SUPPORT_OPENGL. :confused: (it is very clear that it should support it )
-Ehsan-

Overmind
05-29-2005, 03:26 AM
Without the PFD_DOUBLE_BUFFERED you get a single buffered window, that means every draw command is immediately visible (or at least some time after glFlush()/glFinish()), and there is no need to call SwapBuffers. Of course you will get some flickering then...

The PFD_SUPPORT_OPENGL was propably meant for future compatibility with alternative APIs. It's always good to have such a flag in case Microsoft wanted to use the pixel format mechanism for something else instead of duplicating functionality or adding another Ex to the function name ;)

But AFAIK there is no such alternative use for pixel format descriptors, and there propably never will be one... But the designers of the API didn't know that back then.

Meu
05-29-2005, 01:03 PM
and about PFD_DRAW_TO_WINDOW flag in msdn they say
PFD_DRAW_TO_WINDOW The buffer can draw to a window or device surface..Can I draw to something other than a window??, and if where I can find more information about that.
Thanks,
Mustafa ELBanna

Ehsan Kamrani
05-29-2005, 01:10 PM
Yes:PFD_DRAW_TO_BITMAP. The buffer can draw to a memory bitmap.
But i never have used from this flag.
-Ehsan-

Meu
05-29-2005, 01:15 PM
So what it differ to him if it render to window or a bitmap??is not it just a surface?
Thanks,
Mustafa ELBanna

Ehsan Kamrani
05-29-2005, 02:39 PM
Dear Mustafa
I have no experience about the PFD_DRAW_TO_BITMAP. maybe someone else can help you.
-Ehsan-