openscenegraph
|
Classes | |
class | Extensions |
class | SubloadCallback |
Public Member Functions | |
Texture2DArray () | |
Texture2DArray (const Texture2DArray &cm, const CopyOp ©op=CopyOp::SHALLOW_COPY) | |
META_StateAttribute (osg, Texture2DArray, TEXTURE) | |
virtual int | compare (const StateAttribute &rhs) const |
virtual GLenum | getTextureTarget () const |
virtual void | setImage (unsigned int layer, Image *image) |
virtual Image * | getImage (unsigned int layer) |
virtual const Image * | getImage (unsigned int layer) const |
virtual unsigned int | getNumImages () const |
unsigned int & | getModifiedCount (unsigned int layer, unsigned int contextID) const |
void | setTextureSize (int width, int height, int depth) |
void | setTextureWidth (int width) |
void | setTextureHeight (int height) |
void | setTextureDepth (int depth) |
virtual int | getTextureWidth () const |
virtual int | getTextureHeight () const |
virtual int | getTextureDepth () const |
void | setSubloadCallback (SubloadCallback *cb) |
SubloadCallback * | getSubloadCallback () |
const SubloadCallback * | getSubloadCallback () const |
void | setNumMipmapLevels (unsigned int num) const |
unsigned int | getNumMipmapLevels () const |
void | copyTexSubImage2DArray (State &state, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height) |
virtual void | apply (State &state) const |
Static Public Member Functions | |
static Extensions * | getExtensions (unsigned int contextID, bool createIfNotInitalized) |
static void | setExtensions (unsigned int contextID, Extensions *extensions) |
Protected Types | |
typedef buffered_value < unsigned int > | ImageModifiedCount |
Protected Member Functions | |
virtual | ~Texture2DArray () |
bool | imagesValid () const |
virtual void | computeInternalFormat () const |
void | allocateMipmap (State &state) const |
void | applyTexImage2DArray_subload (State &state, Image *image, GLsizei inwidth, GLsizei inheight, GLsizei indepth, GLint inInternalFormat, GLsizei &numMipmapLevels) const |
Protected Attributes | |
std::vector< ref_ptr< Image > > | _images |
GLsizei | _textureWidth |
GLsizei | _textureHeight |
GLsizei | _textureDepth |
GLsizei | _numMipmapLevels |
ref_ptr< SubloadCallback > | _subloadCallback |
std::vector< ImageModifiedCount > | _modifiedCount |
Texture2DArray state class which encapsulates OpenGL 2D array texture functionality. Texture arrays were introduced with Shader Model 4.0 hardware.
A 2D texture array does contain textures sharing the same properties (e.g. size, bitdepth,...) in a layered structure. See http://www.opengl.org/registry/specs/EXT/texture_array.txt for more info.
typedef buffered_value<unsigned int> osg::Texture2DArray::ImageModifiedCount [protected] |
osg::Texture2DArray::Texture2DArray | ( | const Texture2DArray & | cm, |
const CopyOp & | copyop = CopyOp::SHALLOW_COPY |
||
) |
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual osg::Texture2DArray::~Texture2DArray | ( | ) | [protected, virtual] |
void osg::Texture2DArray::allocateMipmap | ( | State & | state | ) | const [protected, virtual] |
Allocate mipmap levels of the texture by subsequent calling of glTexImage* function.
Implements osg::Texture.
virtual void osg::Texture2DArray::apply | ( | State & | state | ) | const [virtual] |
Bind the texture if already compiled. Otherwise recompile.
Implements osg::Texture.
void osg::Texture2DArray::applyTexImage2DArray_subload | ( | State & | state, |
Image * | image, | ||
GLsizei | inwidth, | ||
GLsizei | inheight, | ||
GLsizei | indepth, | ||
GLint | inInternalFormat, | ||
GLsizei & | numMipmapLevels | ||
) | const [protected] |
virtual int osg::Texture2DArray::compare | ( | const StateAttribute & | rhs | ) | const [virtual] |
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Implements osg::StateAttribute.
virtual void osg::Texture2DArray::computeInternalFormat | ( | ) | const [protected, virtual] |
Implements osg::Texture.
void osg::Texture2DArray::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. Updates a portion of an existing OpenGL texture object from the current OpenGL background framebuffer contents at position x, y with width width and height height. Loads framebuffer data into the texture using offsets xoffset and yoffset. zoffset specifies the layer of the texture array to which the result is copied.
static Extensions* osg::Texture2DArray::getExtensions | ( | unsigned int | contextID, |
bool | createIfNotInitalized | ||
) | [static] |
Function to call to get the extension of a specified context. If the Extension object for that context has not yet been created and the 'createIfNotInitalized' flag been set to false then returns NULL. If 'createIfNotInitalized' is true then the Extensions object is automatically created. However, in this case the extension object will only be created with the graphics context associated with ContextID.
Reimplemented from osg::Texture.
virtual Image* osg::Texture2DArray::getImage | ( | unsigned int | layer | ) | [virtual] |
Get the texture image for specified layer.
Implements osg::Texture.
virtual const Image* osg::Texture2DArray::getImage | ( | unsigned int | layer | ) | const [virtual] |
Get the const texture image for specified layer.
Implements osg::Texture.
unsigned int& osg::Texture2DArray::getModifiedCount | ( | unsigned int | layer, |
unsigned int | contextID | ||
) | const [inline] |
Check how often was a certain layer in the given context modified
virtual unsigned int osg::Texture2DArray::getNumImages | ( | ) | const [inline, virtual] |
Get the number of images that are assigned to the Texture. The number is equal to the texture depth. To get the maximum possible image/layer count, you have to use the extension subclass, since it provides graphic context dependent information.
Implements osg::Texture.
unsigned int osg::Texture2DArray::getNumMipmapLevels | ( | ) | const [inline] |
Get the number of mip map levels the the texture has been created with.
SubloadCallback* osg::Texture2DArray::getSubloadCallback | ( | ) | [inline] |
const SubloadCallback* osg::Texture2DArray::getSubloadCallback | ( | ) | const [inline] |
virtual int osg::Texture2DArray::getTextureDepth | ( | ) | const [inline, virtual] |
Reimplemented from osg::Texture.
virtual int osg::Texture2DArray::getTextureHeight | ( | ) | const [inline, virtual] |
Reimplemented from osg::Texture.
virtual GLenum osg::Texture2DArray::getTextureTarget | ( | ) | const [inline, virtual] |
Implements osg::Texture.
References GL_TEXTURE_2D_ARRAY_EXT.
virtual int osg::Texture2DArray::getTextureWidth | ( | ) | const [inline, virtual] |
Reimplemented from osg::Texture.
bool osg::Texture2DArray::imagesValid | ( | ) | const [protected] |
static void osg::Texture2DArray::setExtensions | ( | unsigned int | contextID, |
Extensions * | extensions | ||
) | [static] |
The setExtensions method allows users to override the extensions across graphics contexts. Typically used when you have different extensions supported across graphics pipes but need to ensure that they all use the same low common denominator extensions.
Reimplemented from osg::Texture.
virtual void osg::Texture2DArray::setImage | ( | unsigned int | layer, |
Image * | image | ||
) | [virtual] |
Set the texture image for specified layer.
Implements osg::Texture.
void osg::Texture2DArray::setNumMipmapLevels | ( | unsigned int | num | ) | const [inline] |
Set the number of mip map levels the the texture has been created with. Should only be called within an osg::Texture::apply() and custom OpenGL texture load.
void osg::Texture2DArray::setSubloadCallback | ( | SubloadCallback * | cb | ) | [inline] |
void osg::Texture2DArray::setTextureDepth | ( | int | depth | ) |
void osg::Texture2DArray::setTextureHeight | ( | int | height | ) | [inline] |
void osg::Texture2DArray::setTextureSize | ( | int | width, |
int | height, | ||
int | depth | ||
) |
Set the texture width and height. If width or height are zero then the respective size value is calculated from the source image sizes. Depth parameter specifies the number of layers to be used.
void osg::Texture2DArray::setTextureWidth | ( | int | width | ) | [inline] |
std::vector<ref_ptr<Image> > osg::Texture2DArray::_images [protected] |
Use std::vector to encapsulate referenced pointers to images of different layers. Vectors gives us a random access iterator. The overhead of non-used elements is negligible
std::vector<ImageModifiedCount> osg::Texture2DArray::_modifiedCount [mutable, protected] |
GLsizei osg::Texture2DArray::_numMipmapLevels [mutable, protected] |
ref_ptr<SubloadCallback> osg::Texture2DArray::_subloadCallback [protected] |
GLsizei osg::Texture2DArray::_textureDepth [mutable, protected] |
GLsizei osg::Texture2DArray::_textureHeight [mutable, protected] |
GLsizei osg::Texture2DArray::_textureWidth [mutable, protected] |