From d5089349618f7a8d5dee2d83e846e07d2e4e393a Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 12 Nov 2009 19:39:50 +0000 Subject: [PATCH] Introduced the usage of GL_MAX_TEXTURE_IMAGE_UNITS where support in place of the check of GL_MAX_TEXTURE_UNITS. --- src/osg/Texture.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/osg/Texture.cpp b/src/osg/Texture.cpp index 079ba27d6..01bdb8abe 100644 --- a/src/osg/Texture.cpp +++ b/src/osg/Texture.cpp @@ -2421,7 +2421,7 @@ void Texture::Extensions::setupGLExtensions(unsigned int contextID) bool builtInSupport = OSG_GLES2_FEATURES || OSG_GL3_FEATURES; - _isMultiTexturingSupported = builtInSupport || + _isMultiTexturingSupported = builtInSupport || OSG_GLES1_FEATURES || isGLExtensionOrVersionSupported( contextID,"GL_ARB_multitexture", 1.3f) || isGLExtensionOrVersionSupported(contextID,"GL_EXT_multitexture", 1.3f); @@ -2485,7 +2485,18 @@ void Texture::Extensions::setupGLExtensions(unsigned int contextID) if( _isMultiTexturingSupported ) { - glGetIntegerv(GL_MAX_TEXTURE_UNITS,&_numTextureUnits); + #if defined(OSG_GLES2_AVAILABLE) || defined(OSG_GL3_AVAILABLE) + glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,&_numTextureUnits); + #else + if (osg::asciiToFloat(version)>=2.0) + { + glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS,&_numTextureUnits); + } + else + { + glGetIntegerv(GL_MAX_TEXTURE_UNITS,&_numTextureUnits); + } + #endif } else {