[osg-users] Shader, OpenGL context and Qt

Valerian Merkling niarkoleptik at gmail.com
Mon Sep 12 06:57:13 PDT 2016


Hi,

I'm working on a GIS app based on Qt and OpenGL, and I'm replacing all OpenGL calls with OSG 3.4.0.

I can display multiples views. Each view is independant, hold in QGLWidets, got only one camera and its own scenegraph, and a new instances of osg::Program and osg::Shader (no osg objects shader between views).

Shaders works fine in the firsts views, but I soon as I close a view, shaders are gone for the next opened views, although I using the same source code to init the shaders and use a new osg::Program for it.

I was first searching in the code for shader compilation logs, and I found this function  : getGLProgramInfoLog(unsigned int contextId, std::string & log).

I have a few questions :

Do I have to use this function to get info about how the shader compilation was ?

If yes, how do I get this context ID ? I always thought that Qt was managing OpenGL context for me, but I may be wrong ? 

Is that Context ID a possible cause of my shader problem ? 


Thank you!

Cheers,
Valerian

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








More information about the osg-users mailing list