Texture
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSG_TEXTURE
#define OSG_TEXTURE 1
#include <osg/GL>
#include <osg/Image>
#include <osg/StateAttribute>
#include <osg/GraphicsContext>
#include <osg/ref_ptr>
#include <osg/Vec4>
#include <osg/Vec4d>
#include <osg/Vec4i>
#include <osg/buffered_value>
#include <osg/GLExtensions>
#include <list>
#include <map>
// If not defined by gl.h use the definition found in:
// http://oss.sgi.com/projects/ogl-sample/registry/EXT/texture_filter_anisotropic.txt
#ifndef GL_TEXTURE_MAX_ANISOTROPY_EXT
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
#endif
// If not defined, use the definition found in:
// http://www.opengl.org/registry/specs/ARB/texture_swizzle.txt
#ifndef GL_TEXTURE_SWIZZLE_RGBA
#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
#endif
#ifndef GL_ARB_texture_compression
#define GL_COMPRESSED_ALPHA_ARB 0x84E9
#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
#define GL_COMPRESSED_RGB_ARB 0x84ED
#define GL_COMPRESSED_RGBA_ARB 0x84EE
#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
#endif
#ifndef GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB
#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
#endif
#ifndef GL_EXT_texture_compression_s3tc
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
#endif
#ifndef GL_EXT_texture_compression_rgtc
#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
#endif
#ifndef GL_IMG_texture_compression_pvrtc
#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
#endif
#ifndef GL_OES_compressed_ETC1_RGB8_texture
#define GL_ETC1_RGB8_OES 0x8D64
#endif
#ifndef GL_ARB_INTERNAL_TEXTURE_FORMAT
#define GL_RGBA32F_ARB 0x8814
#define GL_RGB32F_ARB 0x8815
#define GL_ALPHA32F_ARB 0x8816
#define GL_INTENSITY32F_ARB 0x8817
#define GL_LUMINANCE32F_ARB 0x8818
#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
#define GL_RGBA16F_ARB 0x881A
#define GL_RGB16F_ARB 0x881B
#define GL_ALPHA16F_ARB 0x881C
#define GL_INTENSITY16F_ARB 0x881D
#define GL_LUMINANCE16F_ARB 0x881E
#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
#endif
#ifndef GL_HALF_FLOAT
#define GL_HALF_FLOAT 0x140B
#endif
#ifndef GL_NV_texture_shader
#define GL_HILO_NV 0x86F4
#define GL_DSDT_NV 0x86F5
#define GL_DSDT_MAG_NV 0x86F6
#define GL_DSDT_MAG_VIB_NV 0x86F7
#define GL_HILO16_NV 0x86F8
#define GL_SIGNED_HILO_NV 0x86F9
#define GL_SIGNED_HILO16_NV 0x86FA
#define GL_SIGNED_RGBA_NV 0x86FB
#define GL_SIGNED_RGBA8_NV 0x86FC
#define GL_SIGNED_RGB_NV 0x86FE
#define GL_SIGNED_RGB8_NV 0x86FF
#define GL_SIGNED_LUMINANCE_NV 0x8701
#define GL_SIGNED_LUMINANCE8_NV 0x8702
#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
#define GL_SIGNED_ALPHA_NV 0x8705
#define GL_SIGNED_ALPHA8_NV 0x8706
#define GL_SIGNED_INTENSITY_NV 0x8707
#define GL_SIGNED_INTENSITY8_NV 0x8708
#define GL_DSDT8_NV 0x8709
#define GL_DSDT8_MAG8_NV 0x870A
#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
#endif
#ifndef GL_NV_float_buffer
#define GL_FLOAT_R_NV 0x8880
#define GL_FLOAT_RG_NV 0x8881
#define GL_FLOAT_RGB_NV 0x8882
#define GL_FLOAT_RGBA_NV 0x8883
#define GL_FLOAT_R16_NV 0x8884
#define GL_FLOAT_R32_NV 0x8885
#define GL_FLOAT_RG16_NV 0x8886
#define GL_FLOAT_RG32_NV 0x8887
#define GL_FLOAT_RGB16_NV 0x8888
#define GL_FLOAT_RGB32_NV 0x8889
#define GL_FLOAT_RGBA16_NV 0x888A
#define GL_FLOAT_RGBA32_NV 0x888B
#endif
#ifndef GL_ATI_texture_float
#define GL_RGBA_FLOAT32_ATI 0x8814
#define GL_RGB_FLOAT32_ATI 0x8815
#define GL_ALPHA_FLOAT32_ATI 0x8816
#define GL_INTENSITY_FLOAT32_ATI 0x8817
#define GL_LUMINANCE_FLOAT32_ATI 0x8818
#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
#define GL_RGBA_FLOAT16_ATI 0x881A
#define GL_RGB_FLOAT16_ATI 0x881B
#define GL_ALPHA_FLOAT16_ATI 0x881C
#define GL_INTENSITY_FLOAT16_ATI 0x881D
#define GL_LUMINANCE_FLOAT16_ATI 0x881E
#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
#endif
#ifndef GL_MIRRORED_REPEAT_IBM
#define GL_MIRRORED_REPEAT_IBM 0x8370
#endif
#ifndef GL_CLAMP_TO_EDGE
#define GL_CLAMP_TO_EDGE 0x812F
#endif
#ifndef GL_CLAMP
#define GL_CLAMP 0x2900
#endif
#ifndef GL_CLAMP_TO_BORDER_ARB
#define GL_CLAMP_TO_BORDER_ARB 0x812D
#endif
#ifndef GL_INTENSITY
// OpenGL ES1 and ES2 doesn't provide GL_INTENSITY
#define GL_INTENSITY 0x8049
#endif
#ifndef GL_GENERATE_MIPMAP_SGIS
#define GL_GENERATE_MIPMAP_SGIS 0x8191
#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
#endif
#ifndef GL_TEXTURE_3D
#define GL_TEXTURE_3D 0x806F
#endif
#ifndef GL_TEXTURE_CUBE_MAP
#define GL_TEXTURE_CUBE_MAP 0x8513
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
#endif
#ifndef GL_TEXTURE_BINDING_3D
#define GL_TEXTURE_BINDING_3D 0x806A
#endif
#ifndef GL_DEPTH_TEXTURE_MODE_ARB
#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
#endif
#ifndef GL_TEXTURE_COMPARE_MODE_ARB
#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
#endif
#ifndef GL_TEXTURE_COMPARE_FUNC_ARB
#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
#endif
#ifndef GL_COMPARE_R_TO_TEXTURE_ARB
#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
#endif
#ifndef TEXTURE_COMPARE_FAIL_VALUE_ARB
#define TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
#endif
#if !defined( GL_MAX_TEXTURE_UNITS )
#define GL_MAX_TEXTURE_UNITS 0x84E2
#endif
#ifndef GL_TEXTURE_DEPTH
#define GL_TEXTURE_DEPTH 0x8071
#endif
#ifndef GL_TEXTURE_2D_MULTISAMPLE
#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
#endif
// Integer texture extension as in http://www.opengl.org/registry/specs/EXT/texture_integer.txt
#ifndef GL_EXT_texture_integer
#define GL_RGBA32UI_EXT 0x8D70
#define GL_RGB32UI_EXT 0x8D71
#define GL_ALPHA32UI_EXT 0x8D72
#define GL_INTENSITY32UI_EXT 0x8D73
#define GL_LUMINANCE32UI_EXT 0x8D74
#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
#define GL_RGBA16UI_EXT 0x8D76
#define GL_RGB16UI_EXT 0x8D77
#define GL_ALPHA16UI_EXT 0x8D78
#define GL_INTENSITY16UI_EXT 0x8D79
#define GL_LUMINANCE16UI_EXT 0x8D7A
#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
#define GL_RGBA8UI_EXT 0x8D7C
#define GL_RGB8UI_EXT 0x8D7D
#define GL_ALPHA8UI_EXT 0x8D7E
#define GL_INTENSITY8UI_EXT 0x8D7F
#define GL_LUMINANCE8UI_EXT 0x8D80
#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
#define GL_RGBA32I_EXT 0x8D82
#define GL_RGB32I_EXT 0x8D83
#define GL_ALPHA32I_EXT 0x8D84
#define GL_INTENSITY32I_EXT 0x8D85
#define GL_LUMINANCE32I_EXT 0x8D86
#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
#define GL_RGBA16I_EXT 0x8D88
#define GL_RGB16I_EXT 0x8D89
#define GL_ALPHA16I_EXT 0x8D8A
#define GL_INTENSITY16I_EXT 0x8D8B
#define GL_LUMINANCE16I_EXT 0x8D8C
#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
#define GL_RGBA8I_EXT 0x8D8E
#define GL_RGB8I_EXT 0x8D8F
#define GL_ALPHA8I_EXT 0x8D90
#define GL_INTENSITY8I_EXT 0x8D91
#define GL_LUMINANCE8I_EXT 0x8D92
#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
#define GL_RED_INTEGER_EXT 0x8D94
#define GL_GREEN_INTEGER_EXT 0x8D95
#define GL_BLUE_INTEGER_EXT 0x8D96
#define GL_ALPHA_INTEGER_EXT 0x8D97
#define GL_RGB_INTEGER_EXT 0x8D98
#define GL_RGBA_INTEGER_EXT 0x8D99
#define GL_BGR_INTEGER_EXT 0x8D9A
#define GL_BGRA_INTEGER_EXT 0x8D9B
#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
#endif
#ifndef GL_VERSION_1_1
#define GL_R3_G3_B2 0x2A10
#define GL_RGB4 0x804F
#define GL_RGB5 0x8050
#define GL_RGB8 0x8051
#define GL_RGB10 0x8052
#define GL_RGB12 0x8053
#define GL_RGB16 0x8054
#define GL_RGBA2 0x8055
#define GL_RGBA4 0x8056
#define GL_RGB5_A1 0x8057
#define GL_RGBA8 0x8058
#define GL_RGB10_A2 0x8059
#define GL_RGBA12 0x805A
#define GL_RGBA16 0x805B
#define GL_BGR_EXT 0x80E0
#define GL_BGRA_EXT 0x80E1
#endif
#ifndef GL_ARB_texture_rg
#define GL_RG 0x8227
#define GL_RG_INTEGER 0x8228
#define GL_R8 0x8229
#define GL_R16 0x822A
#define GL_RG8 0x822B
#define GL_RG16 0x822C
#define GL_R16F 0x822D
#define GL_R32F 0x822E
#define GL_RG16F 0x822F
#define GL_RG32F 0x8230
#define GL_R8I 0x8231
#define GL_R8UI 0x8232
#define GL_R16I 0x8233
#define GL_R16UI 0x8234
#define GL_R32I 0x8235
#define GL_R32UI 0x8236
#define GL_RG8I 0x8237
#define GL_RG8UI 0x8238
#define GL_RG16I 0x8239
#define GL_RG16UI 0x823A
#define GL_RG32I 0x823B
#define GL_RG32UI 0x823C
#endif
#ifndef GL_ARB_shader_image_load_store
#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
#define GL_UNIFORM_BARRIER_BIT 0x00000004
#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
#define GL_COMMAND_BARRIER_BIT 0x00000040
#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080
#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100
#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200
#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000
#define GL_ALL_BARRIER_BITS 0xFFFFFFFF
#define GL_MAX_IMAGE_UNITS 0x8F38
#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39
#define GL_IMAGE_BINDING_NAME 0x8F3A
#define GL_IMAGE_BINDING_LEVEL 0x8F3B
#define GL_IMAGE_BINDING_LAYERED 0x8F3C
#define GL_IMAGE_BINDING_LAYER 0x8F3D
#define GL_IMAGE_BINDING_ACCESS 0x8F3E
#define GL_IMAGE_1D 0x904C
#define GL_IMAGE_2D 0x904D
#define GL_IMAGE_3D 0x904E
#define GL_IMAGE_2D_RECT 0x904F
#define GL_IMAGE_CUBE 0x9050
#define GL_IMAGE_BUFFER 0x9051
#define GL_IMAGE_1D_ARRAY 0x9052
#define GL_IMAGE_2D_ARRAY 0x9053
#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
#define GL_IMAGE_2D_MULTISAMPLE 0x9055
#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056
#define GL_INT_IMAGE_1D 0x9057
#define GL_INT_IMAGE_2D 0x9058
#define GL_INT_IMAGE_3D 0x9059
#define GL_INT_IMAGE_2D_RECT 0x905A
#define GL_INT_IMAGE_CUBE 0x905B
#define GL_INT_IMAGE_BUFFER 0x905C
#define GL_INT_IMAGE_1D_ARRAY 0x905D
#define GL_INT_IMAGE_2D_ARRAY 0x905E
#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060
#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061
#define GL_UNSIGNED_INT_IMAGE_1D 0x9062
#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065
#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068
#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B
#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C
#define GL_MAX_IMAGE_SAMPLES 0x906D
#define GL_IMAGE_BINDING_FORMAT 0x906E
#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7
#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8
#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9
#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA
#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB
#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC
#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD
#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
#endif
//#define OSG_COLLECT_TEXTURE_APPLIED_STATS 1
namespace osg {
// forward declare
class TextureObjectSet;
class TextureObjectManager;
class OSG_EXPORT Texture : public osg::StateAttribute
{
public :
Texture();
Texture(const Texture& text,const CopyOp& copyop=CopyOp::SHALLOW_COPY);
virtual osg::Object* cloneType() const = 0;
virtual osg::Object* clone(const CopyOp& copyop) const = 0;
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const Texture *>(obj)!=NULL; }
virtual const char* libraryName() const { return "osg"; }
virtual const char* className() const { return "Texture"; }
virtual Texture* asTexture() { return this; }
virtual const Texture* asTexture() const { return this; }
virtual Type getType() const { return TEXTURE; }
virtual bool isTextureAttribute() const { return true; }
virtual GLenum getTextureTarget() const = 0;
#ifdef OSG_GL_FIXED_FUNCTION_AVAILABLE
virtual bool getModeUsage(StateAttribute::ModeUsage& usage) const
{
usage.usesTextureMode(getTextureTarget());
return true;
}
#endif
virtual int getTextureWidth() const { return 0; }
virtual int getTextureHeight() const { return 0; }
virtual int getTextureDepth() const { return 0; }
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
};
void setWrap(WrapParameter which, WrapMode wrap);
WrapMode getWrap(WrapParameter which) const;
void setBorderColor(const Vec4d& color) { _borderColor = color; dirtyTextureParameters(); }
const Vec4d& getBorderColor() const { return _borderColor; }
void setBorderWidth(GLint width) { _borderWidth = width; dirtyTextureParameters(); }
GLint getBorderWidth() const { return _borderWidth; }
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
};
void setFilter(FilterParameter which, FilterMode filter);
FilterMode getFilter(FilterParameter which) const;
void setMaxAnisotropy(float anis);
inline float getMaxAnisotropy() const { return _maxAnisotropy; }
void setMinLOD(float minlod);
inline float getMinLOD() const { return _minlod; }
void setMaxLOD(float maxlod);
inline float getMaxLOD() const { return _maxlod; }
void setLODBias(float lodbias);
inline float getLODBias() const { return _lodbias; }
inline void setSwizzle(const Vec4i& swizzle) { _swizzle = swizzle; dirtyTextureParameters(); };
inline const Vec4i& getSwizzle() const { return _swizzle; }
inline void setUseHardwareMipMapGeneration(bool useHardwareMipMapGeneration) { _useHardwareMipMapGeneration = useHardwareMipMapGeneration; }
inline bool getUseHardwareMipMapGeneration() const { return _useHardwareMipMapGeneration; }
inline void setUnRefImageDataAfterApply(bool flag) { _unrefImageDataAfterApply = flag; }
inline bool getUnRefImageDataAfterApply() const { return _unrefImageDataAfterApply; }
inline void setClientStorageHint(bool flag) { _clientStorageHint = flag; }
inline bool getClientStorageHint() const { return _clientStorageHint; }
inline void setResizeNonPowerOfTwoHint(bool flag) { _resizeNonPowerOfTwoHint = flag; }
inline bool getResizeNonPowerOfTwoHint() const { return _resizeNonPowerOfTwoHint; }
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,
USE_PVRTC_2BPP_COMPRESSION,
USE_PVRTC_4BPP_COMPRESSION,
USE_ETC_COMPRESSION,
USE_ETC2_COMPRESSION,
USE_RGTC1_COMPRESSION,
USE_RGTC2_COMPRESSION,
USE_S3TC_DXT1c_COMPRESSION,
USE_S3TC_DXT1a_COMPRESSION
};
inline void setInternalFormatMode(InternalFormatMode mode) { _internalFormatMode = mode; }
inline InternalFormatMode getInternalFormatMode() const { return _internalFormatMode; }
inline void setInternalFormat(GLint internalFormat)
{
_internalFormatMode = USE_USER_DEFINED_FORMAT;
_internalFormat = internalFormat;
computeInternalFormatType();
}
inline GLint getInternalFormat() const { if (_internalFormat==0) computeInternalFormat(); return _internalFormat; }
bool isCompressedInternalFormat() const;
inline void setSourceFormat(GLenum sourceFormat) { _sourceFormat = sourceFormat; }
inline GLenum getSourceFormat() const { return _sourceFormat; }
inline void setSourceType(GLenum sourceType) { _sourceType = sourceType; }
inline GLenum getSourceType() const { return _sourceType; }
enum InternalFormatType{
NORMALIZED = 0x0,
FLOAT = 0x1,
SIGNED_INTEGER = 0x2,
UNSIGNED_INTEGER = 0x4
};
inline InternalFormatType getInternalFormatType() const { return _internalFormatType; }
/* select the size internal format to use based on Image when available or Texture format settings.*/
GLenum selectSizedInternalFormat(const osg::Image* image=0) const;
class TextureObject;
virtual bool isDirty(unsigned int /*contextID*/) const { return false; }
inline TextureObject* getTextureObject(unsigned int contextID) const
{
return _textureObjectBuffer[contextID].get();
}
inline void setTextureObject(unsigned int contextID, TextureObject* to)
{
_textureObjectBuffer[contextID] = to;
}
void dirtyTextureObject();
bool areAllTextureObjectsLoaded() const;
inline unsigned int& getTextureParameterDirty(unsigned int contextID) const
{
return _texParametersDirtyList[contextID];
}
void dirtyTextureParameters();
void allocateMipmapLevels();
void setShadowComparison(bool flag) { _use_shadow_comparison = flag; }
bool getShadowComparison() const { return _use_shadow_comparison; }
enum ShadowCompareFunc {
NEVER = GL_NEVER,
LESS = GL_LESS,
EQUAL = GL_EQUAL,
LEQUAL = GL_LEQUAL,
GREATER = GL_GREATER,
NOTEQUAL = GL_NOTEQUAL,
GEQUAL = GL_GEQUAL,
ALWAYS = GL_ALWAYS
};
void setShadowCompareFunc(ShadowCompareFunc func) { _shadow_compare_func = func; }
ShadowCompareFunc getShadowCompareFunc() const { return _shadow_compare_func; }
enum ShadowTextureMode {
LUMINANCE = GL_LUMINANCE,
INTENSITY = GL_INTENSITY,
ALPHA = GL_ALPHA,
NONE = GL_NONE
};
void setShadowTextureMode(ShadowTextureMode mode) { _shadow_texture_mode = mode; }
ShadowTextureMode getShadowTextureMode() const { return _shadow_texture_mode; }
void setShadowAmbient(float shadow_ambient) { _shadow_ambient = shadow_ambient; }
float getShadowAmbient() const { return _shadow_ambient; }
virtual void setImage(unsigned int face, Image* image) = 0;
template<class T> void setImage(unsigned int face, const ref_ptr<T>& image) { setImage(face, image.get()); }
virtual Image* getImage(unsigned int face) = 0;
virtual const Image* getImage(unsigned int face) const = 0;
virtual unsigned int getNumImages() const = 0;
void setReadPBuffer(GraphicsContext* context) { _readPBuffer = context; }
template<class T> void setReadPBuffer(const ref_ptr<T>& context) { setReadPBuffer(context.get()); }
GraphicsContext* getReadPBuffer() { return _readPBuffer.get(); }
const GraphicsContext* getReadPBuffer() const { return _readPBuffer.get(); }
virtual void apply(State& state) const = 0;
virtual void compileGLObjects(State& state) const;
virtual void resizeGLObjectBuffers(unsigned int maxSize);
virtual void releaseGLObjects(State* state=0) const;
static bool isCompressedInternalFormat(GLint internalFormat);
static void getCompressedSize(GLenum internalFormat, GLint width, GLint height, GLint depth, GLint& blockSize, GLint& size);
void applyTexImage2D_load(State& state, GLenum target, const Image* image, GLsizei width, GLsizei height,GLsizei numMipmapLevels) const;
void applyTexImage2D_subload(State& state, GLenum target, const Image* image, GLsizei width, GLsizei height, GLint inInternalFormat, GLsizei numMipmapLevels) const;
enum GenerateMipmapMode
{
GENERATE_MIPMAP_NONE,
GENERATE_MIPMAP,
GENERATE_MIPMAP_TEX_PARAMETER
};
protected :
virtual ~Texture();
virtual void computeInternalFormat() const = 0;
void computeInternalFormatWithImage(const osg::Image& image) const;
void computeRequiredTextureDimensions(State& state, const osg::Image& image,GLsizei& width, GLsizei& height,GLsizei& numMipmapLevels) const;
void computeInternalFormatType() const;
void applyTexParameters(GLenum target, State& state) const;
bool isHardwareMipmapGenerationEnabled(const State& state) const;
bool isSafeToUnrefImageData(const State& state) const {
return (_unrefImageDataAfterApply && state.getMaxTexturePoolSize()==0 && areAllTextureObjectsLoaded());
}
GenerateMipmapMode mipmapBeforeTexImage(const State& state, bool hardwareMipmapOn) const;
void mipmapAfterTexImage(State& state, GenerateMipmapMode beforeResult) const;
void generateMipmap(State& state) const;
virtual void allocateMipmap(State& state) const = 0;
int compareTexture(const Texture& rhs) const;
int compareTextureObjects(const Texture& rhs) const;
typedef buffered_value<unsigned int> TexParameterDirtyList;
mutable TexParameterDirtyList _texParametersDirtyList;
mutable TexParameterDirtyList _texMipmapGenerationDirtyList;
WrapMode _wrap_s;
WrapMode _wrap_t;
WrapMode _wrap_r;
FilterMode _min_filter;
FilterMode _mag_filter;
float _maxAnisotropy;
float _minlod;
float _maxlod;
float _lodbias;
Vec4i _swizzle;
bool _useHardwareMipMapGeneration;
bool _unrefImageDataAfterApply;
bool _clientStorageHint;
bool _resizeNonPowerOfTwoHint;
Vec4d _borderColor;
GLint _borderWidth;
InternalFormatMode _internalFormatMode;
mutable InternalFormatType _internalFormatType;
mutable GLint _internalFormat;
mutable GLenum _sourceFormat;
mutable GLenum _sourceType;
bool _use_shadow_comparison;
ShadowCompareFunc _shadow_compare_func;
ShadowTextureMode _shadow_texture_mode;
float _shadow_ambient;
public:
struct OSG_EXPORT TextureProfile
{
inline TextureProfile(GLenum target):
_target(target),
_numMipmapLevels(0),
_internalFormat(0),
_width(0),
_height(0),
_depth(0),
_border(0),
_size(0) {}
inline TextureProfile(GLenum target,
GLint numMipmapLevels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border):
_target(target),
_numMipmapLevels(numMipmapLevels),
_internalFormat(internalFormat),
_width(width),
_height(height),
_depth(depth),
_border(border),
_size(0) { computeSize(); }
#define LESSTHAN(A,B) if (A<B) return true; if (B<A) return false;
#define FINALLESSTHAN(A,B) return (A<B);
bool operator < (const TextureProfile& rhs) const
{
LESSTHAN(_size,rhs._size);
LESSTHAN(_target,rhs._target);
LESSTHAN(_numMipmapLevels,rhs._numMipmapLevels);
LESSTHAN(_internalFormat,rhs._internalFormat);
LESSTHAN(_width,rhs._width);
LESSTHAN(_height,rhs._height);
LESSTHAN(_depth,rhs._depth);
FINALLESSTHAN(_border, rhs._border);
}
bool operator == (const TextureProfile& rhs) const
{
return _target == rhs._target &&
_numMipmapLevels == rhs._numMipmapLevels &&
_internalFormat == rhs._internalFormat &&
_width == rhs._width &&
_height == rhs._height &&
_depth == rhs._depth &&
_border == rhs._border;
}
inline void set(GLint numMipmapLevels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border)
{
_numMipmapLevels = numMipmapLevels;
_internalFormat = internalFormat;
_width = width;
_height = height;
_depth = depth;
_border = border;
computeSize();
}
inline bool match(GLenum target,
GLint numMipmapLevels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border)
{
return (_target == target) &&
(_numMipmapLevels == numMipmapLevels) &&
(_internalFormat == internalFormat) &&
(_width == width) &&
(_height == height) &&
(_depth == depth) &&
(_border == border);
}
void computeSize();
GLenum _target;
GLint _numMipmapLevels;
GLenum _internalFormat;
GLsizei _width;
GLsizei _height;
GLsizei _depth;
GLint _border;
unsigned int _size;
};
class OSG_EXPORT TextureObject : public GraphicsObject
{
public:
inline TextureObject(Texture* texture, GLuint id, GLenum target):
_id(id),
_profile(target),
_set(0),
_previous(0),
_next(0),
_texture(texture),
_allocated(false),
_frameLastUsed(0),
_timeStamp(0) {}
inline TextureObject(Texture* texture, GLuint id, const TextureProfile& profile):
_id(id),
_profile(profile),
_set(0),
_previous(0),
_next(0),
_texture(texture),
_allocated(false),
_frameLastUsed(0),
_timeStamp(0) {}
inline TextureObject(Texture* texture,
GLuint id,
GLenum target,
GLint numMipmapLevels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border):
_id(id),
_profile(target,numMipmapLevels,internalFormat,width,height,depth,border),
_set(0),
_previous(0),
_next(0),
_texture(texture),
_allocated(false),
_frameLastUsed(0),
_timeStamp(0) {}
inline bool match(GLenum target,
GLint numMipmapLevels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border)
{
return isReusable() &&
_profile.match(target,numMipmapLevels,internalFormat,width,height,depth,border);
}
void bind();
inline GLenum id() const { return _id; }
inline GLenum target() const { return _profile._target; }
inline unsigned int size() const { return _profile._size; }
inline void setTexture(Texture* texture) { _texture = texture; }
inline Texture* getTexture() const { return _texture; }
inline void setTimeStamp(double timestamp) { _timeStamp = timestamp; }
inline double getTimeStamp() const { return _timeStamp; }
inline void setAllocated(bool allocated=true) { _allocated = allocated; }
void setAllocated(GLint numMipmapLevels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border);
inline bool isAllocated() const { return _allocated; }
inline bool isReusable() const { return _allocated && _profile._width!=0; }
void release();
GLuint _id;
TextureProfile _profile;
TextureObjectSet* _set;
TextureObject* _previous;
TextureObject* _next;
Texture* _texture;
bool _allocated;
unsigned int _frameLastUsed;
double _timeStamp;
protected:
virtual ~TextureObject();
};
typedef std::list< ref_ptr<TextureObject> > TextureObjectList;
static osg::ref_ptr<TextureObject> generateTextureObject(const Texture* texture, unsigned int contextID,GLenum target);
static osg::ref_ptr<TextureObject> generateTextureObject(const Texture* texture,
unsigned int contextID,
GLenum target,
GLint numMipmapLevels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border);
TextureObject* generateAndAssignTextureObject(unsigned int contextID, GLenum target) const;
TextureObject* generateAndAssignTextureObject(unsigned int contextID,
GLenum target,
GLint numMipmapLevels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border) const;
protected:
typedef buffered_object< ref_ptr<TextureObject> > TextureObjectBuffer;
mutable TextureObjectBuffer _textureObjectBuffer;
mutable ref_ptr<GraphicsContext> _readPBuffer;
};
class OSG_EXPORT TextureObjectSet : public Referenced
{
public:
TextureObjectSet(TextureObjectManager* parent, const Texture::TextureProfile& profile);
const Texture::TextureProfile& getProfile() const { return _profile; }
void handlePendingOrphandedTextureObjects();
void deleteAllTextureObjects();
void discardAllTextureObjects();
void flushAllDeletedTextureObjects();
void discardAllDeletedTextureObjects();
void flushDeletedTextureObjects(double currentTime, double& availableTime);
osg::ref_ptr<Texture::TextureObject> takeFromOrphans(Texture* texture);
osg::ref_ptr<Texture::TextureObject> takeOrGenerate(Texture* texture);
void moveToBack(Texture::TextureObject* to);
void addToBack(Texture::TextureObject* to);
void orphan(Texture::TextureObject* to);
void remove(Texture::TextureObject* to);
void moveToSet(Texture::TextureObject* to, TextureObjectSet* set);
unsigned int size() const { return _profile._size * _numOfTextureObjects; }
bool makeSpace(unsigned int& size);
bool checkConsistency() const;
TextureObjectManager* getParent() { return _parent; }
unsigned int computeNumTextureObjectsInList() const;
unsigned int getNumOfTextureObjects() const { return _numOfTextureObjects; }
unsigned int getNumOrphans() const { return static_cast<unsigned int>(_orphanedTextureObjects.size()); }
unsigned int getNumPendingOrphans() const { return static_cast<unsigned int>(_pendingOrphanedTextureObjects.size()); }
protected:
virtual ~TextureObjectSet();
OpenThreads::Mutex _mutex;
TextureObjectManager* _parent;
unsigned int _contextID;
Texture::TextureProfile _profile;
unsigned int _numOfTextureObjects;
Texture::TextureObjectList _orphanedTextureObjects;
Texture::TextureObjectList _pendingOrphanedTextureObjects;
Texture::TextureObject* _head;
Texture::TextureObject* _tail;
};
class OSG_EXPORT TextureObjectManager : public GraphicsObjectManager
{
public:
TextureObjectManager(unsigned int contextID);
void setNumberActiveTextureObjects(unsigned int size) { _numActiveTextureObjects = size; }
unsigned int& getNumberActiveTextureObjects() { return _numActiveTextureObjects; }
unsigned int getNumberActiveTextureObjects() const { return _numActiveTextureObjects; }
void setNumberOrphanedTextureObjects(unsigned int size) { _numOrphanedTextureObjects = size; }
unsigned int& getNumberOrphanedTextureObjects() { return _numOrphanedTextureObjects; }
unsigned int getNumberOrphanedTextureObjects() const { return _numOrphanedTextureObjects; }
void setCurrTexturePoolSize(unsigned int size) { _currTexturePoolSize = size; }
unsigned int& getCurrTexturePoolSize() { return _currTexturePoolSize; }
unsigned int getCurrTexturePoolSize() const { return _currTexturePoolSize; }
void setMaxTexturePoolSize(unsigned int size);
unsigned int getMaxTexturePoolSize() const { return _maxTexturePoolSize; }
bool hasSpace(unsigned int size) const { return (_currTexturePoolSize+size)<=_maxTexturePoolSize; }
bool makeSpace(unsigned int size);
osg::ref_ptr<Texture::TextureObject> generateTextureObject(const Texture* texture, GLenum target);
osg::ref_ptr<Texture::TextureObject> generateTextureObject(const Texture* texture,
GLenum target,
GLint numMipmapLevels,
GLenum internalFormat,
GLsizei width,
GLsizei height,
GLsizei depth,
GLint border);
void handlePendingOrphandedTextureObjects();
void deleteAllGLObjects();
void discardAllGLObjects();
void flushAllDeletedGLObjects();
void discardAllDeletedGLObjects();
void flushDeletedGLObjects(double currentTime, double& availableTime);
TextureObjectSet* getTextureObjectSet(const Texture::TextureProfile& profile);
void newFrame(osg::FrameStamp* fs);
void resetStats();
void reportStats(std::ostream& out);
void recomputeStats(std::ostream& out) const;
bool checkConsistency() const;
unsigned int& getFrameNumber() { return _frameNumber; }
unsigned int& getNumberFrames() { return _numFrames; }
unsigned int& getNumberDeleted() { return _numDeleted; }
double& getDeleteTime() { return _deleteTime; }
unsigned int& getNumberGenerated() { return _numGenerated; }
double& getGenerateTime() { return _generateTime; }
protected:
~TextureObjectManager();
typedef std::map< Texture::TextureProfile, osg::ref_ptr<TextureObjectSet> > TextureSetMap;
unsigned int _numActiveTextureObjects;
unsigned int _numOrphanedTextureObjects;
unsigned int _currTexturePoolSize;
unsigned int _maxTexturePoolSize;
TextureSetMap _textureSetMap;
unsigned int _frameNumber;
unsigned int _numFrames;
unsigned int _numDeleted;
double _deleteTime;
unsigned int _numGenerated;
double _generateTime;
};
}
#endif
GLExtensions
GraphicsContext
Image
StateAttribute
GL_CLAMP
#define GL_CLAMP
Definition Texture:170
GL_INTENSITY
#define GL_INTENSITY
Definition Texture:179
GL_CLAMP_TO_BORDER_ARB
#define GL_CLAMP_TO_BORDER_ARB
Definition Texture:174
GL_MIRRORED_REPEAT_IBM
#define GL_MIRRORED_REPEAT_IBM
Definition Texture:162
LESSTHAN
#define LESSTHAN(A, B)
Definition Texture:921
FINALLESSTHAN
#define FINALLESSTHAN(A, B)
Definition Texture:922
GL_CLAMP_TO_EDGE
#define GL_CLAMP_TO_EDGE
Definition Texture:166
Vec4
Vec4d
Vec4i
buffered_value
OpenThreads::Mutex
This class provides an object-oriented thread mutex interface.
Definition Mutex:31
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::FrameStamp
Definition FrameStamp:35
osg::GraphicsContext
Definition GraphicsContext:30
osg::GraphicsObjectManager::GraphicsObjectManager
GraphicsObjectManager(const std::string &name, unsigned int contextID)
osg::GraphicsObject::GraphicsObject
GraphicsObject()
osg::Image
Definition Image:179
osg::Object
Definition Object:61
osg::Referenced::Referenced
Referenced()
osg::StateAttribute
Definition StateAttribute:77
osg::StateAttribute::Type
Type
Definition StateAttribute:124
osg::StateAttribute::TEXTURE
@ TEXTURE
Definition StateAttribute:125
osg::StateAttribute::getModeUsage
virtual bool getModeUsage(ModeUsage &) const
Definition StateAttribute:315
osg::State
Definition State:80
osg::State::getMaxTexturePoolSize
unsigned int getMaxTexturePoolSize() const
Definition State:898
osg::TextureObjectManager
Definition Texture:1183
osg::TextureObjectManager::flushDeletedGLObjects
void flushDeletedGLObjects(double currentTime, double &availableTime)
osg::TextureObjectManager::getDeleteTime
double & getDeleteTime()
Definition Texture:1235
osg::TextureObjectManager::setCurrTexturePoolSize
void setCurrTexturePoolSize(unsigned int size)
Definition Texture:1196
osg::TextureObjectManager::flushAllDeletedGLObjects
void flushAllDeletedGLObjects()
osg::TextureObjectManager::getNumberFrames
unsigned int & getNumberFrames()
Definition Texture:1232
osg::TextureObjectManager::_deleteTime
double _deleteTime
Definition Texture:1256
osg::TextureObjectManager::generateTextureObject
osg::ref_ptr< Texture::TextureObject > generateTextureObject(const Texture *texture, GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
osg::TextureObjectManager::TextureObjectManager
TextureObjectManager(unsigned int contextID)
osg::TextureObjectManager::_maxTexturePoolSize
unsigned int _maxTexturePoolSize
Definition Texture:1249
osg::TextureObjectManager::handlePendingOrphandedTextureObjects
void handlePendingOrphandedTextureObjects()
osg::TextureObjectManager::recomputeStats
void recomputeStats(std::ostream &out) const
osg::TextureObjectManager::getNumberOrphanedTextureObjects
unsigned int & getNumberOrphanedTextureObjects()
Definition Texture:1193
osg::TextureObjectManager::_currTexturePoolSize
unsigned int _currTexturePoolSize
Definition Texture:1248
osg::TextureObjectManager::discardAllDeletedGLObjects
void discardAllDeletedGLObjects()
osg::TextureObjectManager::TextureSetMap
std::map< Texture::TextureProfile, osg::ref_ptr< TextureObjectSet > > TextureSetMap
Definition Texture:1244
osg::TextureObjectManager::_numFrames
unsigned int _numFrames
Definition Texture:1254
osg::TextureObjectManager::generateTextureObject
osg::ref_ptr< Texture::TextureObject > generateTextureObject(const Texture *texture, GLenum target)
osg::TextureObjectManager::reportStats
void reportStats(std::ostream &out)
osg::TextureObjectManager::getNumberOrphanedTextureObjects
unsigned int getNumberOrphanedTextureObjects() const
Definition Texture:1194
osg::TextureObjectManager::resetStats
void resetStats()
osg::TextureObjectManager::_numGenerated
unsigned int _numGenerated
Definition Texture:1258
osg::TextureObjectManager::getNumberDeleted
unsigned int & getNumberDeleted()
Definition Texture:1234
osg::TextureObjectManager::getCurrTexturePoolSize
unsigned int & getCurrTexturePoolSize()
Definition Texture:1197
osg::TextureObjectManager::hasSpace
bool hasSpace(unsigned int size) const
Definition Texture:1203
osg::TextureObjectManager::newFrame
void newFrame(osg::FrameStamp *fs)
osg::TextureObjectManager::~TextureObjectManager
~TextureObjectManager()
osg::TextureObjectManager::setNumberOrphanedTextureObjects
void setNumberOrphanedTextureObjects(unsigned int size)
Definition Texture:1192
osg::TextureObjectManager::getNumberGenerated
unsigned int & getNumberGenerated()
Definition Texture:1237
osg::TextureObjectManager::checkConsistency
bool checkConsistency() const
osg::TextureObjectManager::setNumberActiveTextureObjects
void setNumberActiveTextureObjects(unsigned int size)
Definition Texture:1188
osg::TextureObjectManager::setMaxTexturePoolSize
void setMaxTexturePoolSize(unsigned int size)
osg::TextureObjectManager::makeSpace
bool makeSpace(unsigned int size)
osg::TextureObjectManager::_numDeleted
unsigned int _numDeleted
Definition Texture:1255
osg::TextureObjectManager::_frameNumber
unsigned int _frameNumber
Definition Texture:1252
osg::TextureObjectManager::getNumberActiveTextureObjects
unsigned int getNumberActiveTextureObjects() const
Definition Texture:1190
osg::TextureObjectManager::_textureSetMap
TextureSetMap _textureSetMap
Definition Texture:1250
osg::TextureObjectManager::getGenerateTime
double & getGenerateTime()
Definition Texture:1238
osg::TextureObjectManager::getTextureObjectSet
TextureObjectSet * getTextureObjectSet(const Texture::TextureProfile &profile)
osg::TextureObjectManager::getMaxTexturePoolSize
unsigned int getMaxTexturePoolSize() const
Definition Texture:1201
osg::TextureObjectManager::getNumberActiveTextureObjects
unsigned int & getNumberActiveTextureObjects()
Definition Texture:1189
osg::TextureObjectManager::discardAllGLObjects
void discardAllGLObjects()
osg::TextureObjectManager::getCurrTexturePoolSize
unsigned int getCurrTexturePoolSize() const
Definition Texture:1198
osg::TextureObjectManager::_generateTime
double _generateTime
Definition Texture:1259
osg::TextureObjectManager::getFrameNumber
unsigned int & getFrameNumber()
Definition Texture:1231
osg::TextureObjectManager::_numActiveTextureObjects
unsigned int _numActiveTextureObjects
Definition Texture:1246
osg::TextureObjectManager::_numOrphanedTextureObjects
unsigned int _numOrphanedTextureObjects
Definition Texture:1247
osg::TextureObjectManager::deleteAllGLObjects
void deleteAllGLObjects()
osg::TextureObjectSet
Definition Texture:1129
osg::TextureObjectSet::discardAllTextureObjects
void discardAllTextureObjects()
osg::TextureObjectSet::getNumOfTextureObjects
unsigned int getNumOfTextureObjects() const
Definition Texture:1160
osg::TextureObjectSet::makeSpace
bool makeSpace(unsigned int &size)
osg::TextureObjectSet::_profile
Texture::TextureProfile _profile
Definition Texture:1172
osg::TextureObjectSet::_pendingOrphanedTextureObjects
Texture::TextureObjectList _pendingOrphanedTextureObjects
Definition Texture:1175
osg::TextureObjectSet::size
unsigned int size() const
Definition Texture:1151
osg::TextureObjectSet::getNumOrphans
unsigned int getNumOrphans() const
Definition Texture:1161
osg::TextureObjectSet::moveToBack
void moveToBack(Texture::TextureObject *to)
osg::TextureObjectSet::addToBack
void addToBack(Texture::TextureObject *to)
osg::TextureObjectSet::remove
void remove(Texture::TextureObject *to)
osg::TextureObjectSet::_numOfTextureObjects
unsigned int _numOfTextureObjects
Definition Texture:1173
osg::TextureObjectSet::deleteAllTextureObjects
void deleteAllTextureObjects()
osg::TextureObjectSet::handlePendingOrphandedTextureObjects
void handlePendingOrphandedTextureObjects()
osg::TextureObjectSet::_head
Texture::TextureObject * _head
Definition Texture:1177
osg::TextureObjectSet::~TextureObjectSet
virtual ~TextureObjectSet()
osg::TextureObjectSet::checkConsistency
bool checkConsistency() const
osg::TextureObjectSet::_mutex
OpenThreads::Mutex _mutex
Definition Texture:1168
osg::TextureObjectSet::_parent
TextureObjectManager * _parent
Definition Texture:1170
osg::TextureObjectSet::flushAllDeletedTextureObjects
void flushAllDeletedTextureObjects()
osg::TextureObjectSet::orphan
void orphan(Texture::TextureObject *to)
osg::TextureObjectSet::TextureObjectSet
TextureObjectSet(TextureObjectManager *parent, const Texture::TextureProfile &profile)
osg::TextureObjectSet::_contextID
unsigned int _contextID
Definition Texture:1171
osg::TextureObjectSet::takeFromOrphans
osg::ref_ptr< Texture::TextureObject > takeFromOrphans(Texture *texture)
osg::TextureObjectSet::_tail
Texture::TextureObject * _tail
Definition Texture:1178
osg::TextureObjectSet::moveToSet
void moveToSet(Texture::TextureObject *to, TextureObjectSet *set)
osg::TextureObjectSet::computeNumTextureObjectsInList
unsigned int computeNumTextureObjectsInList() const
osg::TextureObjectSet::discardAllDeletedTextureObjects
void discardAllDeletedTextureObjects()
osg::TextureObjectSet::getParent
TextureObjectManager * getParent()
Definition Texture:1157
osg::TextureObjectSet::getNumPendingOrphans
unsigned int getNumPendingOrphans() const
Definition Texture:1162
osg::TextureObjectSet::_orphanedTextureObjects
Texture::TextureObjectList _orphanedTextureObjects
Definition Texture:1174
osg::TextureObjectSet::getProfile
const Texture::TextureProfile & getProfile() const
Definition Texture:1133
osg::TextureObjectSet::takeOrGenerate
osg::ref_ptr< Texture::TextureObject > takeOrGenerate(Texture *texture)
osg::TextureObjectSet::flushDeletedTextureObjects
void flushDeletedTextureObjects(double currentTime, double &availableTime)
osg::Texture::TextureObject
Definition Texture:993
osg::Texture::TextureObject::_next
TextureObject * _next
Definition Texture:1083
osg::Texture::TextureObject::target
GLenum target() const
Definition Texture:1053
osg::Texture::TextureObject::_frameLastUsed
unsigned int _frameLastUsed
Definition Texture:1086
osg::Texture::TextureObject::TextureObject
TextureObject(Texture *texture, GLuint id, GLenum target)
Definition Texture:996
osg::Texture::TextureObject::isReusable
bool isReusable() const
Definition Texture:1074
osg::Texture::TextureObject::setAllocated
void setAllocated(bool allocated=true)
Definition Texture:1063
osg::Texture::TextureObject::_timeStamp
double _timeStamp
Definition Texture:1087
osg::Texture::TextureObject::TextureObject
TextureObject(Texture *texture, GLuint id, GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
Definition Texture:1018
osg::Texture::TextureObject::id
GLenum id() const
Definition Texture:1052
osg::Texture::TextureObject::_allocated
bool _allocated
Definition Texture:1085
osg::Texture::TextureObject::getTexture
Texture * getTexture() const
Definition Texture:1058
osg::Texture::TextureObject::_set
TextureObjectSet * _set
Definition Texture:1081
osg::Texture::TextureObject::release
void release()
osg::Texture::TextureObject::_texture
Texture * _texture
Definition Texture:1084
osg::Texture::TextureObject::size
unsigned int size() const
Definition Texture:1055
osg::Texture::TextureObject::TextureObject
TextureObject(Texture *texture, GLuint id, const TextureProfile &profile)
Definition Texture:1007
osg::Texture::TextureObject::setTexture
void setTexture(Texture *texture)
Definition Texture:1057
osg::Texture::TextureObject::setAllocated
void setAllocated(GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
osg::Texture::TextureObject::_profile
TextureProfile _profile
Definition Texture:1080
osg::Texture::TextureObject::~TextureObject
virtual ~TextureObject()
osg::Texture::TextureObject::bind
void bind()
osg::Texture::TextureObject::setTimeStamp
void setTimeStamp(double timestamp)
Definition Texture:1060
osg::Texture::TextureObject::getTimeStamp
double getTimeStamp() const
Definition Texture:1061
osg::Texture::TextureObject::_id
GLuint _id
Definition Texture:1079
osg::Texture::TextureObject::_previous
TextureObject * _previous
Definition Texture:1082
osg::Texture::TextureObject::match
bool match(GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
Definition Texture:1037
osg::Texture::TextureObject::isAllocated
bool isAllocated() const
Definition Texture:1072
osg::Texture
Definition Texture:422
osg::Texture::isCompressedInternalFormat
bool isCompressedInternalFormat() const
osg::Texture::_wrap_t
WrapMode _wrap_t
Definition Texture:861
osg::Texture::setClientStorageHint
void setClientStorageHint(bool flag)
Definition Texture:567
osg::Texture::ShadowCompareFunc
ShadowCompareFunc
Definition Texture:709
osg::Texture::LESS
@ LESS
Definition Texture:711
osg::Texture::NOTEQUAL
@ NOTEQUAL
Definition Texture:715
osg::Texture::GREATER
@ GREATER
Definition Texture:714
osg::Texture::GEQUAL
@ GEQUAL
Definition Texture:716
osg::Texture::EQUAL
@ EQUAL
Definition Texture:712
osg::Texture::ALWAYS
@ ALWAYS
Definition Texture:717
osg::Texture::NEVER
@ NEVER
Definition Texture:710
osg::Texture::LEQUAL
@ LEQUAL
Definition Texture:713
osg::Texture::getResizeNonPowerOfTwoHint
bool getResizeNonPowerOfTwoHint() const
Definition Texture:579
osg::Texture::getShadowComparison
bool getShadowComparison() const
Definition Texture:707
osg::Texture::applyTexParameters
void applyTexParameters(GLenum target, State &state) const
osg::Texture::_swizzle
Vec4i _swizzle
Definition Texture:870
osg::Texture::applyTexImage2D_load
void applyTexImage2D_load(State &state, GLenum target, const Image *image, GLsizei width, GLsizei height, GLsizei numMipmapLevels) const
osg::Texture::generateMipmap
void generateMipmap(State &state) const
osg::Texture::getBorderColor
const Vec4d & getBorderColor() const
Definition Texture:487
osg::Texture::_lodbias
float _lodbias
Definition Texture:869
osg::Texture::getTextureHeight
virtual int getTextureHeight() const
Definition Texture:458
osg::Texture::setTextureObject
void setTextureObject(unsigned int contextID, TextureObject *to)
Definition Texture:670
osg::Texture::isSafeToUnrefImageData
bool isSafeToUnrefImageData(const State &state) const
Definition Texture:834
osg::Texture::releaseGLObjects
virtual void releaseGLObjects(State *state=0) const
osg::Texture::isSameKindAs
virtual bool isSameKindAs(const osg::Object *obj) const
Definition Texture:433
osg::Texture::getUseHardwareMipMapGeneration
bool getUseHardwareMipMapGeneration() const
Definition Texture:553
osg::Texture::_borderColor
Vec4d _borderColor
Definition Texture:876
osg::Texture::getMinLOD
float getMinLOD() const
Definition Texture:528
osg::Texture::setResizeNonPowerOfTwoHint
void setResizeNonPowerOfTwoHint(bool flag)
Definition Texture:576
osg::Texture::ShadowTextureMode
ShadowTextureMode
Definition Texture:724
osg::Texture::ALPHA
@ ALPHA
Definition Texture:727
osg::Texture::LUMINANCE
@ LUMINANCE
Definition Texture:725
osg::Texture::INTENSITY
@ INTENSITY
Definition Texture:726
osg::Texture::NONE
@ NONE
Definition Texture:728
osg::Texture::_minlod
float _minlod
Definition Texture:867
osg::Texture::allocateMipmap
virtual void allocateMipmap(State &state) const =0
osg::Texture::_shadow_ambient
float _shadow_ambient
Definition Texture:888
osg::Texture::computeInternalFormat
virtual void computeInternalFormat() const =0
osg::Texture::_shadow_compare_func
ShadowCompareFunc _shadow_compare_func
Definition Texture:886
osg::Texture::setReadPBuffer
void setReadPBuffer(GraphicsContext *context)
Definition Texture:757
osg::Texture::getMaxLOD
float getMaxLOD() const
Definition Texture:534
osg::Texture::setShadowTextureMode
void setShadowTextureMode(ShadowTextureMode mode)
Definition Texture:732
osg::Texture::getShadowAmbient
float getShadowAmbient() const
Definition Texture:738
osg::Texture::setFilter
void setFilter(FilterParameter which, FilterMode filter)
osg::Texture::Texture
Texture()
osg::Texture::setUnRefImageDataAfterApply
void setUnRefImageDataAfterApply(bool flag)
Definition Texture:558
osg::Texture::generateTextureObject
static osg::ref_ptr< TextureObject > generateTextureObject(const Texture *texture, unsigned int contextID, GLenum target)
osg::Texture::compareTextureObjects
int compareTextureObjects(const Texture &rhs) const
osg::Texture::getBorderWidth
GLint getBorderWidth() const
Definition Texture:492
osg::Texture::_texMipmapGenerationDirtyList
TexParameterDirtyList _texMipmapGenerationDirtyList
Definition Texture:858
osg::Texture::_useHardwareMipMapGeneration
bool _useHardwareMipMapGeneration
Definition Texture:871
osg::Texture::setBorderWidth
void setBorderWidth(GLint width)
Definition Texture:490
osg::Texture::clone
virtual osg::Object * clone(const CopyOp &copyop) const =0
osg::Texture::setShadowCompareFunc
void setShadowCompareFunc(ShadowCompareFunc func)
Definition Texture:721
osg::Texture::dirtyTextureObject
void dirtyTextureObject()
osg::Texture::getInternalFormat
GLint getInternalFormat() const
Definition Texture:619
osg::Texture::asTexture
virtual Texture * asTexture()
Definition Texture:438
osg::Texture::TextureObjectBuffer
buffered_object< ref_ptr< TextureObject > > TextureObjectBuffer
Definition Texture:1122
osg::Texture::InternalFormatMode
InternalFormatMode
Definition Texture:581
osg::Texture::USE_S3TC_DXT1a_COMPRESSION
@ USE_S3TC_DXT1a_COMPRESSION
Definition Texture:595
osg::Texture::USE_PVRTC_2BPP_COMPRESSION
@ USE_PVRTC_2BPP_COMPRESSION
Definition Texture:588
osg::Texture::USE_PVRTC_4BPP_COMPRESSION
@ USE_PVRTC_4BPP_COMPRESSION
Definition Texture:589
osg::Texture::USE_RGTC2_COMPRESSION
@ USE_RGTC2_COMPRESSION
Definition Texture:593
osg::Texture::USE_S3TC_DXT3_COMPRESSION
@ USE_S3TC_DXT3_COMPRESSION
Definition Texture:586
osg::Texture::USE_S3TC_DXT1c_COMPRESSION
@ USE_S3TC_DXT1c_COMPRESSION
Definition Texture:594
osg::Texture::USE_USER_DEFINED_FORMAT
@ USE_USER_DEFINED_FORMAT
Definition Texture:583
osg::Texture::USE_S3TC_DXT5_COMPRESSION
@ USE_S3TC_DXT5_COMPRESSION
Definition Texture:587
osg::Texture::USE_ETC_COMPRESSION
@ USE_ETC_COMPRESSION
Definition Texture:590
osg::Texture::USE_ETC2_COMPRESSION
@ USE_ETC2_COMPRESSION
Definition Texture:591
osg::Texture::USE_S3TC_DXT1_COMPRESSION
@ USE_S3TC_DXT1_COMPRESSION
Definition Texture:585
osg::Texture::USE_ARB_COMPRESSION
@ USE_ARB_COMPRESSION
Definition Texture:584
osg::Texture::USE_RGTC1_COMPRESSION
@ USE_RGTC1_COMPRESSION
Definition Texture:592
osg::Texture::USE_IMAGE_DATA_FORMAT
@ USE_IMAGE_DATA_FORMAT
Definition Texture:582
osg::Texture::setUseHardwareMipMapGeneration
void setUseHardwareMipMapGeneration(bool useHardwareMipMapGeneration)
Definition Texture:550
osg::Texture::getFilter
FilterMode getFilter(FilterParameter which) const
osg::Texture::getClientStorageHint
bool getClientStorageHint() const
Definition Texture:570
osg::Texture::_mag_filter
FilterMode _mag_filter
Definition Texture:865
osg::Texture::getShadowTextureMode
ShadowTextureMode getShadowTextureMode() const
Definition Texture:733
osg::Texture::mipmapBeforeTexImage
GenerateMipmapMode mipmapBeforeTexImage(const State &state, bool hardwareMipmapOn) const
osg::Texture::getLODBias
float getLODBias() const
Definition Texture:540
osg::Texture::mipmapAfterTexImage
void mipmapAfterTexImage(State &state, GenerateMipmapMode beforeResult) const
osg::Texture::generateTextureObject
static osg::ref_ptr< TextureObject > generateTextureObject(const Texture *texture, unsigned int contextID, GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
osg::Texture::computeInternalFormatWithImage
void computeInternalFormatWithImage(const osg::Image &image) const
osg::Texture::_internalFormatType
InternalFormatType _internalFormatType
Definition Texture:880
osg::Texture::isTextureAttribute
virtual bool isTextureAttribute() const
Definition Texture:445
osg::Texture::setSourceFormat
void setSourceFormat(GLenum sourceFormat)
Definition Texture:625
osg::Texture::getReadPBuffer
GraphicsContext * getReadPBuffer()
Definition Texture:762
osg::Texture::_borderWidth
GLint _borderWidth
Definition Texture:877
osg::Texture::_shadow_texture_mode
ShadowTextureMode _shadow_texture_mode
Definition Texture:887
osg::Texture::TexParameterDirtyList
buffered_value< unsigned int > TexParameterDirtyList
Definition Texture:856
osg::Texture::getNumImages
virtual unsigned int getNumImages() const =0
osg::Texture::getWrap
WrapMode getWrap(WrapParameter which) const
osg::Texture::className
virtual const char * className() const
Definition Texture:435
osg::Texture::FilterMode
FilterMode
Definition Texture:499
osg::Texture::NEAREST_MIPMAP_LINEAR
@ NEAREST_MIPMAP_LINEAR
Definition Texture:504
osg::Texture::NEAREST
@ NEAREST
Definition Texture:503
osg::Texture::LINEAR_MIPMAP_NEAREST
@ LINEAR_MIPMAP_NEAREST
Definition Texture:502
osg::Texture::NEAREST_MIPMAP_NEAREST
@ NEAREST_MIPMAP_NEAREST
Definition Texture:505
osg::Texture::LINEAR
@ LINEAR
Definition Texture:500
osg::Texture::LINEAR_MIPMAP_LINEAR
@ LINEAR_MIPMAP_LINEAR
Definition Texture:501
osg::Texture::_maxAnisotropy
float _maxAnisotropy
Definition Texture:866
osg::Texture::_wrap_s
WrapMode _wrap_s
Definition Texture:860
osg::Texture::setInternalFormat
void setInternalFormat(GLint internalFormat)
Definition Texture:610
osg::Texture::getTextureWidth
virtual int getTextureWidth() const
Definition Texture:457
osg::Texture::setMinLOD
void setMinLOD(float minlod)
osg::Texture::WrapMode
WrapMode
Definition Texture:467
osg::Texture::CLAMP_TO_EDGE
@ CLAMP_TO_EDGE
Definition Texture:469
osg::Texture::CLAMP_TO_BORDER
@ CLAMP_TO_BORDER
Definition Texture:470
osg::Texture::REPEAT
@ REPEAT
Definition Texture:471
osg::Texture::CLAMP
@ CLAMP
Definition Texture:468
osg::Texture::MIRROR
@ MIRROR
Definition Texture:472
osg::Texture::_resizeNonPowerOfTwoHint
bool _resizeNonPowerOfTwoHint
Definition Texture:874
osg::Texture::_readPBuffer
ref_ptr< GraphicsContext > _readPBuffer
Definition Texture:1124
osg::Texture::getShadowCompareFunc
ShadowCompareFunc getShadowCompareFunc() const
Definition Texture:722
osg::Texture::_sourceType
GLenum _sourceType
Definition Texture:883
osg::Texture::setImage
void setImage(unsigned int face, const ref_ptr< T > &image)
Definition Texture:744
osg::Texture::_clientStorageHint
bool _clientStorageHint
Definition Texture:873
osg::Texture::_min_filter
FilterMode _min_filter
Definition Texture:864
osg::Texture::setReadPBuffer
void setReadPBuffer(const ref_ptr< T > &context)
Definition Texture:759
osg::Texture::getType
virtual Type getType() const
Definition Texture:443
osg::Texture::GenerateMipmapMode
GenerateMipmapMode
Definition Texture:805
osg::Texture::GENERATE_MIPMAP_NONE
@ GENERATE_MIPMAP_NONE
Definition Texture:806
osg::Texture::GENERATE_MIPMAP_TEX_PARAMETER
@ GENERATE_MIPMAP_TEX_PARAMETER
Definition Texture:808
osg::Texture::GENERATE_MIPMAP
@ GENERATE_MIPMAP
Definition Texture:807
osg::Texture::getTextureObject
TextureObject * getTextureObject(unsigned int contextID) const
Definition Texture:665
osg::Texture::TextureObjectList
std::list< ref_ptr< TextureObject > > TextureObjectList
Definition Texture:1094
osg::Texture::areAllTextureObjectsLoaded
bool areAllTextureObjectsLoaded() const
osg::Texture::getReadPBuffer
const GraphicsContext * getReadPBuffer() const
Definition Texture:765
osg::Texture::InternalFormatType
InternalFormatType
Definition Texture:637
osg::Texture::SIGNED_INTEGER
@ SIGNED_INTEGER
Signed integer values (see EXT_texture_integer).
Definition Texture:646
osg::Texture::UNSIGNED_INTEGER
@ UNSIGNED_INTEGER
Unsigned integer value (see EXT_texture_integer).
Definition Texture:649
osg::Texture::NORMALIZED
@ NORMALIZED
default OpenGL format (clamped values to [0,1) or [0,255])
Definition Texture:640
osg::Texture::FLOAT
@ FLOAT
float values, Shader Model 3.0 (see ARB_texture_float)
Definition Texture:643
osg::Texture::_sourceFormat
GLenum _sourceFormat
Definition Texture:882
osg::Texture::getUnRefImageDataAfterApply
bool getUnRefImageDataAfterApply() const
Definition Texture:561
osg::Texture::setMaxLOD
void setMaxLOD(float maxlod)
osg::Texture::getInternalFormatMode
InternalFormatMode getInternalFormatMode() const
Definition Texture:605
osg::Texture::setInternalFormatMode
void setInternalFormatMode(InternalFormatMode mode)
Definition Texture:602
osg::Texture::setShadowAmbient
void setShadowAmbient(float shadow_ambient)
Definition Texture:737
osg::Texture::_internalFormat
GLint _internalFormat
Definition Texture:881
osg::Texture::setBorderColor
void setBorderColor(const Vec4d &color)
Definition Texture:484
osg::Texture::isDirty
virtual bool isDirty(unsigned int) const
Definition Texture:661
osg::Texture::allocateMipmapLevels
void allocateMipmapLevels()
osg::Texture::_use_shadow_comparison
bool _use_shadow_comparison
Definition Texture:885
osg::Texture::setMaxAnisotropy
void setMaxAnisotropy(float anis)
osg::Texture::compareTexture
int compareTexture(const Texture &rhs) const
osg::Texture::getImage
virtual Image * getImage(unsigned int face)=0
osg::Texture::getTextureDepth
virtual int getTextureDepth() const
Definition Texture:459
osg::Texture::getCompressedSize
static void getCompressedSize(GLenum internalFormat, GLint width, GLint height, GLint depth, GLint &blockSize, GLint &size)
osg::Texture::_unrefImageDataAfterApply
bool _unrefImageDataAfterApply
Definition Texture:872
osg::Texture::cloneType
virtual osg::Object * cloneType() const =0
osg::Texture::selectSizedInternalFormat
GLenum selectSizedInternalFormat(const osg::Image *image=0) const
osg::Texture::setImage
virtual void setImage(unsigned int face, Image *image)=0
osg::Texture::asTexture
virtual const Texture * asTexture() const
Definition Texture:441
osg::Texture::setSwizzle
void setSwizzle(const Vec4i &swizzle)
Definition Texture:543
osg::Texture::isCompressedInternalFormat
static bool isCompressedInternalFormat(GLint internalFormat)
osg::Texture::applyTexImage2D_subload
void applyTexImage2D_subload(State &state, GLenum target, const Image *image, GLsizei width, GLsizei height, GLint inInternalFormat, GLsizei numMipmapLevels) const
osg::Texture::resizeGLObjectBuffers
virtual void resizeGLObjectBuffers(unsigned int maxSize)
osg::Texture::getSourceType
GLenum getSourceType() const
Definition Texture:634
osg::Texture::getImage
virtual const Image * getImage(unsigned int face) const =0
osg::Texture::getInternalFormatType
InternalFormatType getInternalFormatType() const
Definition Texture:653
osg::Texture::setSourceType
void setSourceType(GLenum sourceType)
Definition Texture:631
osg::Texture::_maxlod
float _maxlod
Definition Texture:868
osg::Texture::_textureObjectBuffer
TextureObjectBuffer _textureObjectBuffer
Definition Texture:1123
osg::Texture::libraryName
virtual const char * libraryName() const
Definition Texture:434
osg::Texture::getSourceFormat
GLenum getSourceFormat() const
Definition Texture:628
osg::Texture::getTextureTarget
virtual GLenum getTextureTarget() const =0
osg::Texture::WrapParameter
WrapParameter
Definition Texture:461
osg::Texture::WRAP_S
@ WRAP_S
Definition Texture:462
osg::Texture::WRAP_T
@ WRAP_T
Definition Texture:463
osg::Texture::WRAP_R
@ WRAP_R
Definition Texture:464
osg::Texture::compileGLObjects
virtual void compileGLObjects(State &state) const
osg::Texture::getMaxAnisotropy
float getMaxAnisotropy() const
Definition Texture:522
osg::Texture::FilterParameter
FilterParameter
Definition Texture:494
osg::Texture::MAG_FILTER
@ MAG_FILTER
Definition Texture:496
osg::Texture::MIN_FILTER
@ MIN_FILTER
Definition Texture:495
osg::Texture::isHardwareMipmapGenerationEnabled
bool isHardwareMipmapGenerationEnabled(const State &state) const
osg::Texture::setLODBias
void setLODBias(float lodbias)
osg::Texture::_wrap_r
WrapMode _wrap_r
Definition Texture:862
osg::Texture::apply
virtual void apply(State &state) const =0
osg::Texture::computeInternalFormatType
void computeInternalFormatType() const
osg::Texture::~Texture
virtual ~Texture()
osg::Texture::_internalFormatMode
InternalFormatMode _internalFormatMode
Definition Texture:879
osg::Texture::computeRequiredTextureDimensions
void computeRequiredTextureDimensions(State &state, const osg::Image &image, GLsizei &width, GLsizei &height, GLsizei &numMipmapLevels) const
osg::Texture::Texture
Texture(const Texture &text, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
osg::Texture::_texParametersDirtyList
TexParameterDirtyList _texParametersDirtyList
Definition Texture:857
osg::Texture::setShadowComparison
void setShadowComparison(bool flag)
Definition Texture:706
osg::Texture::dirtyTextureParameters
void dirtyTextureParameters()
osg::Texture::getTextureParameterDirty
unsigned int & getTextureParameterDirty(unsigned int contextID) const
Definition Texture:685
osg::Texture::getSwizzle
const Vec4i & getSwizzle() const
Definition Texture:546
osg::Texture::generateAndAssignTextureObject
TextureObject * generateAndAssignTextureObject(unsigned int contextID, GLenum target) const
osg::Texture::generateAndAssignTextureObject
TextureObject * generateAndAssignTextureObject(unsigned int contextID, GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border) const
osg::Texture::setWrap
void setWrap(WrapParameter which, WrapMode wrap)
osg::Vec4d
Definition Vec4d:29
osg::Vec4i
Definition Vec4i:22
osg::buffered_object
Definition buffered_value:79
osg::buffered_value
Definition buffered_value:27
osg::ref_ptr
Definition ref_ptr:32
osg::ref_ptr::get
T * get() const
Definition ref_ptr:117
osg
Definition AlphaFunc:19
NULL
#define NULL
Definition osg/Export:55
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39
ref_ptr
osg::StateAttribute::ModeUsage
Definition StateAttribute:308
osg::StateAttribute::ModeUsage::usesTextureMode
virtual void usesTextureMode(GLMode mode)=0
osg::Texture::TextureProfile
Definition Texture:893
osg::Texture::TextureProfile::_depth
GLsizei _depth
Definition Texture:987
osg::Texture::TextureProfile::_target
GLenum _target
Definition Texture:982
osg::Texture::TextureProfile::TextureProfile
TextureProfile(GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
Definition Texture:904
osg::Texture::TextureProfile::_height
GLsizei _height
Definition Texture:986
osg::Texture::TextureProfile::_size
unsigned int _size
Definition Texture:989
osg::Texture::TextureProfile::_width
GLsizei _width
Definition Texture:985
osg::Texture::TextureProfile::match
bool match(GLenum target, GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
Definition Texture:963
osg::Texture::TextureProfile::TextureProfile
TextureProfile(GLenum target)
Definition Texture:894
osg::Texture::TextureProfile::_numMipmapLevels
GLint _numMipmapLevels
Definition Texture:983
osg::Texture::TextureProfile::_internalFormat
GLenum _internalFormat
Definition Texture:984
osg::Texture::TextureProfile::_border
GLint _border
Definition Texture:988
osg::Texture::TextureProfile::set
void set(GLint numMipmapLevels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border)
Definition Texture:947
osg::Texture::TextureProfile::computeSize
void computeSize()