Hello forum/list! We're using a 3rd party library that requires an active OpenGL context for the initialization. Not too much aware of what we were doing, we put the initialization code in a draw call of a drawable. (On first draw, the 3rd party initialization code is called because there is an active OpenGL context at that moment.)
This worked, but some requirements in how our stuff is initialized changed so we had to move the initialization code earlier. So we used a GraphicsOperation callback to be called during the viewer :: realize call. (We were not aware of that before.) This works, and from what I read, this is the preferred way in this context. Now, upon destruction, that 3rd party library would also need access the OpenGL context to be active for cleanup and termination. It's not a HUGE issue: the library has not a valid context so it can't do its things correctly: in debug mode it spams the console (it just hushes them in release). I read that the usage of GraphicsContext::makeCurrent (and releaseContext) would probably do the job (gc->makeCurrent(); otherLib->terminate(); gc->releaseContext();), but that it's not the preferred way because the graphics thread could be in the middle of something. What would be the clean way to do this? Thanks! P.S. Sorry if this looks dumb, we're slowly learning how stuff gets done :) -- Alexandre Vaillancourt
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

