class SG_EXPORT osg::Texture

Texture state class which encapsulates OpenGl texture functionality

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] META_StateAttribute(osg, Texture, TEXTURE)
[more]virtual bool isTextureAttribute() const
[more]virtual int compare(const StateAttribute& rhs) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs
[more]virtual void getAssociatedModes(std::vector<GLMode>& modes) const
[more]void setImage(Image* image)
Set the texture image.
[more]Image* getImage()
Get the texture image.
[more]inline const Image* getImage() const
Get the const texture image.
[more]void copyTexImage2D(State& state, int x, int y, int width, int height )
Copy pixels into a 2D texture imageAs per glCopyTexImage2D.
[more]void copyTexSubImage2D(State& state, int xoffset, int yoffset, int x, int y, int width, int height )
Copy a two-dimensional texture subimage.
[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]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 setInternalFormatValue(const int internalFormat)
Set the internal format to use when creating OpenGL textures.
[more]inline const int getInternalFormatValue() const
Get the internal format to use when creating OpenGL textures
[more]inline const uint getTextureObject(const uint contextID) const
return the OpenGL texture object for specified context
[more]inline void setSubloadMode(const SubloadMode mode)
Set the texture subload mode.
[more]inline const SubloadMode getSubloadMode() const
Get the texture subload mode.
[more]inline void setSubloadOffset(const int x, const int y)
Set the texture subload offsets.
[more]inline void getSubloadOffset(int& x, int& y) const
Get the texture subload offsets.
[more]inline void setSubloadSize(const int width, const int height)
Set the texture subload width.
[more]inline void getSubloadSize(int& width, int& height) const
Get the texture subload width.
[more]inline GLuint& getHandle(const uint contextID) const
Get the handle to the texture object for the current context
[more]inline uint& getModifiedTag(const uint contextID) const
[more]void dirtyTextureObject()
Force a recompile on next apply() of associated OpenGL texture objects
[more]virtual void apply(State& state) const
On first apply (unless already compiled), create the minmapped texture and bind it, subsequent apply will simple bind to texture
[more]virtual void compile(State& state) const
Compile the texture mip maps.
[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

Public Members

[more]enum WrapParameter
[more]enum WrapMode
[more]enum FilterParameter
[more]enum FilterMode
[more]enum InternalFormatMode
[more]enum SubloadMode

Protected Fields

[more]mutable ref_ptr<Image> _image
[more]GLenum _target
[more]WrapMode _wrap_s
[more]WrapMode _wrap_t
[more]WrapMode _wrap_r
[more]FilterMode _min_filter
[more]FilterMode _mag_filter
[more]mutable bool _texParamtersDirty
[more]InternalFormatMode _internalFormatMode
[more]int _internalFormatValue
[more]Vec4 _borderColor
[more]mutable GLsizei _textureWidth
[more]mutable GLsizei _textureHeight
[more]SubloadMode _subloadMode
[more]GLint _subloadOffsX
[more]GLint _subloadOffsY
[more]GLsizei _subloadWidth
[more]GLsizei _subloadHeight

Protected Methods

[more]virtual ~Texture()
[more]void applyTexParameters(GLenum target, State& state) const
Method which does setting of texture paramters.
[more]virtual void applyTexImage(GLenum target, Image* image, State& state) const
Method which does the creation of the texture itself, and does not set or use texture binding.

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 Object* cloneType() const
ovirtual Object* clone(const CopyOp&) const
ovirtual bool isSameKindAs(const Object* obj) const
ovirtual const char* libraryName() const
ovirtual const char* className() const
ovirtual const Type getType() const
obool operator < (const StateAttribute& rhs) const
obool operator == (const StateAttribute& rhs) const
obool operator != (const StateAttribute& rhs) 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 state class which encapsulates OpenGl texture functionality
o Texture()

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

o META_StateAttribute(osg, Texture, TEXTURE)

ovirtual bool isTextureAttribute() const

ovirtual int compare(const StateAttribute& rhs) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs

ovirtual void getAssociatedModes(std::vector<GLMode>& modes) const

ovoid setImage(Image* image)
Set the texture image.

oImage* getImage()
Get the texture image.

oinline const Image* getImage() const
Get the const texture image.

ovoid copyTexImage2D(State& state, int x, int y, int width, int height )
Copy pixels into a 2D texture imageAs per glCopyTexImage2D. Creates an OpenGL texture object from the current OpenGL background framebuffer contents at pos \a x, \a y with width \a width and height \a height. \a width and \a height must be a power of two.

ovoid copyTexSubImage2D(State& state, int xoffset, int yoffset, int x, int y, int width, int height )
Copy a two-dimensional texture subimage. As per glCopyTexSubImage2D. Updates portion of an existing OpenGL texture object from the current OpenGL background framebuffer contents at pos \a x, \a y with width \a width and height \a height. \a width and \a height must be a power of two, and writing into the texture with offset \a xoffset and \a yoffset.

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

o ANISOTROPIC

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

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

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

oinline void setInternalFormatValue(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 getInternalFormatValue() const
Get the internal format to use when creating OpenGL textures

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

oenum SubloadMode

o OFF

o AUTO

o IF_DIRTY

oinline void setSubloadMode(const SubloadMode mode)
Set the texture subload mode.

oinline const SubloadMode getSubloadMode() const
Get the texture subload mode.

oinline void setSubloadOffset(const int x, const int y)
Set the texture subload offsets.

oinline void getSubloadOffset(int& x, int& y) const
Get the texture subload offsets.

oinline void setSubloadSize(const int width, const int height)
Set the texture subload width. If width or height are zero then the repsective size value is calculated from the source image sizes.

oinline void getSubloadSize(int& width, int& height) const
Get the texture subload width.

oinline GLuint& getHandle(const uint contextID) const
Get the handle to the texture object for the current context

oinline uint& getModifiedTag(const uint contextID) const

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

ovirtual void apply(State& state) const
On first apply (unless already compiled), create the minmapped texture and bind it, subsequent apply will simple bind to texture

ovirtual void compile(State& state) const
Compile the texture mip maps. Implemented by simply calling apply().

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 ~Texture()

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

ovirtual void applyTexImage(GLenum target, Image* image, State& state) const
Method which does the creation of the texture itself, and does not set or use texture binding.

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

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

omutable ref_ptr<Image> _image

oGLenum _target

oWrapMode _wrap_s

oWrapMode _wrap_t

oWrapMode _wrap_r

oFilterMode _min_filter

oFilterMode _mag_filter

omutable bool _texParamtersDirty

oInternalFormatMode _internalFormatMode

oint _internalFormatValue

oVec4 _borderColor

omutable GLsizei _textureWidth

omutable GLsizei _textureHeight

oSubloadMode _subloadMode

oGLint _subloadOffsX

oGLint _subloadOffsY

oGLsizei _subloadWidth

oGLsizei _subloadHeight

otypedef std::map<uint,std::set<uint> >static DeletedTextureObjectCache DeletedTextureObjectCache s_deletedTextureObjectCache


Direct child classes:
TextureCubeMap

Alphabetic index HTML hierarchy of classes or Java



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