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 Type getType() const
[more]virtual bool isTextureAttribute() const
[more]void setWrap(WrapParameter which, WrapMode wrap)
Set the texture wrap mode
[more]WrapMode getWrap(WrapParameter which) const
Get the texture wrap mode
[more]void setBorderColor(const Vec4& color)
Sets the border color for this texture.
[more]const Vec4& getBorderColor() const
[more]void setFilter(FilterParameter which, FilterMode filter)
Set the texture filter mode
[more]FilterMode getFilter(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(InternalFormatMode mode)
Set the internal format mode.
[more]inline InternalFormatMode getInternalFormatMode() const
Get the internal format mode
[more]inline void setInternalFormat(GLint internalFormat)
Set the internal format to use when creating OpenGL textures.
[more]inline GLint getInternalFormat() const
Get the internal format to use when creating OpenGL textures
[more]bool isCompressedInternalFormat() const
[more]inline GLuint& getTextureObject(uint contextID) const
return the OpenGL texture object for specified context
[more]inline uint& getModifiedTag(uint contextID) const
[more]inline uint& getTextureParameterDity(uint contextID) const
[more]void dirtyTextureObject()
Force a recompile on next apply() of associated OpenGL texture objects
[more]void dirtyTextureParameters()
Force a resetting on next apply() of associated OpenGL texture parameters
[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]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.
[more]static const Extensions* getExtensions(uint contextID, bool createIfNotInitalized)
Function to call to get the extension of a specified context.
[more]static void setExtensions(uint contextID, Extensions* extensions)
setExtensions allows users to override the extensions across graphics contexts.

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
class Extensions: public osg::Referenced
Extensions class which encapsulates the querring of extensions and associated function pointers, and provide convinience wrappers to check for the extensions or use the associated functions

Protected Fields

[more]mutable TextureNameList _handleList
[more]mutable ImageModifiedTag _modifiedTag
[more]mutable TexParameterDirtyList _texParametersDirtyList
[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]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 buffered_value<GLuint> TextureNameList
[more]typedef buffered_value<uint> ImageModifiedTag
[more]typedef buffered_value<uint> TexParameterDirtyList


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 int referenceCount() const
oinline static int createdCount()
oinline static int deletedCount()

Protected Fields

omutable int _refCount
ostatic int _createdCount
ostatic int _deletedCount


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 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(WrapParameter which, WrapMode wrap)
Set the texture wrap mode

oWrapMode getWrap(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& getBorderColor() 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(FilterParameter which, FilterMode filter)
Set the texture filter mode

oFilterMode getFilter(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(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 InternalFormatMode getInternalFormatMode() const
Get the internal format mode

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

oinline GLint 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(uint contextID) const
return the OpenGL texture object for specified context

oinline uint& getModifiedTag(uint contextID) const

oinline uint& getTextureParameterDity(uint contextID) const

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

ovoid dirtyTextureParameters()
Force a resetting on next apply() of associated OpenGL texture parameters

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

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.

ostatic const Extensions* getExtensions(uint contextID, bool createIfNotInitalized)
Function to call to get the extension of a specified context. If the Exentsion object for that context has not yet been created then and the 'createIfNotInitalized' flag been set to false then returns NULL. 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..

ostatic void setExtensions(uint contextID, Extensions* extensions)
setExtensions allows users to override the extensions across graphics contexts. typically used when you have different extensions supported across graphics pipes but need to ensure that they all use the same low common denominator extensions.

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 buffered_value<GLuint> TextureNameList

omutable TextureNameList _handleList

otypedef buffered_value<uint> ImageModifiedTag

omutable ImageModifiedTag _modifiedTag

otypedef buffered_value<uint> TexParameterDirtyList

omutable TexParameterDirtyList _texParametersDirtyList

oWrapMode _wrap_s

oWrapMode _wrap_t

oWrapMode _wrap_r

oFilterMode _min_filter

oFilterMode _mag_filter

ofloat _maxAnisotropy

oVec4 _borderColor

oInternalFormatMode _internalFormatMode

omutable GLint _internalFormat


Direct child classes:
TextureCubeMap
Texture3D
Texture2D
Texture1D

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.