[osg-users] osg & gui solved!

Mike Weiblen mweiblen at zebraimaging.com
Fri Oct 12 08:31:43 PDT 2007


Correct, for performance reasons OSG does not save/restore the GL state
across GL calls.  There is simply too much state to do that efficiently
(without the deeper knowledge encapsulated in the non-OSG GL code)

Instead, OSG keeps track of the state as OSG changes it.  If you change
that state without OSG's knowledge, you either have to restore the state
(as you have done), or have your GL code set the OSG dirty flags of the
state you've modified, so OSG knows what to restore.  The latter is
preferred, which is why OSG does not have the begin/endExternalDraw
calls.

Cheers
-- mew

Mike Weiblen -- Zebra Imaging -- Austin Texas USA --
http://www.zebraimaging.com/

> -----Original Message-----
> From: osg-users-bounces at lists.openscenegraph.org [mailto:osg-users-
> bounces at lists.openscenegraph.org] On Behalf Of Gerald Lindsly
> Sent: Friday, October 12, 2007 9:21 AM
> To: OSG Users
> Subject: [osg-users] osg & gui solved!
> 
> I fixed the problem I was having embedding an osgViewer in a gui.  osg
> apparently does not save and restore the OpenGL context when it does
its
> drawing, but rather assumes it is in its default state.  It does
restore
> the state to the default except that (as far as I could tell) the
OpenGL
> matrices are not restored to the default.  I added a
beginExternalDraw()
> and endExternalDraw() to bracket the call to osgViewer::frame() which
> fixes things.
> Gerald
> 
> ________________________________
> 
> Be a better Globetrotter. Get better travel answers
>
<http://us.rd.yahoo.com/evt=48254/*http://answers.yahoo.com/dir/_ylc=X3o
DM
>
TI5MGx2aThyBF9TAzIxMTU1MDAzNTIEX3MDMzk2NTQ1MTAzBHNlYwNCQUJwaWxsYXJfTklfM
zY
> wBHNsawNQcm9kdWN0X3F1ZXN0aW9uX3BhZ2U-?link=list&sid=396545469> from
> someone who knows.
> Yahoo! Answers - Check it out.



More information about the osg-users mailing list