View Full Version : screen and dib contexts

05-20-2004, 07:52 AM
There are any solution to use the same context for direct screen render and Dib render?
Now I must to create the primitives in 2 contexts, one for renders to screen and another to render and save bitmap. It's slow my application when there are a change in any primitive.

It's possible to use only 1 render context or is possible to copy the primitives from one context to other?


05-23-2004, 04:09 PM
2 contexts are needed because DIB and Window rendering are mutually exclusive and belong to the pixel format which can be set only once.

Of course, you are aware that DIB rendering is only supported by the Microsoft GDI software implementation, which could alone explain why your application is slow.

Still, you should have a look at wglShareLists.

05-24-2004, 12:53 AM
Thank Kehziah for your attention, i has see the diferents functions wglcopy..., wglsharelist, ... especifics of windows for OpenGL and i don't found nothing to optimize my application.

Another time thanks.

06-09-2004, 12:48 PM
Dib & back buffer can't have a compatible Pixelformat, and render to DIB is not accelerated.
You can render to back and copy to dib using glreadpixels/gldrawpixels or use a pbuffer.