Added tests for presense of extensions to osgcubemap, osgvertexproram and

osgmultitexture examples.

Added osg::VertexProgram::Extensions class to better handle multiple graphics
context vertex program extensions.
This commit is contained in:
Robert Osfield
2003-04-10 19:32:32 +00:00
parent 52d2d8eaff
commit aaa761e333
8 changed files with 225 additions and 24 deletions

View File

@@ -129,6 +129,23 @@ int main(int argc, char *argv[])
// create the windows and run the threads.
viewer.realize();
// now check to see if texture cube map is supported.
for(unsigned int contextID = 0;
contextID<viewer.getDisplaySettings()->getMaxNumberOfGraphicsContexts();
++contextID)
{
osg::TextureCubeMap::Extensions* tcmExt = osg::TextureCubeMap::getExtensions(contextID,false);
if (tcmExt)
{
if (!tcmExt->isCubeMapSupported())
{
cout<<"Warning: texture_cube_map not supported by OpenGL drivers, unable to run application."<<std::endl;
return 1;
}
}
}
while( !viewer.done() )
{
// wait for all cull and draw threads to complete.

View File

@@ -101,6 +101,21 @@ int main( int argc, char **argv )
// create the windows and run the threads.
viewer.realize();
for(unsigned int contextID = 0;
contextID<viewer.getDisplaySettings()->getMaxNumberOfGraphicsContexts();
++contextID)
{
osg::Texture::Extensions* textExt = osg::Texture::getExtensions(contextID,false);
if (textExt)
{
if (!textExt->isMultiTexturingSupported())
{
cout<<"Warning: texture_cube_map not supported by OpenGL drivers, unable to run application."<<std::endl;
return 1;
}
}
}
while( !viewer.done() )
{
// wait for all cull and draw threads to complete.

View File

@@ -405,6 +405,22 @@ int main(int argc, char *argv[])
// create the windows and run the threads.
viewer.realize();
// now check to see if vertex program is supported.
for(unsigned int contextID = 0;
contextID<viewer.getDisplaySettings()->getMaxNumberOfGraphicsContexts();
++contextID)
{
osg::VertexProgram::Extensions* vpExt = osg::VertexProgram::getExtensions(contextID,false);
if (vpExt)
{
if (!vpExt->isVertexProgramSupported())
{
cout<<"Warning: ARB_vertex_program not supported by OpenGL drivers, unable to run application."<<std::endl;
return 1;
}
}
}
while( !viewer.done() )
{
// wait for all cull and draw threads to complete.