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(Texture, (Type)(TEXTURE_0+_textureUnit))
[more]virtual int compare(const StateAttribute& rhs) const
return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs
[more]virtual void setStateSetModes(StateSet& ds, const GLModeValue value) 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]inline void setTextureUnit(const unsigned int textureUnit)
Set the texture unit.
[more]inline const unsigned int getTextureUnit() const
get the texture unit
[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 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 const uint getTextureObjectSize() const
return the memory size of texture object.
[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 GLuint& getHandle(const uint contextID) const
Get the handle to the texture object for the current context
[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]virtual void applyImmediateMode(State& state) const
Method which does the creation of the texture itself, and does not set or use texture binding.
[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 uint _textureObjectSize
[more]mutable ref_ptr<Image> _image
[more]unsigned int _textureUnit
[more]WrapMode _wrap_s
[more]WrapMode _wrap_t
[more]WrapMode _wrap_r
[more]FilterMode _min_filter
[more]FilterMode _mag_filter
[more]InternalFormatMode _internalFormatMode
[more]int _internalFormatValue
[more]mutable unsigned int _textureWidth
[more]mutable unsigned int _textureHeight
[more]SubloadMode _subloadMode
[more]unsigned int _subloadOffsX
[more]unsigned int _subloadOffsY

Protected Methods

[more]virtual ~Texture()

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* 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:


Inherited from Referenced:

Public Methods

oinline Referenced& operator = (Referenced&)
oinline void ref() const
oinline void unref() 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(Texture, (Type)(TEXTURE_0+_textureUnit))

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

ovirtual void setStateSetModes(StateSet& ds, const GLModeValue value) 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.

oinline void setTextureUnit(const unsigned int textureUnit)
Set the texture unit. Valid values are 0,1,2,3. Default value of texture unit is 0. note, multi-texturing not fully implemented yet... April 2001.

oinline const unsigned int getTextureUnit() const
get the texture unit

oenum WrapParameter

o WRAP_S

o WRAP_T

o WRAP_R

oenum WrapMode

o CLAMP

o CLAMP_TO_EDGE

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

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

oinline const uint getTextureObjectSize() const
return the memory size of texture object. Texture object size can be used for estimating the cost of uploading the texture to graphics hardware, which in turn can be used for setting texture residence priorities.

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 GLuint& getHandle(const uint contextID) const
Get the handle to the texture object for the current context

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().

ovirtual void applyImmediateMode(State& state) const
Method which does the creation of the texture itself, and does not set or use texture binding.

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

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

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

omutable uint _textureObjectSize

omutable ref_ptr<Image> _image

ounsigned int _textureUnit

oWrapMode _wrap_s

oWrapMode _wrap_t

oWrapMode _wrap_r

oFilterMode _min_filter

oFilterMode _mag_filter

oInternalFormatMode _internalFormatMode

oint _internalFormatValue

omutable unsigned int _textureWidth

omutable unsigned int _textureHeight

oSubloadMode _subloadMode

ounsigned int _subloadOffsX

ounsigned int _subloadOffsY

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


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



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