Texture state class which encapsulates OpenGl texture functionality
Inheritance:
Public Methods
-
Texture2D()
-
Texture2D(const Texture2D& text, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
- Copy constructor using CopyOp to manage deep vs shallow copy
-
META_StateAttribute(osg, Texture2D, TEXTURE)
-
virtual int compare(const StateAttribute& rhs) const
- return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs
-
virtual void getAssociatedModes(std::vector<GLMode>& modes) const
-
void setImage(Image* image)
- Set the texture image.
-
Image* getImage()
- Get the texture image.
-
inline const Image* getImage() const
- Get the const texture image.
-
inline void setTextureSize(const int width, const int height) const
- Set the texture width and height.
-
inline void getTextureSize(int& width, int& height) const
- Get the texture subload width.
-
void setSubloadCallback(SubloadCallback* cb)
-
SubloadCallback* getSubloadCallback()
-
const SubloadCallback* getSubloadCallback() const
-
void setNumMipmapLevels(unsigned int num) const
- Set the number of mip map levels the the texture has been created with, should only be called within an osg::Texuture::apply() and custom OpenGL texture load
-
unsigned int getNumMipmapLevels() const
- Get the number of mip map levels the the texture has been created with
-
void copyTexImage2D(State& state, int x, int y, int width, int height )
- Copy pixels into a 2D texture imageAs per glCopyTexImage2D.
-
void copyTexSubImage2D(State& state, int xoffset, int yoffset, int x, int y, int width, int height )
- Copy a two-dimensional texture subimage.
-
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
Public Members
-
class SubloadCallback: public Referenced
Protected Fields
-
mutable ref_ptr<Image> _image
-
mutable GLsizei _textureWidth
-
mutable GLsizei _textureHeight
-
mutable GLsizei _numMimpmapLevels
-
ref_ptr<SubloadCallback> _subloadCallback
Protected Methods
-
virtual ~Texture2D()
-
virtual void computeInternalFormat() const
Inherited from Texture:
Public Methods
-
virtual osg::Object* cloneType() const
-
virtual osg::Object* clone(const CopyOp& copyop) const
-
virtual bool isSameKindAs(const osg::Object* obj) const
-
virtual const char* libraryName() const
-
virtual const char* className() const
-
virtual const Type getType() const
-
virtual bool isTextureAttribute() const
-
void setWrap(const WrapParameter which, const WrapMode wrap)
-
const WrapMode getWrap(const WrapParameter which) const
-
void setBorderColor(const Vec4& color)
-
const Vec4& borderColor(void) const
-
void setFilter(const FilterParameter which, const FilterMode filter)
-
const FilterMode getFilter(const FilterParameter which) const
-
void setMaxAnisotropy(float anis)
-
inline float getMaxAnisotropy() const
-
inline void setInternalFormatMode(const InternalFormatMode mode)
-
inline const InternalFormatMode getInternalFormatMode() const
-
inline void setInternalFormat(const int internalFormat)
-
inline const int getInternalFormat() const
-
bool isCompressedInternalFormat() const
-
inline GLuint& getTextureObject(const uint contextID) const
-
inline uint& getModifiedTag(const uint contextID) const
-
void dirtyTextureObject()
-
static void deleteTextureObject(uint contextID, GLuint handle)
-
static void flushDeletedTextureObjects(uint contextID)
-
static GLint getMaxTextureSize()
-
virtual void compile(State& state) const
Public Members
-
enum WrapParameter
-
enum WrapMode
-
enum FilterParameter
-
enum FilterMode
-
enum InternalFormatMode
-
Get the handle to the texture object for the current context
Protected Fields
-
WrapMode _wrap_s
-
WrapMode _wrap_t
-
WrapMode _wrap_r
-
FilterMode _min_filter
-
FilterMode _mag_filter
-
float _maxAnisotropy
-
Vec4 _borderColor
-
mutable bool _texParametersDirty
-
InternalFormatMode _internalFormatMode
-
mutable GLint _internalFormat
Protected Methods
-
void computeInternalFormatWithImage(osg::Image& image) const
-
bool isCompressedInternalFormat(GLint internalFormat) const
-
void applyTexParameters(GLenum target, State& state) const
-
void applyTexImage2D(GLenum target, Image* image, State& state, GLsizei& width, GLsizei& height, GLsizei& numMimpmapLevels) const
-
int compareTexture(const Texture& rhs) const
Protected Members
-
typedef std::vector<GLuint> TextureNameList mutable TextureNameList _handleList
-
typedef std::vector<uint> ImageModifiedTag mutable ImageModifiedTag _modifiedTag
-
typedef std::map<uint,std::set<uint> >static DeletedTextureObjectCache DeletedTextureObjectCache s_deletedTextureObjectCache
Public Methods
-
bool operator < (const StateAttribute& rhs) const
-
bool operator == (const StateAttribute& rhs) const
-
bool operator != (const StateAttribute& rhs) const
Public Members
-
typedef GLenum GLMode
-
typedef unsigned int GLModeValue
-
typedef unsigned int OverrideValue
-
enum Values
-
typedef unsigned int Type
-
enum Types
Inherited from Object:
Public Methods
-
inline void setDataVariance(const DataVariance dv)
-
inline const DataVariance getDataVariance() const
-
inline void setUserData(Referenced* obj)
-
inline Referenced* getUserData()
-
inline const Referenced* getUserData() const
Public Members
-
enum DataVariance
Protected Fields
-
DataVariance _dataVariance
-
ref_ptr<Referenced> _userData
Public Methods
-
inline Referenced& operator = (Referenced&)
-
inline void ref() const
-
inline void unref() const
-
inline void unref_nodelete() const
-
inline const int referenceCount() const
Protected Fields
-
mutable int _refCount
Documentation
Texture state class which encapsulates OpenGl texture functionality
- Texture2D()
- Texture2D(const Texture2D& text, const CopyOp& copyop=CopyOp::SHALLOW_COPY)
- Copy constructor using CopyOp to manage deep vs shallow copy
- META_StateAttribute(osg, Texture2D, TEXTURE)
- virtual int compare(const StateAttribute& rhs) const
- return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs
- virtual void getAssociatedModes(std::vector<GLMode>& modes) const
- void setImage(Image* image)
- Set the texture image.
- Image* getImage()
- Get the texture image.
- inline const Image* getImage() const
- Get the const texture image.
- inline void setTextureSize(const int width, const int height) const
- Set the texture width and height. If width or height are zero then
the repsective size value is calculated from the source image sizes.
- inline void getTextureSize(int& width, int& height) const
- Get the texture subload width.
- void setSubloadCallback(SubloadCallback* cb)
- SubloadCallback* getSubloadCallback()
- const SubloadCallback* getSubloadCallback() const
- void setNumMipmapLevels(unsigned int num) const
- Set the number of mip map levels the the texture has been created with,
should only be called within an osg::Texuture::apply() and custom OpenGL texture load
- unsigned int getNumMipmapLevels() const
- Get the number of mip map levels the the texture has been created with
- void 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.
- void 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.
- 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
- virtual ~Texture2D()
- virtual void computeInternalFormat() const
- mutable ref_ptr<Image> _image
- mutable GLsizei _textureWidth
- mutable GLsizei _textureHeight
- mutable GLsizei _numMimpmapLevels
- ref_ptr<SubloadCallback> _subloadCallback
- This class has no child classes.
Alphabetic index HTML hierarchy of classes or Java
This page was generated with the help of DOC++.