From Farshid Lashkari, added Texture::Extension support for non power of two extension.

This commit is contained in:
Robert Osfield 2005-05-05 09:18:03 +00:00
parent f8c855a576
commit c4e2e85aa1
2 changed files with 10 additions and 1 deletions

View File

@ -471,6 +471,7 @@ class OSG_EXPORT Texture : public osg::StateAttribute
bool isClientStorageSupported() const { return _isClientStorageSupported; }
bool isNonPowerOfTwoTextureSupported() const { return _isNonPowerOfTwoTextureSupported; }
protected:
@ -487,6 +488,7 @@ class OSG_EXPORT Texture : public osg::StateAttribute
bool _isShadowSupported;
bool _isShadowAmbientSupported;
bool _isClientStorageSupported;
bool _isNonPowerOfTwoTextureSupported;
GLint _maxTextureSize;
GLint _numTextureUnits;

View File

@ -1272,6 +1272,8 @@ Texture::Extensions::Extensions(const Extensions& rhs):
_isShadowAmbientSupported = rhs._isShadowAmbientSupported;
_isClientStorageSupported = rhs._isClientStorageSupported;
_isNonPowerOfTwoTextureSupported = rhs._isNonPowerOfTwoTextureSupported;
}
void Texture::Extensions::lowestCommonDenominator(const Extensions& rhs)
@ -1299,6 +1301,8 @@ void Texture::Extensions::lowestCommonDenominator(const Extensions& rhs)
if (!rhs._isShadowAmbientSupported) _isShadowAmbientSupported = false;
if (!rhs._isClientStorageSupported) _isClientStorageSupported = false;
if (!rhs._isNonPowerOfTwoTextureSupported) _isNonPowerOfTwoTextureSupported = false;
}
void Texture::Extensions::setupGLExtensions(unsigned int contextID)
@ -1327,6 +1331,9 @@ void Texture::Extensions::setupGLExtensions(unsigned int contextID)
_isClientStorageSupported = isGLExtensionSupported(contextID,"GL_APPLE_client_storage");
_isNonPowerOfTwoTextureSupported = ( glVersion >= 2.0 ) ||
isGLExtensionSupported(contextID,"GL_ARB_texture_non_power_of_two");
glGetIntegerv(GL_MAX_TEXTURE_SIZE,&_maxTextureSize);
char *ptr;