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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user