[osg-users] Oculus+OSG

Björn Blissing bjorn.blissing at vti.se
Wed Sep 2 13:27:33 PDT 2015


cbuchner1 wrote:
> Trying to build the current osgoculus master branch against Oculus SDK 0.7.0.0 using OSG 3.2.1
> 
> 
> the following code from oculusdevice.cpp is making trouble. For OSG 3.2  the variable "ctx" is undefined.
> 
> void OculusTextureBuffer::setRenderSurface(const osg::State& state)
> {
> #if(OSG_VERSION_GREATER_OR_EQUAL(3, 4, 0))
>     const osg::GLExtensions* fbo_ext = state.get<osg::GLExtensions>();
> #else
>     const osg::FBOExtensions* fbo_ext = osg::FBOExtensions::instance(ctx, true);
> #endif
> ...
> 
> void OculusDepthBuffer::setRenderSurface(const osg::State& state)
> {
> #if(OSG_VERSION_GREATER_OR_EQUAL(3, 4, 0))
>     const osg::GLExtensions* fbo_ext = state.get<osg::GLExtensions>();
> #else
>     const osg::FBOExtensions* fbo_ext = osg::FBOExtensions::instance(ctx, true);
> #endif
> ...
> 



cbuchner1 wrote:
> A followup: inserting the following line into both #else branches fixes it
> 
> const unsigned int ctx = state.getContextID();
> 


Ah, the woes of trying to have support for multiple OSG version at the same time. I did some refactoring yesterday and this bug obviously slipped through without being tested. Sorry about that. 

Another user already submitted a pull request with a fix, which is merged.

Best regards
Björn

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65002#65002








More information about the osg-users mailing list