Added support for modifying the osg::Texture*:Extensions stuctures.

Added an example modifying osg::Texture::Extensions to osgtext.  Optionally
compiled out by default.
This commit is contained in:
Robert Osfield
2003-04-10 13:41:45 +00:00
parent bc4fd5b051
commit 8b03d59be3
7 changed files with 55 additions and 6 deletions

View File

@@ -251,20 +251,39 @@ class SG_EXPORT Texture : public osg::StateAttribute
void setupGLExtenions();
void setTextureFilterAnisotropicSupported(bool flag) { _isTextureFilterAnisotropicSupported=flag; }
bool isTextureFilterAnisotropicSupported() const { return _isTextureFilterAnisotropicSupported; }
void setTextureCompressionARBSupported(bool flag) { _isTextureCompressionARBSupported=flag; }
bool isTextureCompressionARBSupported() const { return _isTextureCompressionARBSupported; }
void setTextureCompressionS3TCSupported(bool flag) { _isTextureCompressionS3TCSupported=flag; }
bool isTextureCompressionS3TCSupported() const { return _isTextureCompressionS3TCSupported; }
void setTextureMirroredRepeatSupported(bool flag) { _isTextureMirroredRepeatSupported=flag; }
bool isTextureMirroredRepeatSupported() const { return _isTextureMirroredRepeatSupported; }
void setTextureEdgeClampSupported(bool flag) { _isTextureEdgeClampSupported=flag; }
bool isTextureEdgeClampSupported() const { return _isTextureEdgeClampSupported; }
void setTextureBorderClampSupported(bool flag) { _isTextureBorderClampSupported=flag; }
bool isTextureBorderClampSupported() const { return _isTextureBorderClampSupported; }
void setGenerateMipMapSupported(bool flag) { _isGenerateMipMapSupported=flag; }
bool isGenerateMipMapSupported() const { return _isGenerateMipMapSupported; }
void setMaxTextureSize(GLint maxsize) { _maxTextureSize=maxsize; }
GLint maxTextureSize() const { return _maxTextureSize; }
bool isCompressedTexImage2DSupported() const { return _glCompressedTexImage2D!=0; }
void setCompressedTexImage2DProc(void* ptr) { _glCompressedTexImage2D = ptr; }
void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data) const;
void setCompressedTexSubImage2DProc(void* ptr) { _glCompressedTexSubImage2D = ptr; }
void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei type, const GLvoid *data) const;
void setGetCompressedTexImageProc(void* ptr) { _glGetCompressedTexImage = ptr; }
void glGetCompressedTexImage(GLenum target, GLint level, GLvoid *data) const;
protected:
@@ -293,7 +312,7 @@ class SG_EXPORT Texture : public osg::StateAttribute
* If 'createIfNotInitalized' is true then the Extensions object is
* automatically created. However, in this case the extension object
* only be created with the graphics context associated with ContextID..*/
static const Extensions* getExtensions(unsigned int contextID,bool createIfNotInitalized);
static Extensions* getExtensions(unsigned int contextID,bool createIfNotInitalized);
/** setExtensions allows users to override the extensions across graphics contexts.
* typically used when you have different extensions supported across graphics pipes

View File

@@ -120,14 +120,25 @@ class SG_EXPORT Texture3D : public Texture
void setupGLExtenions();
void setTexture3DSupported(bool flag) { _isTexture3DSupported=flag; }
bool isTexture3DSupported() const { return _isTexture3DSupported; }
void setTexture3DFast(bool flag) { _isTexture3DFast=flag; }
bool isTexture3DFast() const { return _isTexture3DFast; }
void setMaxTexture3DSize(GLint maxsize) { _maxTexture3DSize=maxsize; }
GLint maxTexture3DSize() const { return _maxTexture3DSize; }
void setTexImage3DProc(void* ptr) { _glTexImage3D = ptr; }
void glTexImage3D( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) const;
void setTexSubImage3DProc(void* ptr) { _glTexSubImage3D = ptr; }
void glTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) const;
void setCopyTexSubImage3DProc(void* ptr) { _glCopyTexSubImage3D = ptr; }
void glCopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) const;
void setBuild3DMipmapsProc(void* ptr) { _gluBuild3DMipmaps = ptr; }
void gluBuild3DMipmaps( GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *data) const;
protected:
@@ -151,7 +162,7 @@ class SG_EXPORT Texture3D : public Texture
* If 'createIfNotInitalized' is true then the Extensions object is
* automatically created. However, in this case the extension object
* only be created with the graphics context associated with ContextID..*/
static const Extensions* getExtensions(unsigned int contextID,bool createIfNotInitalized);
static Extensions* getExtensions(unsigned int contextID,bool createIfNotInitalized);
/** setExtensions allows users to override the extensions across graphics contexts.
* typically used when you have different extensions supported across graphics pipes

View File

@@ -123,6 +123,7 @@ class SG_EXPORT TextureCubeMap : public Texture
void setupGLExtenions();
void setCubeMapSupported(bool flag) { _isCubeMapSupported=flag; }
bool isCubeMapSupported() const { return _isCubeMapSupported; }
protected:
@@ -139,7 +140,7 @@ class SG_EXPORT TextureCubeMap : public Texture
* If 'createIfNotInitalized' is true then the Extensions object is
* automatically created. However, in this case the extension object
* only be created with the graphics context associated with ContextID..*/
static const Extensions* getExtensions(unsigned int contextID,bool createIfNotInitalized);
static Extensions* getExtensions(unsigned int contextID,bool createIfNotInitalized);
/** setExtensions allows users to override the extensions across graphics contexts.
* typically used when you have different extensions supported across graphics pipes