Hi Robert, Paul and J-S,
I don't think I was clear enough. Its too early to say that wglMakeCurrent
will be a good workaround for OSG.
I only said that it "relaxed" the problem in my OpenGL repro.
It looks like first wglMakeCurrent (when renderer thread is started) does
not initialize properly some internal OpenGL context data. If I repeat it in
second frame everything becomes correct. So if wglMakeCurrent was a solution
it would be needed only once more on frame.
But I learned all this using my open gl repro without Display Lists and to
be honest I did not checked what will happen if DisplayLists are generated
on a first frame (like OSG does). I suspect they might stay screwed even if
second wglMAkeCurrent gets called. I am currently trying to check this out.
I just need some more time to investigate.
I got some questions regarding this issue so I decided to inform guys for
whom this is relevant by posting on osg-users. I am certainly far from
proposing fixes at this moment.
Wojtek
Hi Wojciech,
On Fri, May 9, 2008 at 2:16 PM, Wojciech Lewandowski
<[EMAIL PROTECTED]> wrote:
Problem could be relaxed when wglMakeCurrent gets called before each
frame
rendering. I noticed that artifacts appeared when wglMakeCurrent was
called
only once while worker rendering thread initialization . When
wglMakeCurrent
was called every frame artifacts did not appear.
wglMakeCurrent "shouldn't" be required if one has a thread per
context, one a thread does a wglMakeCurrent() it shouldn't release the
context till this thread calls release context (done with
wglMakeCurrent(_hdc, NULL)).
As you are finding that the wglMakeCurrent() per frame is required,
this either suggests that the OpenGL driver is playing fast and loose
with the graphics context behind the scenes so the app looses the
context being current, in which case this is very much a driver bug,
or that the OSG itself is doing makeCurrent on the context from
another thread or releasing the context when it shouldn't.
Could you put some debug output into GraphicsWindowWin32.cpp's
makeCurrentImplementation(..) and relaseContextImplementation(..) to
see if there are being called when you wouldn't expect, printing out
the
pointer to the current thread would be useful as well.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org