Updated the comments to be more relevant

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14774 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-03-11 15:44:23 +00:00
parent c30be2355b
commit b6acb1a8d3

View File

@ -31,11 +31,9 @@
#include <iostream>
//
// A simple demo demonstrating different texturing modes,
// including using of texture extensions.
// A simple demo demonstrating use osg::Texture3D to create a blended animation between four seperate images packed together into a 3d texture
//
typedef std::vector< osg::ref_ptr<osg::Image> > ImageList;
osg::StateSet* createState()
@ -176,27 +174,16 @@ osg::Drawable* createSquare(float textureCoordMax=1.0f)
osg::Node* createModel()
{
// create the geometry of the model, just a simple 2d quad right now.
osg::Geode* geode = new osg::Geode;
geode->addDrawable(createSquare());
// normally we'd create the stateset's to contain all the textures
// etc here, but, the above technique uses osg::Image::scaleImage and
// osg::Image::copySubImage() which are implemented with OpenGL utility
// library, which unfortunately can't be used until we have a valid
// OpenGL context, and at this point in initilialization we don't have
// a valid OpenGL context, so we have to delay creation of state until
// there is a valid OpenGL context. I'll manage this by using an
// app callback which will create the state during the first traversal.
// A bit hacky, and my plan is to reimplement the osg::scaleImage and
// osg::Image::copySubImage() without using GLU which will get round
// this current limitation.
geode->setUpdateCallback(new UpdateStateCallback());
geode->setStateSet(createState());
return geode;
}