From Mathias Fiedler, "i'm using OSG on ES 2.0 and observed that only one texture unit will be supported by OSG.

In State::initializeExtensionProcs() the _glMaxTextureUnits is calculated based on osg::getGLVersionNumber().
At least for ES 2.0 this function will return 0.f since the version string will look like "OpenGL ES 2.0 ...".

My proposal doesn't touch getGLVersionNumber(), since desktop OpenGL 2.0 isn't OpenGL ES 2.0.
So i changed the conditions in State::initializeExtensionProcs() for getting the number via glGetIntegerv()."
This commit is contained in:
Robert Osfield
2010-06-21 16:48:03 +00:00
parent 6d572d0530
commit 36366f61d5

View File

@@ -812,14 +812,15 @@ void State::initializeExtensionProcs()
setGLExtensionFuncPtr(_glDrawArraysInstanced, "glDrawArraysInstanced","glDrawArraysInstancedARB","glDrawArraysInstancedEXT");
setGLExtensionFuncPtr(_glDrawElementsInstanced, "glDrawElementsInstanced","glDrawElementsInstancedARB","glDrawElementsInstancedEXT");
if ( osg::getGLVersionNumber() >= 2.0 || osg::isGLExtensionSupported(_contextID,"GL_ARB_vertex_shader") )
if ( osg::getGLVersionNumber() >= 2.0 || osg::isGLExtensionSupported(_contextID,"GL_ARB_vertex_shader") || OSG_GLES2_FEATURES)
{
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS,&_glMaxTextureUnits);
glGetIntegerv(GL_MAX_TEXTURE_COORDS,&_glMaxTextureCoords);
}
else if ( osg::getGLVersionNumber() >= 1.3 ||
osg::isGLExtensionSupported(_contextID,"GL_ARB_multitexture") ||
osg::isGLExtensionSupported(_contextID,"GL_EXT_multitexture") )
osg::isGLExtensionSupported(_contextID,"GL_EXT_multitexture") ||
OSG_GLES1_FEATURES)
{
GLint maxTextureUnits;
glGetIntegerv(GL_MAX_TEXTURE_UNITS,&maxTextureUnits);