[osg-users] getGraphicsContext()/getState() segfault issue

Sebastian Messerschmidt sebastian.messerschmidt at gmx.de
Mon Nov 28 02:26:32 PST 2016

Hi Fabien,

Without looking at your specific code in detail:

There is no graphics context associated with the camera directly after 
creating the viewer. Make sure viewer->realize runs before accessing the 
guts of context-specific stuff.

Your crash most likely is due to having a nullptr-access to the 
graphics-context. Check first if the "camera->getGraphicsContext()" 
returns a valid pointer. If not, you're setup isn't yet complete.

If you still got problems, you might consider presenting some minimal 
example that reproduces your problem.


> I'm trying to mix Qt and OSG contexts according to this implementation : QQuickOSG (https://github.com/Sparadon/qquickosg/blob/master/qquickosg.cpp)
> He had initialized the FBO like this (line 332) and then use the FBO Texture id to initialize the Qt side Texture (line 374).
> My pipeline is a little bit different but I have the same objects and I don't get why my apply() crashes. Maybe it misses up with Qt stuff...
> Cheers,
> Fabien
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69511#69511
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

More information about the osg-users mailing list