[osg-users] Executing code before gl context is closed when viewer is shutdown

Björn Blissing bjorn.blissing at vti.se
Tue Aug 18 02:21:49 PDT 2015


More odd questions connected to my Oculus integration.

Is there a simple way to detect when the osg::viewer is ordered to close? I need to execute some Oculus related code before the OpenGL context is closed. So what I am looking for is some form of opposite of viewerBase.setRealizeOperation() function.

My first idea was to subclass the osg::GraphicContext class and run my own custom destructor before the default constructor. But that idea is a no go, because the OS dependent windowing APIs are already implemented as subclasses to osg::GraphicContext.

Best regards

Read this topic online here:

More information about the osg-users mailing list