I'm using osgviewerQT as my windowing system, so the graphicswindow it uses
is GraphicsWindowEmbedded.
But when it comes to realizeImplementation() function of PixelBufferWin32
class, I got the following runtime error:
Run-Time Check Failure #3 - The variable 'hglrc' is being used without being
defined.
I traced the stack, and found in bool
PixelBufferWin32::realizeImplementation()
if (_traits->sharedContext)
{
HGLRC hglrc;
GraphicsWindowWin32* graphicsWindowWin32 =
dynamic_cast<GraphicsWindowWin32*>(_traits->sharedContext);
if (graphicsWindowWin32)
{
hglrc = graphicsWindowWin32->getWGLContext();
}
else
{
PixelBufferWin32* pixelBufferWin32 =
dynamic_cast<PixelBufferWin32*>(_traits->sharedContext);
if (pixelBufferWin32)
{
hglrc = pixelBufferWin32->getWGLContext();
}
}
wglShareLists(hglrc, _hglrc);
}
Since my graphicswindow is GraphicsWindowEmbedded, then the two dynamic_cast
will all return NULL.
And then the hglrc will be uninitialized when wglShareLists is invoked. That
causes the error. However, I've no idea how to fix this runtime error.
BTW, This error doesn't happen when I first setup my scene and view it, but
when I modified the scene and changed one of its node.
Any help will be great appreciated, thanks a lot.
Sincerely yours,
Shuxing Xiao
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org