15#define OSG_TEXTURE3D 1
159 void applyTexImage3D(GLenum target,
Image* image,
State& state, GLsizei& inwidth, GLsizei& inheight, GLsizei& indepth, GLsizei& numMipmapLevels)
const;
#define GL_TEXTURE_3D
Definition Texture:188
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Implements a simple buffered value for values that need to be buffered on a per graphics context basi...
Definition buffered_value:27
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Image class for encapsulating the storage texture image data.
Definition Image:179
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
T * get() const
Definition ref_ptr:117
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Base class for state attributes.
Definition StateAttribute:77
@ TEXTURE
Definition StateAttribute:125
void setImage(Image *image)
Sets the texture image.
SubloadCallback * getSubloadCallback()
Definition Texture3D:122
unsigned int getNumMipmapLevels() const
Gets the number of mipmap levels created.
Definition Texture3D:133
virtual int getTextureHeight() const
Definition Texture3D:109
virtual bool isDirty(unsigned int contextID) const
return true if the texture image data has been modified and the associated GL texture object needs to...
Definition Texture3D:65
void setTextureDepth(int depth)
Definition Texture3D:106
const SubloadCallback * getSubloadCallback() const
Definition Texture3D:124
GLsizei _textureDepth
Definition Texture3D:168
void setTextureSize(int width, int height, int depth) const
Sets the texture width, height, and depth.
Definition Texture3D:89
void setImage(const ref_ptr< T > &image)
Definition Texture3D:56
ImageModifiedCount _modifiedCount
Definition Texture3D:176
ref_ptr< SubloadCallback > _subloadCallback
Definition Texture3D:173
const Image * getImage() const
Gets the const texture image.
Definition Texture3D:62
virtual const Image * getImage(unsigned int) const
Gets the const texture image, ignoring face.
Definition Texture3D:80
GLsizei _textureWidth
Subloaded images can have different texture and image sizes.
Definition Texture3D:168
void applyTexImage3D(GLenum target, Image *image, State &state, GLsizei &inwidth, GLsizei &inheight, GLsizei &indepth, GLsizei &numMipmapLevels) const
virtual void computeInternalFormat() const
GLsizei _numMipmapLevels
Number of mip map levels the texture has been created with,.
Definition Texture3D:171
buffered_value< unsigned int > ImageModifiedCount
Definition Texture3D:175
void getTextureSize(int &width, int &height, int &depth) const
Gets the texture subload width.
Definition Texture3D:97
void setTextureHeight(int height)
Definition Texture3D:105
META_StateAttribute(osg, Texture3D, TEXTURE)
unsigned int & getModifiedCount(unsigned int contextID) const
Definition Texture3D:67
void setNumMipmapLevels(unsigned int num) const
Helper function.
Definition Texture3D:130
void setTextureWidth(int width)
Definition Texture3D:104
virtual GLenum getTextureTarget() const
Definition Texture3D:51
virtual int getTextureWidth() const
Definition Texture3D:108
void copyTexSubImage3D(State &state, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height)
Copies a two-dimensional texture subimage, as per glCopyTexSubImage3D.
ref_ptr< Image > _image
It's not ideal that _image is mutable, but it's required since Image::ensureDimensionsArePowerOfTwo()...
Definition Texture3D:165
virtual int getTextureDepth() const
Definition Texture3D:110
virtual int compare(const StateAttribute &rhs) const
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Texture3D(const Texture3D &text, const CopyOp ©op=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
void allocateMipmap(State &state) const
Allocate mipmap levels of the texture by subsequent calling of glTexImage* function.
virtual Image * getImage(unsigned int)
Gets the texture image, ignoring face.
Definition Texture3D:77
virtual unsigned int getNumImages() const
Gets the number of images that can be assigned to the Texture.
Definition Texture3D:83
virtual void setImage(unsigned int, Image *image)
Sets the texture image, ignoring face.
Definition Texture3D:74
virtual void apply(State &state) const
Bind the texture object.
void computeRequiredTextureDimensions(State &state, const osg::Image &image, GLsizei &width, GLsizei &height, GLsizei &depth, GLsizei &numMipmapLevels) const
void setSubloadCallback(SubloadCallback *cb)
Definition Texture3D:120
GLsizei _textureHeight
Definition Texture3D:168
Image * getImage()
Gets the texture image.
Definition Texture3D:59
Texture3D(const osg::ref_ptr< T > &image)
Definition Texture3D:34
virtual void load(const Texture3D &texture, State &state) const =0
virtual void subload(const Texture3D &texture, State &state) const =0
#define OSG_EXPORT
Definition Export:39