From Farshid Lashkari, added Texture::Extension support for non power of two extension.
This commit is contained in:
parent
f8c855a576
commit
c4e2e85aa1
@ -470,7 +470,8 @@ class OSG_EXPORT Texture : public osg::StateAttribute
|
||||
void glGetCompressedTexImage(GLenum target, GLint level, GLvoid *data) const;
|
||||
|
||||
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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user