View Full Version : Using OpenGL & Multithreading under Windows Vista

09-22-2009, 01:53 AM
The use-case if the following:
1. We create a thread which renders an image using OpenGL. There are no visible artifacts during window resizing.
2. We switch the rendering mode, OpenGL thread is completely deleted and render with Win GDI.
3. We switch back to OpenGL rendering, creating a new thread and a new OpenGL context.
4. We resize window, and artifacts appear. The client area moves out of the correct limits though HWND, passed to OpenGL renderer still has correct client area coordinates.
There is no actual OpenGL rendering simultaneously from several threads.
After first OpenGL rendering:
After second OpenGL rendering:
There is no such a problem under Windows XP.
Does anyone has any idea what this could be linked with?

09-23-2009, 02:12 AM
Maybe it is a different OpenGL renderer, have you checked the PixelFormat? Are they the same?

09-26-2009, 12:29 PM
To me it looks like you forgot to adjust viewport size. OpenGL host control on second shot is bigger than viewport in same shot, and viewports are exactly same size on both shots.

Its a common error to catch size events and update viewport (glViewPort), but at that time there is no active gl contexts.