# osg::TextureCubeMap Class Reference

TextureCubeMap state class which encapsulates OpenGL texture cubemap functionality. More...

Inheritance diagram for osg::TextureCubeMap:

[legend]
List of all members.

## 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 &copyop=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 bool | getModeUsage (ModeUsage &usage) const
| Return the modes associated with this StateAttribute.
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 & | getModifiedTag (unsigned int face, unsigned int contextID) const
void | setTextureSize (int width, int height) const
| Set the texture width and height.
void | getTextureSize (int &width, int &height) const
| Get the texture subload width.
void | setSubloadCallback (SubloadCallback *cb)
SubloadCallback * | getSubloadCallback ()
const SubloadCallback * | getSubloadCallback () const
void | setNumMipmapLevels (unsigned int num) const
| Set the number of mip map levels the the texture has been created with.
unsigned int | getNumMipmapLevels () const
| Get the number of mip map levels the the texture has been created with.
virtual void | apply (State &state) const
| On first apply (unless already compiled), create the mipmapped texture and bind it.

## Static Public Member Functions

static Extensions * | getExtensions (unsigned int contextID, bool createIfNotInitalized)
| Function to call to get the extension of a specified context.
static void | setExtensions (unsigned int contextID, Extensions *extensions)
| The setExtensions method allows users to override the extensions across graphics contexts.

## Protected Types

typedef buffered_value< unsigned int > | ImageModifiedTag

## Protected Member Functions

virtual | ~TextureCubeMap ()
bool | imagesValid () const
virtual void | computeInternalFormat () const

## Protected Attributes

ref_ptr< Image > | _images [6]
GLsizei | _textureWidth
GLsizei | _textureHeight
GLsizei | _numMipmapLevels
ref_ptr< SubloadCallback > | _subloadCallback
ImageModifiedTag | _modifiedTag [6]

## Classes

class | Extensions
| Extensions class which encapsulates the querying of extensions and associated function pointers, and provides convinience wrappers to check for the extensions or use the associated functions. More...
class | SubloadCallback

## Detailed Description

TextureCubeMap state class which encapsulates OpenGL texture cubemap functionality.

## Member Typedef Documentation

typedef buffered_value<unsigned int> osg::TextureCubeMap::ImageModifiedTag `[protected]`

## Member Enumeration Documentation

enum osg::TextureCubeMap::Face

Enumeration values:

  POSITIVE_X |
  NEGATIVE_X |
  POSITIVE_Y |
  NEGATIVE_Y |
  POSITIVE_Z |
  NEGATIVE_Z |

## Constructor & Destructor Documentation

TextureCubeMap::TextureCubeMap | ( |  | ) |

TextureCubeMap::TextureCubeMap | ( | const TextureCubeMap & | cm,
|  | const CopyOp & | copyop = `CopyOp::SHALLOW_COPY`
| ) |

| Copy constructor using CopyOp to manage deep vs shallow copy.

TextureCubeMap::~TextureCubeMap | ( |  | ) | `[protected, virtual]`

## Member Function Documentation

void 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.

int TextureCubeMap::compare | ( | const StateAttribute & | rhs | ) | const`[virtual]`

| Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. Implements osg::StateAttribute.

void TextureCubeMap::computeInternalFormat | ( |  | ) | const`[protected, virtual]`

| Implements osg::Texture.

TextureCubeMap::Extensions * TextureCubeMap::getExtensions | ( | unsigned int | contextID,
|  | bool | createIfNotInitalized
| ) | `[static]`

Function to call to get the extension of a specified context.

If the Exentsion 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.

const Image * TextureCubeMap::getImage | ( | unsigned int | face | ) | const`[virtual]`

| Get the const texture image for specified face. Implements osg::Texture.

Image * TextureCubeMap::getImage | ( | unsigned int | face | ) | `[virtual]`

| Get the texture image for specified face. Implements osg::Texture.

virtual bool osg::TextureCubeMap::getModeUsage | ( | ModeUsage & | usage | ) | const`[inline, virtual]`

| Return the modes associated with this StateAttribute. Reimplemented from osg::StateAttribute.

unsigned int& osg::TextureCubeMap::getModifiedTag | ( | 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 the texture has been created with.

const SubloadCallback* osg::TextureCubeMap::getSubloadCallback | ( |  | ) | const`[inline]`

SubloadCallback* osg::TextureCubeMap::getSubloadCallback | ( |  | ) | `[inline]`

void osg::TextureCubeMap::getTextureSize | ( | int & | width,
|  | int & | height
| ) | const`[inline]`

| Get the texture subload width.

bool TextureCubeMap::imagesValid | ( |  | ) | const`[protected]`

osg::TextureCubeMap::META_StateAttribute | ( | osg | ,
|  | TextureCubeMap | ,
|  | TEXTURE |
| ) |

void TextureCubeMap::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.

void 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 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::setTextureSize | ( | int | width,
|  | int | height
| ) | const`[inline]`

| Set the texture width and height. If width or height are zero then the repsective size value is calculated from the source image sizes.

## Member Data Documentation

ref_ptr<Image> osg::TextureCubeMap::_images[6]`[protected]`

ImageModifiedTag osg::TextureCubeMap::_modifiedTag[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]`

The documentation for this class was generated from the following files:

- TextureCubeMap
- TextureCubeMap.cpp