Texture base class which encapsulates OpenGl texture functionality which common betweent the various types of OpenGL textures
Inheritance:
Public Methods
-
Texture()
-
Texture(const Texture& text, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
- Copy constructor using CopyOp to manage deep vs shallow copy
-
virtual osg::Object* cloneType() const = 0
-
virtual osg::Object* clone(const CopyOp& copyop) const = 0
-
virtual bool isSameKindAs(const osg::Object* obj) const
-
virtual const char* libraryName() const
-
virtual const char* className() const
-
virtual const Type getType() const
-
virtual bool isTextureAttribute() const
-
void setWrap(const WrapParameter which, const WrapMode wrap)
- Set the texture wrap mode
-
const WrapMode getWrap(const WrapParameter which) const
- Get the texture wrap mode
-
void setBorderColor(const Vec4& color)
- Sets the border color for this texture.
-
const Vec4& borderColor(void) const
-
void setFilter(const FilterParameter which, const FilterMode filter)
- Set the texture filter mode
-
const FilterMode getFilter(const FilterParameter which) const
- Get the texture filter mode
-
void setMaxAnisotropy(float anis)
- Set the maximum anisotropy value, default value is 10 for no anisotropic filtering.
-
inline float getMaxAnisotropy() const
- Get the maximum anisotropy value
-
inline void setInternalFormatMode(const InternalFormatMode mode)
- Set the internal format mode.
-
inline const InternalFormatMode getInternalFormatMode() const
- Get the internal format mode
-
inline void setInternalFormat(const int internalFormat)
- Set the internal format to use when creating OpenGL textures.
-
inline const int getInternalFormat() const
- Get the internal format to use when creating OpenGL textures
-
bool isCompressedInternalFormat() const
-
inline GLuint& getTextureObject(const uint contextID) const
- return the OpenGL texture object for specified context
-
inline uint& getModifiedTag(const uint contextID) const
-
void dirtyTextureObject()
- Force a recompile on next apply() of associated OpenGL texture objects
-
static void deleteTextureObject(uint contextID, GLuint handle)
- use deleteTextureObject instead of glDeleteTextures to allow OpenGL texture objects to cached until they can be deleted by the OpenGL context in which they were created, specified by contextID
-
static void flushDeletedTextureObjects(uint contextID)
- flush all the cached display list which need to be deleted in the OpenGL context related to contextID
-
static GLint getMaxTextureSize()
- Get the maximum texture size supported, this is the normally define by GL_MAX_TEXTURE_SIZE, but can be overridden by the OSG_MAX_TEXTURE_SIZE environmental variable
-
virtual void apply(State& state) const = 0
- Texture is pure virtual base class, apply must be overriden.
-
virtual void compile(State& state) const
- Calls apply(state) to compile the texture.
Public Members
-
enum WrapParameter
-
enum WrapMode
-
enum FilterParameter
-
enum FilterMode
-
enum InternalFormatMode
-
Get the handle to the texture object for the current context
Protected Fields
-
WrapMode _wrap_s
-
WrapMode _wrap_t
-
WrapMode _wrap_r
-
FilterMode _min_filter
-
FilterMode _mag_filter
-
float _maxAnisotropy
-
Vec4 _borderColor
-
mutable bool _texParametersDirty
-
InternalFormatMode _internalFormatMode
-
mutable GLint _internalFormat
Protected Methods
-
virtual ~Texture()
-
virtual void computeInternalFormat() const = 0
-
void computeInternalFormatWithImage(osg::Image& image) const
-
bool isCompressedInternalFormat(GLint internalFormat) const
-
void applyTexParameters(GLenum target, State& state) const
- Helper method which does setting of texture paramters.
-
void applyTexImage2D(GLenum target, Image* image, State& state, GLsizei& width, GLsizei& height, GLsizei& numMimpmapLevels) const
- Helper method which does the creation of the texture itself, and does not set or use texture binding.
-
int compareTexture(const Texture& rhs) const
- return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs
Protected Members
-
typedef std::vector<GLuint> TextureNameList mutable TextureNameList _handleList
-
typedef std::vector<uint> ImageModifiedTag mutable ImageModifiedTag _modifiedTag
-
typedef std::map<uint,std::set<uint> >static DeletedTextureObjectCache DeletedTextureObjectCache s_deletedTextureObjectCache
Public Methods
-
virtual int compare(const StateAttribute& sa) const
-
bool operator < (const StateAttribute& rhs) const
-
bool operator == (const StateAttribute& rhs) const
-
bool operator != (const StateAttribute& rhs) const
-
virtual void getAssociatedModes(std::vector<GLMode>& ) const
Public Members
-
typedef GLenum GLMode
-
typedef unsigned int GLModeValue
-
typedef unsigned int OverrideValue
-
enum Values
-
typedef unsigned int Type
-
enum Types
Inherited from Object:
Public Methods
-
inline void setDataVariance(const DataVariance dv)
-
inline const DataVariance getDataVariance() const
-
inline void setUserData(Referenced* obj)
-
inline Referenced* getUserData()
-
inline const Referenced* getUserData() const
Public Members
-
enum DataVariance
Protected Fields
-
DataVariance _dataVariance
-
ref_ptr<Referenced> _userData
Public Methods
-
inline Referenced& operator = (Referenced&)
-
inline void ref() const
-
inline void unref() const
-
inline void unref_nodelete() const
-
inline const int referenceCount() const
Protected Fields
-
mutable int _refCount
Documentation
Texture base class which encapsulates OpenGl texture functionality which common betweent the various types of OpenGL textures
- Texture()
- Texture(const Texture& text, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
- Copy constructor using CopyOp to manage deep vs shallow copy
- virtual osg::Object* cloneType() const = 0
- virtual osg::Object* clone(const CopyOp& copyop) const = 0
- virtual bool isSameKindAs(const osg::Object* obj) const
- virtual const char* libraryName() const
- virtual const char* className() const
- virtual const Type getType() const
- virtual bool isTextureAttribute() const
- enum WrapParameter
- WRAP_S
- WRAP_T
- WRAP_R
- enum WrapMode
- CLAMP
- CLAMP_TO_EDGE
- CLAMP_TO_BORDER
- REPEAT
- MIRROR
- void setWrap(const WrapParameter which, const WrapMode wrap)
- Set the texture wrap mode
- const WrapMode getWrap(const WrapParameter which) const
- Get the texture wrap mode
- void setBorderColor(const Vec4& color)
- Sets the border color for this texture. Makes difference only if
wrap mode is CLAMP_TO_BORDER
- const Vec4& borderColor(void) const
- enum FilterParameter
- MIN_FILTER
- MAG_FILTER
- enum FilterMode
- LINEAR
- LINEAR_MIPMAP_LINEAR
- LINEAR_MIPMAP_NEAREST
- NEAREST
- NEAREST_MIPMAP_LINEAR
- NEAREST_MIPMAP_NEAREST
- void setFilter(const FilterParameter which, const FilterMode filter)
- Set the texture filter mode
- const FilterMode getFilter(const FilterParameter which) const
- Get the texture filter mode
- void setMaxAnisotropy(float anis)
- Set the maximum anisotropy value, default value is 10 for
no anisotropic filtering. If hardware does not support anisotropic
filtering then normal filtering is used, equivilant to a max anisotropy value of 1.0.
valid range is 1.0f upwards. The maximum value depends on the graphics
system being used.
- inline float getMaxAnisotropy() const
- Get the maximum anisotropy value
- enum InternalFormatMode
- USE_IMAGE_DATA_FORMAT
- USE_USER_DEFINED_FORMAT
- USE_ARB_COMPRESSION
- USE_S3TC_DXT1_COMPRESSION
- USE_S3TC_DXT3_COMPRESSION
- USE_S3TC_DXT5_COMPRESSION
- inline void setInternalFormatMode(const InternalFormatMode mode)
- Set the internal format mode.
Note, If the mode is set USE_IMAGE_DATA_FORMAT, USE_ARB_COMPRESSION,
USE_S3TC_COMPRESSION the internalFormat is automatically selected,
and will overwrite the previous _internalFormat.
- inline const InternalFormatMode getInternalFormatMode() const
- Get the internal format mode
- inline void setInternalFormat(const int internalFormat)
- Set the internal format to use when creating OpenGL textures.
Also sets the internalFormatMode to USE_USER_DEFINED_FORMAT.
- inline const int getInternalFormat() const
- Get the internal format to use when creating OpenGL textures
- bool isCompressedInternalFormat() const
- Get the handle to the texture object for the current context
- Get the handle to the texture object for the current context
- inline GLuint& getTextureObject(const uint contextID) const
- return the OpenGL texture object for specified context
- inline uint& getModifiedTag(const uint contextID) const
- void dirtyTextureObject()
- Force a recompile on next apply() of associated OpenGL texture objects
- static void deleteTextureObject(uint contextID, GLuint handle)
- use deleteTextureObject instead of glDeleteTextures to allow
OpenGL texture objects to cached until they can be deleted
by the OpenGL context in which they were created, specified
by contextID
- static void flushDeletedTextureObjects(uint contextID)
- flush all the cached display list which need to be deleted
in the OpenGL context related to contextID
- static GLint getMaxTextureSize()
- Get the maximum texture size supported, this is the
normally define by GL_MAX_TEXTURE_SIZE, but can be overridden
by the OSG_MAX_TEXTURE_SIZE environmental variable
- virtual void apply(State& state) const = 0
- Texture is pure virtual base class, apply must be overriden.
- virtual void compile(State& state) const
- Calls apply(state) to compile the texture.
- virtual ~Texture()
- virtual void computeInternalFormat() const = 0
- void computeInternalFormatWithImage(osg::Image& image) const
- bool isCompressedInternalFormat(GLint internalFormat) const
- void applyTexParameters(GLenum target, State& state) const
- Helper method which does setting of texture paramters.
- void applyTexImage2D(GLenum target, Image* image, State& state, GLsizei& width, GLsizei& height, GLsizei& numMimpmapLevels) const
- Helper method which does the creation of the texture itself, and
does not set or use texture binding.
- int compareTexture(const Texture& rhs) const
- return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs
- typedef std::vector<GLuint> TextureNameList mutable TextureNameList _handleList
- typedef std::vector<uint> ImageModifiedTag mutable ImageModifiedTag _modifiedTag
- WrapMode _wrap_s
- WrapMode _wrap_t
- WrapMode _wrap_r
- FilterMode _min_filter
- FilterMode _mag_filter
- float _maxAnisotropy
- Vec4 _borderColor
- mutable bool _texParametersDirty
- InternalFormatMode _internalFormatMode
- mutable GLint _internalFormat
- typedef std::map<uint,std::set<uint> >static DeletedTextureObjectCache DeletedTextureObjectCache s_deletedTextureObjectCache
- Direct child classes:
- TextureCubeMap
Texture3D
Texture2D
Texture1D
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.