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 setUseHardwareMipMapGeneration(bool useHardwareMipMapGeneration)
Set the hint of whether to use hardware mip map generation where available
[more]inline bool getUseHardwareMipMapGeneration() const
Get the hint of whether to use hardware mip map generation where available
[more]inline void setUnRefImageDataAfterApply(bool flag)
Set the automatic unreference of image data after the texture has been set up in apply, on (true) or off (false).
[more]inline bool getUnRefImageDataAfterApply() const
Get the automatic unreference of image data after the texture has been set up in apply
[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(unsigned int contextID) const
Get the handle to the texture object for the current context
[more]inline unsigned int& getTextureParameterDirty(unsigned int contextID) const
get the dirty flag for the current contextID
[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(unsigned int 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(unsigned int 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 Extensions* getExtensions(unsigned int contextID, bool createIfNotInitalized)
Function to call to get the extension of a specified context.
[more]static void setExtensions(unsigned int contextID, Extensions* extensions)
setExtensions allows users to override the extensions across graphics contexts.
[more]void applyTexImage2D_load(GLenum target, const Image* image, State& state, GLsizei& width, GLsizei& height, GLsizei& numMimpmapLevels) const
Helper method which does the creation of the texture itself, but does not set or use texture binding.
[more]void applyTexImage2D_subload(GLenum target, const Image* image, State& state, GLsizei& width, GLsizei& height, GLsizei& numMimpmapLevels) const
Helper method which subloads images to the texture itself, but does not set or use texture binding.

Public Members

[more]enum WrapParameter
[more]enum WrapMode
[more]enum FilterParameter
[more]enum FilterMode
[more]enum InternalFormatMode
class SG_EXPORT 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 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]bool _useHardwareMipMapGeneration
[more]bool _unrefImageDataAfterApply
[more]Vec4 _borderColor
[more]InternalFormatMode _internalFormatMode
[more]mutable GLint _internalFormat

Protected Methods

[more]virtual ~Texture()
[more]virtual void computeInternalFormat() const = 0
[more]void computeInternalFormatWithImage(const 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]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<unsigned int> 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(DataVariance dv)
oinline 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&)
ostatic void setDeleteHandler(DeleteHandler* handler)
ostatic DeleteHandler* getDeleteHandler()
oinline void ref() const
oinline void unref_nodelete() const
oinline int referenceCount() const
oinline void unref() 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 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

oinline void setUseHardwareMipMapGeneration(bool useHardwareMipMapGeneration)
Set the hint of whether to use hardware mip map generation where available

oinline bool getUseHardwareMipMapGeneration() const
Get the hint of whether to use hardware mip map generation where available

oinline void setUnRefImageDataAfterApply(bool flag)
Set the automatic unreference of image data after the texture has been set up in apply, on (true) or off (false). If the image data is only referened by this Texture then the image data will be autoamtically deleted.

oinline bool getUnRefImageDataAfterApply() const
Get the automatic unreference of image data after the texture has been set up in apply

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

oinline GLuint& getTextureObject(unsigned int contextID) const
Get the handle to the texture object for the current context

oinline unsigned int& getTextureParameterDirty(unsigned int contextID) const
get the dirty flag for the current contextID

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(unsigned int 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(unsigned int 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 Extensions* getExtensions(unsigned int 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(unsigned int 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.

ovoid applyTexImage2D_load(GLenum target, const Image* image, State& state, GLsizei& width, GLsizei& height, GLsizei& numMimpmapLevels) const
Helper method which does the creation of the texture itself, but does not set or use texture binding. Note, do not call this method directly unless you are implementing your own Subload callback

ovoid applyTexImage2D_subload(GLenum target, const Image* image, State& state, GLsizei& width, GLsizei& height, GLsizei& numMimpmapLevels) const
Helper method which subloads images to the texture itself, but does not set or use texture binding. Note, do not call this method directly unless you are implementing your own Subload callback

ovirtual ~Texture()

ovirtual void computeInternalFormat() const = 0

ovoid computeInternalFormatWithImage(const osg::Image& image) const

obool isCompressedInternalFormat(GLint internalFormat) const

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

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<unsigned int> TexParameterDirtyList

omutable TexParameterDirtyList _texParametersDirtyList

oWrapMode _wrap_s

oWrapMode _wrap_t

oWrapMode _wrap_r

oFilterMode _min_filter

oFilterMode _mag_filter

ofloat _maxAnisotropy

obool _useHardwareMipMapGeneration

obool _unrefImageDataAfterApply

oVec4 _borderColor

oInternalFormatMode _internalFormatMode

omutable GLint _internalFormat


Direct child classes:
TextureRectangle
TextureCubeMap
Texture3D
Texture2D
Texture1D

Alphabetic index HTML hierarchy of classes or Java



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