Added support for per context extension string.

Note, this required adding a unsigned int context ID to the osg::isGLUExtensionSupported(,)
and osg::isGLExtensionSupported(,) functions.  This may require reimplementation
of end user code to accomodate the new calling convention.
This commit is contained in:
Robert Osfield
2005-04-26 13:15:27 +00:00
parent 59ebf86dd0
commit a1bda0dab8
35 changed files with 191 additions and 162 deletions

View File

@@ -12,6 +12,7 @@
*/
#include <osg/GLExtensions>
#include <osg/TexEnv>
#include <osg/State>
using namespace osg;
@@ -26,11 +27,11 @@ TexEnv::~TexEnv()
{
}
void TexEnv::apply(State&) const
void TexEnv::apply(State& state) const
{
if (_mode==ADD)
{
static bool isTexEnvAddSupported = isGLExtensionSupported("GL_ARB_texture_env_add");
static bool isTexEnvAddSupported = isGLExtensionSupported(state.getContextID(),"GL_ARB_texture_env_add");
if (isTexEnvAddSupported)
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, ADD);
else // fallback on OpenGL default.