14#ifndef OSG_TEXTURE2DARRAY
15#define OSG_TEXTURE2DARRAY 1
67 virtual bool isDirty(
unsigned int contextID)
const
69 for(
unsigned int i=0; i<
_images.size(); ++i)
77 inline unsigned int&
getModifiedCount(
unsigned int layer,
unsigned int contextID)
const
147 typedef std::vector< ref_ptr<Image> >
Images;
#define GL_TEXTURE_2D_ARRAY
Definition GLDefines:634
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
Definition StateAttribute:308
const SubloadCallback * getSubloadCallback() const
Definition Texture2DArray:109
virtual bool getModeUsage(StateAttribute::ModeUsage &) const
Texture2DArray is related to non fixed pipeline usage only so isn't appropriate to enable/disable.
Definition Texture2DArray:46
virtual int compare(const StateAttribute &rhs) const
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
void setTextureWidth(int width)
Definition Texture2DArray:89
virtual int getTextureDepth() const
Definition Texture2DArray:95
GLsizei _textureWidth
Definition Texture2DArray:151
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 Texture2DArray:67
virtual ~Texture2DArray()
void setTextureSize(int width, int height, int depth)
Set the texture width and height.
void setImage(unsigned int layer, const ref_ptr< T > &image)
Definition Texture2DArray:51
virtual void apply(State &state) const
Bind the texture if already compiled.
virtual void setImage(unsigned int layer, Image *image)
Set the texture image for specified layer.
void setNumMipmapLevels(unsigned int num) const
Set the number of mip map levels the texture has been created with.
Definition Texture2DArray:116
virtual Image * getImage(unsigned int layer)
Get the texture image for specified layer.
Texture2DArray(const Texture2DArray &cm, const CopyOp ©op=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual void computeInternalFormat() const
std::vector< ImageModifiedCount > _modifiedCount
Definition Texture2DArray:159
void copyTexSubImage2DArray(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.
virtual unsigned int getNumImages() const
Get the number of images that are assigned to the Texture.
Definition Texture2DArray:64
virtual GLenum getTextureTarget() const
Definition Texture2DArray:43
void setSubloadCallback(SubloadCallback *cb)
Definition Texture2DArray:105
GLsizei _textureHeight
Definition Texture2DArray:151
std::vector< ref_ptr< Image > > Images
Definition Texture2DArray:147
void applyTexImage2DArray_subload(State &state, Image *image, GLsizei layer, GLsizei inwidth, GLsizei inheight, GLsizei indepth, GLint inInternalFormat, GLsizei &numMipmapLevels) const
unsigned int & getModifiedCount(unsigned int layer, unsigned int contextID) const
Check how often was a certain layer in the given context modified.
Definition Texture2DArray:77
virtual const Image * getImage(unsigned int layer) const
Get the const texture image for specified layer.
void allocateMipmap(State &state) const
Allocate mipmap levels of the texture by subsequent calling of glTexImage* function.
virtual int getTextureHeight() const
Definition Texture2DArray:94
ref_ptr< SubloadCallback > _subloadCallback
Definition Texture2DArray:156
Images _images
Definition Texture2DArray:148
GLsizei _textureDepth
Definition Texture2DArray:151
SubloadCallback * getSubloadCallback()
Definition Texture2DArray:107
virtual int getTextureWidth() const
Definition Texture2DArray:93
unsigned int getNumMipmapLevels() const
Get the number of mip map levels the texture has been created with.
Definition Texture2DArray:119
META_StateAttribute(osg, Texture2DArray, TEXTURE)
void setTextureDepth(int depth)
GLsizei computeTextureDepth() const
GLsizei _numMipmapLevels
Definition Texture2DArray:154
void setTextureHeight(int height)
Definition Texture2DArray:90
buffered_value< unsigned int > ImageModifiedCount
Definition Texture2DArray:158
Definition Texture2DArray:98
virtual void load(const Texture2DArray &texture, State &state) const =0
virtual void subload(const Texture2DArray &texture, State &state) const =0
#define OSG_EXPORT
Definition Export:39