class SG_EXPORT osg::Texture

Texture base class which encapsulates OpenGl texture functionality which common betweent the various types of OpenGL textures

Inheritance:


Public Methods

[more] Texture()
[more] Texture(const Texture& text, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy
[more]virtual osg::Object* cloneType() const = 0
[more]virtual osg::Object* clone(const CopyOp& copyop) const = 0
[more]virtual bool isSameKindAs(const osg::Object* obj) const
[more]virtual const char* libraryName() const
[more]virtual const char* className() const
[more]virtual const Type getType() const
[more]virtual bool isTextureAttribute() const
[more]void setWrap(const WrapParameter which, const WrapMode wrap)
Set the texture wrap mode
[more]const WrapMode getWrap(const WrapParameter which) const
Get the texture wrap mode
[more]void setBorderColor(const Vec4& color)
Sets the border color for this texture.
[more]const Vec4& borderColor(void) const
[more]void setFilter(const FilterParameter which, const FilterMode filter)
Set the texture filter mode
[more]const FilterMode getFilter(const FilterParameter which) const
Get the texture filter mode
[more]void setMaxAnisotropy(float anis)
Set the maximum anisotropy value, default value is 10 for no anisotropic filtering.
[more]inline float getMaxAnisotropy() const
Get the maximum anisotropy value
[more]inline void setInternalFormatMode(const InternalFormatMode mode)
Set the internal format mode.
[more]inline const InternalFormatMode getInternalFormatMode() const
Get the internal format mode
[more]inline void setInternalFormat(const int internalFormat)
Set the internal format to use when creating OpenGL textures.
[more]inline const int getInternalFormat() const
Get the internal format to use when creating OpenGL textures
[more]bool isCompressedInternalFormat() const
[more]inline GLuint& getTextureObject(const uint contextID) const
return the OpenGL texture object for specified context
[more]inline uint& getModifiedTag(const uint contextID) const
[more]void dirtyTextureObject()
Force a recompile on next apply() of associated OpenGL texture objects
[more]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
[more]static void flushDeletedTextureObjects(uint contextID)
flush all the cached display list which need to be deleted in the OpenGL context related to contextID
[more]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
[more]virtual void apply(State& state) const = 0
Texture is pure virtual base class, apply must be overriden.
[more]virtual void compile(State& state) const
Calls apply(state) to compile the texture.

Public Members

[more]enum WrapParameter
[more]enum WrapMode
[more]enum FilterParameter
[more]enum FilterMode
[more]enum InternalFormatMode
[more] Get the handle to the texture object for the current context

Protected Fields

[more]WrapMode _wrap_s
[more]WrapMode _wrap_t
[more]WrapMode _wrap_r
[more]FilterMode _min_filter
[more]FilterMode _mag_filter
[more]float _maxAnisotropy
[more]Vec4 _borderColor
[more]mutable bool _texParametersDirty
[more]InternalFormatMode _internalFormatMode
[more]mutable GLint _internalFormat

Protected Methods

[more]virtual ~Texture()
[more]virtual void computeInternalFormat() const = 0
[more]void computeInternalFormatWithImage(osg::Image& image) const
[more]bool isCompressedInternalFormat(GLint internalFormat) const
[more]void applyTexParameters(GLenum target, State& state) const
Helper method which does setting of texture paramters.
[more]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.
[more]int compareTexture(const Texture& rhs) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs

Protected Members

[more]typedef std::vector<GLuint> TextureNameList mutable TextureNameList _handleList
[more]typedef std::vector<uint> ImageModifiedTag mutable ImageModifiedTag _modifiedTag
[more]typedef std::map<uint,std::set<uint> >static DeletedTextureObjectCache DeletedTextureObjectCache s_deletedTextureObjectCache


Inherited from StateAttribute:

Public Methods

ovirtual int compare(const StateAttribute& sa) const
obool operator < (const StateAttribute& rhs) const
obool operator == (const StateAttribute& rhs) const
obool operator != (const StateAttribute& rhs) const
ovirtual void getAssociatedModes(std::vector<GLMode>& ) const

Public Members

otypedef GLenum GLMode
otypedef unsigned int GLModeValue
otypedef unsigned int OverrideValue
oenum Values
otypedef unsigned int Type
oenum Types


Inherited from Object:

Public Methods

oinline void setDataVariance(const DataVariance dv)
oinline const DataVariance getDataVariance() const
oinline void setUserData(Referenced* obj)
oinline Referenced* getUserData()
oinline const Referenced* getUserData() const

Public Members

oenum DataVariance

Protected Fields

oDataVariance _dataVariance
oref_ptr<Referenced> _userData


Inherited from Referenced:

Public Methods

oinline Referenced& operator = (Referenced&)
oinline void ref() const
oinline void unref() const
oinline void unref_nodelete() const
oinline const int referenceCount() const

Protected Fields

omutable int _refCount


Documentation

Texture base class which encapsulates OpenGl texture functionality which common betweent the various types of OpenGL textures
o Texture()

o Texture(const Texture& text, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy

ovirtual osg::Object* cloneType() const = 0

ovirtual osg::Object* clone(const CopyOp& copyop) const = 0

ovirtual bool isSameKindAs(const osg::Object* obj) const

ovirtual const char* libraryName() const

ovirtual const char* className() const

ovirtual const Type getType() const

ovirtual bool isTextureAttribute() const

oenum WrapParameter

o WRAP_S

o WRAP_T

o WRAP_R

oenum WrapMode

o CLAMP

o CLAMP_TO_EDGE

o CLAMP_TO_BORDER

o REPEAT

o MIRROR

ovoid setWrap(const WrapParameter which, const WrapMode wrap)
Set the texture wrap mode

oconst WrapMode getWrap(const WrapParameter which) const
Get the texture wrap mode

ovoid setBorderColor(const Vec4& color)
Sets the border color for this texture. Makes difference only if wrap mode is CLAMP_TO_BORDER

oconst Vec4& borderColor(void) const

oenum FilterParameter

o MIN_FILTER

o MAG_FILTER

oenum FilterMode

o LINEAR

o LINEAR_MIPMAP_LINEAR

o LINEAR_MIPMAP_NEAREST

o NEAREST

o NEAREST_MIPMAP_LINEAR

o NEAREST_MIPMAP_NEAREST

ovoid setFilter(const FilterParameter which, const FilterMode filter)
Set the texture filter mode

oconst FilterMode getFilter(const FilterParameter which) const
Get the texture filter mode

ovoid 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.

oinline float getMaxAnisotropy() const
Get the maximum anisotropy value

oenum InternalFormatMode

o USE_IMAGE_DATA_FORMAT

o USE_USER_DEFINED_FORMAT

o USE_ARB_COMPRESSION

o USE_S3TC_DXT1_COMPRESSION

o USE_S3TC_DXT3_COMPRESSION

o USE_S3TC_DXT5_COMPRESSION

oinline 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.

oinline const InternalFormatMode getInternalFormatMode() const
Get the internal format mode

oinline void setInternalFormat(const int internalFormat)
Set the internal format to use when creating OpenGL textures. Also sets the internalFormatMode to USE_USER_DEFINED_FORMAT.

oinline const int getInternalFormat() const
Get the internal format to use when creating OpenGL textures

obool isCompressedInternalFormat() const

o Get the handle to the texture object for the current context
Get the handle to the texture object for the current context

oinline GLuint& getTextureObject(const uint contextID) const
return the OpenGL texture object for specified context

oinline uint& getModifiedTag(const uint contextID) const

ovoid dirtyTextureObject()
Force a recompile on next apply() of associated OpenGL texture objects

ostatic 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

ostatic void flushDeletedTextureObjects(uint contextID)
flush all the cached display list which need to be deleted in the OpenGL context related to contextID

ostatic 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

ovirtual void apply(State& state) const = 0
Texture is pure virtual base class, apply must be overriden.

ovirtual void compile(State& state) const
Calls apply(state) to compile the texture.

ovirtual ~Texture()

ovirtual void computeInternalFormat() const = 0

ovoid computeInternalFormatWithImage(osg::Image& image) const

obool isCompressedInternalFormat(GLint internalFormat) const

ovoid applyTexParameters(GLenum target, State& state) const
Helper method which does setting of texture paramters.

ovoid 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.

oint compareTexture(const Texture& rhs) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs

otypedef std::vector<GLuint> TextureNameList mutable TextureNameList _handleList

otypedef std::vector<uint> ImageModifiedTag mutable ImageModifiedTag _modifiedTag

oWrapMode _wrap_s

oWrapMode _wrap_t

oWrapMode _wrap_r

oFilterMode _min_filter

oFilterMode _mag_filter

ofloat _maxAnisotropy

oVec4 _borderColor

omutable bool _texParametersDirty

oInternalFormatMode _internalFormatMode

omutable GLint _internalFormat

otypedef 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++.