Thanks very much for the clarification. Robert

Honestly, I myself don't how come there's such kind of mixed up in my
application, I only updated the version of osg from 2.0 to 2.2.

Whatever, So may I now only check out the newest version of osgviewerQT
without change my version of osg? Because it will take a lot of time to
change the osg libraries on every machine of my lab.

 

 

 

 

 

 

 

Hi Shuxing,

 

I'm afraid mixing PixelBuffers with GraphicsWindowEmbedded isn't going

to work, as osgViewer won't have the neccesary hooks in the graphics

context that it needs.  The graphics window embedded feature is not a

fully feature implemented, rather an adapter to make it really

straight forward to glue a viewer into the window.

 

In 2.3.0 dev release made last night (and SVN) the osgviewerQT example

now has two implementations of integration with QT, one the

GraphicsWindowEmbedded that you are familiar, and a second that

instead of using QGLWidget uses QWiget and osgViewer itself to create

the graphics contexts using GraphicsWindowWin32/X11/Carbon.  This

later technique has the advantage that osgViewer now nows much more

about the graphics contexts and can correctly share them.

 

Robert.

 

On Dec 18, 2007 3:51 AM, Shuxing Xiao <[EMAIL PROTECTED]> wrote:

> 

> 

> 

> 

> 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

> 

> 

_______________________________________________

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

Reply via email to