Hi Tom,

Great to hear of progress and to a screen shot :-)

FYI, release context is meant to just make the current thread
available to be used by another graphics context - some graphics
drivers really don't like you doing a makeCurrent() or several
different contexts from the same thread without releasing the context
first.  Releasig the the context as you've worked out isn't a full
blown disposal of the context, just a decoupling of the drivers state
for that context from the current thread, the context and be made
current again by the next makeCurrent().

Another snippet of info, is the osgViewer current calls the
releaseContext when in single thread mode to allow uses to interleave
different contexts when they do things manually mixing other code with
the OSG's.  It's only an issue in SingleThreaded mode as in
multithreaded models the GraphicsContext's all have there own
dedicated GraphicsThread so there is no sharing of a single thread
between multiple contexts so no need for a releaseContext().   You can
however, switch of the releaseContext() at the end of a frame() even
in SingleThreaded mode via the osgViewer::ViewerBase method:


        /** Hint to tell the renderingTraversals() method whether to
call relaseContext() on the last
          * context that was made current by the thread calling
renderingTraverals().  Note, when
          * running multi-threaded viewer no threads will be made
current or release current.
          * Setting this hint to false can enable the frame loop to be
lazy about calling makeCurrent
          * and releaseContext on each new frame, helping performance.
 However, if you frame loop
          * is managing multiple graphics context all from the main
frame thread then this hint must
          * be left on, otherwise the wrong context could be left
active, introducing errors in rendering.*/
        void setReleaseContextAtEndOfFrameHint(bool hint) {
_releaseContextAtEndOfFrameHint = hint; }


Hope this helps,
Robert.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to