PDA

View Full Version : Using OpenGL & Multithreading under Windows Vista



Aekold
09-22-2009, 12:53 AM
Hello,
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:
http://img42.imageshack.us/img42/6025/1strender.png
After second OpenGL rendering:
http://img196.imageshack.us/img196/8563/2render.png
There is no such a problem under Windows XP.
Does anyone has any idea what this could be linked with?
Thanks,
Peter

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

yooyo
09-26-2009, 11:29 AM
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.