On 11/3/06, Bertrand Coconnier <[EMAIL PROTECTED]> wrote:
Hi,
After investigating a bit in the Wine code, it seems that the flickering
bug of WoW in OpenGL mode is due to wglGetPbufferDCARB that returns a DC
which type is OBJ_MEMDC while it should return a DC which type is
OBJ_DC. And since in the current git tree, the DC type of a Pbuffer is
OBJ_MEMDC then the code located in lines 1394-1395 of
dlls/winex11.drv/opengl.c is executed : the Pbuffer is copied to the
screen each time the GL context is made current to the Pbuffer hence the
flickering (WoW bounds the GL context alternatively to the screen and to
the Pbuffer). The expected behaviour is not to copy the Pbuffer content
to the screen since WoW does it itself.
The easiest workaround for this bug would be to make
X11DRV_wglGetPbufferDCARB to return the Pbuffer's object->hdc (this
fixes the flickering bug). However, I have made some tests with Windows
XP and it appears that wglGetPbufferDCARB returns a HDC different from
the HDC passed when wglCreatePbufferARB was called. So such a patch
would be a dirty hack not a real fix.
http://oss.sgi.com/projects/ogl-sample/registry/ARB/wgl_pbuffer.txt
"To create a device context for the pbuffer, call
HDC wglGetPbufferDCARB(HPBUFFERARB hPbuffer);
where <hPbuffer> is a handle returned from a previous call to
wglCreatePbufferARB. A device context is returned by
wglGetPbufferDCARB which can be used to associate a rendering
context with the pbuffer. Any rendering context created with
a wglCreateContext that is "compatible" with the <iPixelFormat> may
be used to render into the pbuffer."
So yes, it's supposed to return a new one.
So I can understand better, what are these set to when you run your
program on both windows and linux?
type1 = GetObjectType(hDC);
type2 = GetObjectType(pBufferHDC);
Jesse