Public Types |
enum | WrapParameter { WRAP_S,
WRAP_T,
WRAP_R
} |
enum | WrapMode {
CLAMP = GL_CLAMP,
CLAMP_TO_EDGE = GL_CLAMP_TO_EDGE,
CLAMP_TO_BORDER = GL_CLAMP_TO_BORDER_ARB,
REPEAT = GL_REPEAT,
MIRROR = GL_MIRRORED_REPEAT_IBM
} |
enum | FilterParameter { MIN_FILTER,
MAG_FILTER
} |
enum | FilterMode {
LINEAR = GL_LINEAR,
LINEAR_MIPMAP_LINEAR = GL_LINEAR_MIPMAP_LINEAR,
LINEAR_MIPMAP_NEAREST = GL_LINEAR_MIPMAP_NEAREST,
NEAREST = GL_NEAREST,
NEAREST_MIPMAP_LINEAR = GL_NEAREST_MIPMAP_LINEAR,
NEAREST_MIPMAP_NEAREST = GL_NEAREST_MIPMAP_NEAREST
} |
enum | InternalFormatMode {
USE_IMAGE_DATA_FORMAT,
USE_USER_DEFINED_FORMAT,
USE_ARB_COMPRESSION,
USE_S3TC_DXT1_COMPRESSION,
USE_S3TC_DXT3_COMPRESSION,
USE_S3TC_DXT5_COMPRESSION
} |
Public Methods |
| Texture () |
| Texture (const Texture &text, const CopyOp ©op=CopyOp::SHALLOW_COPY) |
| Copy constructor using CopyOp to manage deep vs shallow copy.
|
virtual osg::Object * | cloneType () const=0 |
| Clone the type of an attribute, with Object* return type.
|
virtual osg::Object * | clone (const CopyOp ©op) const=0 |
| Clone an attribute, with Object* return type.
|
virtual bool | isSameKindAs (const osg::Object *obj) const |
virtual const char * | libraryName () const |
| return the name of the attribute's library.
|
virtual const char * | className () const |
| return the name of the attribute's class type.
|
virtual const Type | getType () const |
| return the Type identifier of the attribute's class type.
|
virtual bool | isTextureAttribute () const |
| return true if StateAttribute is a type which controls texturing and needs to be issued w.r.t to specific texture unit.
|
void | setWrap (const WrapParameter which, const WrapMode wrap) |
| Set the texture wrap mode.
|
const WrapMode | getWrap (const WrapParameter which) const |
| Get the texture wrap mode.
|
void | setBorderColor (const Vec4 &color) |
| Sets the border color for this texture.
|
const Vec4 & | borderColor (void) const |
void | setFilter (const FilterParameter which, const FilterMode filter) |
| Set the texture filter mode.
|
const FilterMode | getFilter (const FilterParameter which) const |
| Get the texture filter mode.
|
void | setMaxAnisotropy (float anis) |
| Set the maximum anisotropy value, default value is 1.0 for no anisotropic filtering.
|
float | getMaxAnisotropy () const |
| Get the maximum anisotropy value.
|
void | setInternalFormatMode (const InternalFormatMode mode) |
| Set the internal format mode.
|
const InternalFormatMode | getInternalFormatMode () const |
| Get the internal format mode.
|
void | setInternalFormat (const int internalFormat) |
| Set the internal format to use when creating OpenGL textures.
|
const int | getInternalFormat () const |
| Get the internal format to use when creating OpenGL textures.
|
bool | isCompressedInternalFormat () const |
GLuint & | getTextureObject (const uint contextID) const |
| return the OpenGL texture object for specified context.
|
uint & | getModifiedTag (const uint contextID) const |
void | dirtyTextureObject () |
| Force a recompile on next apply() of associated OpenGL texture objects.
|
virtual void | apply (State &state) const=0 |
| Texture is pure virtual base class, apply must be overriden.
|
virtual void | compile (State &state) const |
| Calls apply(state) to compile the texture.
|
Static Public Methods |
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.
|
void | flushDeletedTextureObjects (uint contextID) |
| flush all the cached display list which need to be deleted in the OpenGL context related to contextID.
|
GLint | getMaxTextureSize () |
| Get the maximum texture size supported, this is the normally define by GL_MAX_TEXTURE_SIZE, but can be overridden by the OSG_MAX_TEXTURE_SIZE environmental variable.
|
Protected Types |
typedef std::vector< GLuint > | TextureNameList |
typedef std::vector< uint > | ImageModifiedTag |
typedef std::map< uint, std::set<
uint > > | DeletedTextureObjectCache |
Protected Methods |
virtual | ~Texture () |
virtual void | computeInternalFormat () const=0 |
void | computeInternalFormatWithImage (osg::Image &image) const |
bool | isCompressedInternalFormat (GLint internalFormat) const |
void | applyTexParameters (GLenum target, State &state) const |
| Helper method which does setting of texture paramters.
|
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.
|
int | compareTexture (const Texture &rhs) const |
| return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
|
Protected Attributes |
TextureNameList | _handleList |
ImageModifiedTag | _modifiedTag |
WrapMode | _wrap_s |
WrapMode | _wrap_t |
WrapMode | _wrap_r |
FilterMode | _min_filter |
FilterMode | _mag_filter |
float | _maxAnisotropy |
Vec4 | _borderColor |
bool | _texParametersDirty |
InternalFormatMode | _internalFormatMode |
GLint | _internalFormat |
Static Protected Attributes |
DeletedTextureObjectCache | s_deletedTextureObjectCache |