OpenSceneGraph
3.4.0
|
TextureCubeMap state class which encapsulates OpenGL texture cubemap functionality. More...
Classes | |
class | SubloadCallback |
Public Types | |
enum | Face { POSITIVE_X = 0, NEGATIVE_X = 1, POSITIVE_Y = 2, NEGATIVE_Y = 3, POSITIVE_Z = 4, NEGATIVE_Z = 5 } |
Public Member Functions | |
TextureCubeMap () | |
TextureCubeMap (const TextureCubeMap &cm, const CopyOp ©op=CopyOp::SHALLOW_COPY) | |
Copy constructor using CopyOp to manage deep vs shallow copy. | |
META_StateAttribute (osg, TextureCubeMap, TEXTURE) | |
virtual int | compare (const StateAttribute &rhs) const |
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. | |
virtual GLenum | getTextureTarget () const |
virtual void | setImage (unsigned int face, Image *image) |
Set the texture image for specified face. | |
virtual Image * | getImage (unsigned int face) |
Get the texture image for specified face. | |
virtual const Image * | getImage (unsigned int face) const |
Get the const texture image for specified face. | |
virtual unsigned int | getNumImages () const |
Get the number of images that can be assigned to the Texture. | |
unsigned int & | getModifiedCount (unsigned int face, unsigned int contextID) const |
void | setTextureSize (int width, int height) const |
Set the texture width and height. | |
void | setTextureWidth (int width) |
void | setTextureHeight (int height) |
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 |
Set the number of mip map levels the texture has been created with. | |
unsigned int | getNumMipmapLevels () const |
Get the number of mip map levels the texture has been created with. | |
void | copyTexSubImageCubeMap (State &state, int face, int xoffset, int yoffset, int x, int y, int width, int height) |
Copies a two-dimensional texture subimage, as per glCopyTexSubImage2D. | |
virtual void | apply (State &state) const |
On first apply (unless already compiled), create the mipmapped texture and bind it. | |
Protected Types | |
typedef buffered_value < unsigned int > | ImageModifiedCount |
Protected Member Functions | |
virtual | ~TextureCubeMap () |
bool | imagesValid () const |
virtual void | computeInternalFormat () const |
void | allocateMipmap (State &state) const |
Allocate mipmap levels of the texture by subsequent calling of glTexImage* function. | |
Protected Attributes | |
ref_ptr< Image > | _images [6] |
GLsizei | _textureWidth |
GLsizei | _textureHeight |
GLsizei | _numMipmapLevels |
ref_ptr< SubloadCallback > | _subloadCallback |
ImageModifiedCount | _modifiedCount [6] |
TextureCubeMap state class which encapsulates OpenGL texture cubemap functionality.
typedef buffered_value<unsigned int> osg::TextureCubeMap::ImageModifiedCount [protected] |
osg::TextureCubeMap::TextureCubeMap | ( | const TextureCubeMap & | cm, |
const CopyOp & | copyop = CopyOp::SHALLOW_COPY |
||
) |
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual osg::TextureCubeMap::~TextureCubeMap | ( | ) | [protected, virtual] |
void osg::TextureCubeMap::allocateMipmap | ( | State & | state | ) | const [protected, virtual] |
Allocate mipmap levels of the texture by subsequent calling of glTexImage* function.
Implements osg::Texture.
virtual void osg::TextureCubeMap::apply | ( | State & | state | ) | const [virtual] |
On first apply (unless already compiled), create the mipmapped texture and bind it.
Subsequent apply will simple bind to texture.
Implements osg::Texture.
virtual int osg::TextureCubeMap::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::TextureCubeMap::computeInternalFormat | ( | ) | const [protected, virtual] |
Implements osg::Texture.
void osg::TextureCubeMap::copyTexSubImageCubeMap | ( | State & | state, |
int | face, | ||
int | xoffset, | ||
int | yoffset, | ||
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
Copies a two-dimensional texture subimage, as per glCopyTexSubImage2D.
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. width and height must be powers of two.
virtual Image* osg::TextureCubeMap::getImage | ( | unsigned int | face | ) | [virtual] |
Get the texture image for specified face.
Implements osg::Texture.
virtual const Image* osg::TextureCubeMap::getImage | ( | unsigned int | face | ) | const [virtual] |
Get the const texture image for specified face.
Implements osg::Texture.
unsigned int& osg::TextureCubeMap::getModifiedCount | ( | unsigned int | face, |
unsigned int | contextID | ||
) | const [inline] |
virtual unsigned int osg::TextureCubeMap::getNumImages | ( | ) | const [inline, virtual] |
Get the number of images that can be assigned to the Texture.
Implements osg::Texture.
unsigned int osg::TextureCubeMap::getNumMipmapLevels | ( | ) | const [inline] |
Get the number of mip map levels the texture has been created with.
SubloadCallback* osg::TextureCubeMap::getSubloadCallback | ( | ) | [inline] |
const SubloadCallback* osg::TextureCubeMap::getSubloadCallback | ( | ) | const [inline] |
virtual int osg::TextureCubeMap::getTextureDepth | ( | ) | const [inline, virtual] |
Reimplemented from osg::Texture.
virtual int osg::TextureCubeMap::getTextureHeight | ( | ) | const [inline, virtual] |
Reimplemented from osg::Texture.
virtual GLenum osg::TextureCubeMap::getTextureTarget | ( | ) | const [inline, virtual] |
Implements osg::Texture.
References GL_TEXTURE_CUBE_MAP.
virtual int osg::TextureCubeMap::getTextureWidth | ( | ) | const [inline, virtual] |
Reimplemented from osg::Texture.
bool osg::TextureCubeMap::imagesValid | ( | ) | const [protected] |
virtual void osg::TextureCubeMap::setImage | ( | unsigned int | face, |
Image * | image | ||
) | [virtual] |
Set the texture image for specified face.
Implements osg::Texture.
void osg::TextureCubeMap::setNumMipmapLevels | ( | unsigned int | num | ) | const [inline] |
Set the number of mip map levels the texture has been created with.
Should only be called within an osg::Texuture::apply() and custom OpenGL texture load.
void osg::TextureCubeMap::setSubloadCallback | ( | SubloadCallback * | cb | ) | [inline] |
void osg::TextureCubeMap::setTextureHeight | ( | int | height | ) | [inline] |
void osg::TextureCubeMap::setTextureSize | ( | int | width, |
int | height | ||
) | const [inline] |
Set the texture width and height.
If width or height are zero then the respective size value is calculated from the source image sizes.
void osg::TextureCubeMap::setTextureWidth | ( | int | width | ) | [inline] |
ref_ptr<Image> osg::TextureCubeMap::_images[6] [protected] |
ImageModifiedCount osg::TextureCubeMap::_modifiedCount[6] [mutable, protected] |
GLsizei osg::TextureCubeMap::_numMipmapLevels [mutable, protected] |
ref_ptr<SubloadCallback> osg::TextureCubeMap::_subloadCallback [protected] |
GLsizei osg::TextureCubeMap::_textureHeight [mutable, protected] |
GLsizei osg::TextureCubeMap::_textureWidth [mutable, protected] |
![]() | Generated at Tue Dec 8 2015 00:16:44 for the OpenSceneGraph by doxygen 1.7.6.1. |