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

@@ -208,7 +208,7 @@ static BufferedExtensions s_extensions;
VertexProgram::Extensions* VertexProgram::getExtensions(unsigned int contextID,bool createIfNotInitalized)
{
if (!s_extensions[contextID] && createIfNotInitalized) s_extensions[contextID] = new Extensions;
if (!s_extensions[contextID] && createIfNotInitalized) s_extensions[contextID] = new Extensions(contextID);
return s_extensions[contextID].get();
}
@@ -217,9 +217,9 @@ void VertexProgram::setExtensions(unsigned int contextID,Extensions* extensions)
s_extensions[contextID] = extensions;
}
VertexProgram::Extensions::Extensions()
VertexProgram::Extensions::Extensions(unsigned int contextID)
{
setupGLExtenions();
setupGLExtenions(contextID);
}
VertexProgram::Extensions::Extensions(const Extensions& rhs):
@@ -246,9 +246,9 @@ void VertexProgram::Extensions::lowestCommonDenominator(const Extensions& rhs)
}
void VertexProgram::Extensions::setupGLExtenions()
void VertexProgram::Extensions::setupGLExtenions(unsigned int contextID)
{
_isVertexProgramSupported = isGLExtensionSupported("GL_ARB_vertex_program");
_isVertexProgramSupported = isGLExtensionSupported(contextID,"GL_ARB_vertex_program");
_glBindProgram = osg::getGLExtensionFuncPtr("glBindProgramARB");
_glGenPrograms = osg::getGLExtensionFuncPtr("glGenProgramsARB");