Hi
I switched to using osg_* variables in my shaders instead of built-in gl_* in
order to comply with with OpenGL 3.x/ OpenGL ES 2.0. However it doesn't seem to
work for me I found that it's managed by the State class, and I can obtain the
state object from the GraphicsContext. however a code like this doesn't work:
Code:
int main()
{
osgViewer::Viewer viewer;
viewer.setSceneData(new MyCustomNode());
osg::State* state = viewer.getCamera()->getGraphicsContext()->getState();
state->setUseModelViewAndProjectionUniforms(true);
state->setUseVertexAttributeAliasing(true);
return viewer.run();
}
The problem is that viewer.getCamera()->getGraphicsContext() return 0,
suggesting that I have to setup one myself. But I will need to provide width
and height and other parameters, which I don't really want to do, because they
are unrelevant and I didn't have to do that before. Is there a way to get the
default GraphicsContext instance, as I just need to set the parameters for
shaders?
Cheers,
Eldar
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46791#46791
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org