Public Member Functions | |
TextureRectangle () | |
TextureRectangle (Image *image) | |
TextureRectangle (const TextureRectangle &text, const CopyOp ©op=CopyOp::SHALLOW_COPY) | |
Copy constructor using CopyOp to manage deep vs shallow copy. | |
META_StateAttribute (osg, TextureRectangle, 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 |
void | setImage (Image *image) |
Set the texture image. | |
Image * | getImage () |
Get the texture image. | |
const Image * | getImage () const |
Get the const texture image. | |
unsigned int & | getModifiedCount (unsigned int contextID) const |
virtual void | setImage (unsigned int, Image *image) |
Set the texture image, ignoring face value as there is only one image. | |
virtual Image * | getImage (unsigned int) |
Get the texture image, ignoring face value as there is only one image. | |
virtual const Image * | getImage (unsigned int) const |
Get the const texture image, ignoring face value as there is only one image. | |
virtual unsigned int | getNumImages () const |
Get the number of images that can be assigned to the Texture. | |
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 | copyTexImage2D (State &state, int x, int y, int width, int height) |
Copies pixels into a 2D texture image, as per glCopyTexImage2D. | |
void | copyTexSubImage2D (State &state, 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 and bind the texture, subsequent apply will simply bind to texture. | |
Protected Types | |
typedef buffered_value < unsigned int > | ImageModifiedCount |
Protected Member Functions | |
virtual | ~TextureRectangle () |
virtual void | computeInternalFormat () const |
void | allocateMipmap (State &state) const |
Allocate mipmap levels of the texture by subsequent calling of glTexImage* function. | |
void | applyTexParameters (GLenum target, State &state) const |
Helper method. | |
void | applyTexImage_load (GLenum target, Image *image, State &state, GLsizei &inwidth, GLsizei &inheight) const |
void | applyTexImage_subload (GLenum target, Image *image, State &state, GLsizei &inwidth, GLsizei &inheight, GLint &inInternalFormat) const |
Protected Attributes | |
ref_ptr< Image > | _image |
GLsizei | _textureWidth |
GLsizei | _textureHeight |
ref_ptr < SubloadCallback > | _subloadCallback |
ImageModifiedCount | _modifiedCount |
Classes | |
class | SubloadCallback |
typedef buffered_value<unsigned int> osg::TextureRectangle::ImageModifiedCount [protected] |
osg::TextureRectangle::TextureRectangle | ( | ) |
osg::TextureRectangle::TextureRectangle | ( | Image * | image | ) |
osg::TextureRectangle::TextureRectangle | ( | const TextureRectangle & | text, | |
const CopyOp & | copyop = CopyOp::SHALLOW_COPY | |||
) |
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual osg::TextureRectangle::~TextureRectangle | ( | ) | [protected, virtual] |
osg::TextureRectangle::META_StateAttribute | ( | osg | , | |
TextureRectangle | , | |||
TEXTURE | ||||
) |
virtual int osg::TextureRectangle::compare | ( | const StateAttribute & | rhs | ) | const [virtual] |
virtual GLenum osg::TextureRectangle::getTextureTarget | ( | ) | const [inline, virtual] |
Implements osg::Texture.
void osg::TextureRectangle::setImage | ( | Image * | image | ) |
Set the texture image.
Image* osg::TextureRectangle::getImage | ( | ) | [inline] |
Get the texture image.
const Image* osg::TextureRectangle::getImage | ( | ) | const [inline] |
Get the const texture image.
unsigned int& osg::TextureRectangle::getModifiedCount | ( | unsigned int | contextID | ) | const [inline] |
virtual void osg::TextureRectangle::setImage | ( | unsigned int | , | |
Image * | image | |||
) | [inline, virtual] |
virtual Image* osg::TextureRectangle::getImage | ( | unsigned int | ) | [inline, virtual] |
virtual const Image* osg::TextureRectangle::getImage | ( | unsigned int | ) | const [inline, virtual] |
Get the const texture image, ignoring face value as there is only one image.
Implements osg::Texture.
virtual unsigned int osg::TextureRectangle::getNumImages | ( | ) | const [inline, virtual] |
void osg::TextureRectangle::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.
void osg::TextureRectangle::setTextureWidth | ( | int | width | ) | [inline] |
void osg::TextureRectangle::setTextureHeight | ( | int | height | ) | [inline] |
virtual int osg::TextureRectangle::getTextureWidth | ( | ) | const [inline, virtual] |
Reimplemented from osg::Texture.
virtual int osg::TextureRectangle::getTextureHeight | ( | ) | const [inline, virtual] |
Reimplemented from osg::Texture.
virtual int osg::TextureRectangle::getTextureDepth | ( | ) | const [inline, virtual] |
Reimplemented from osg::Texture.
void osg::TextureRectangle::setSubloadCallback | ( | SubloadCallback * | cb | ) | [inline] |
SubloadCallback* osg::TextureRectangle::getSubloadCallback | ( | ) | [inline] |
const SubloadCallback* osg::TextureRectangle::getSubloadCallback | ( | ) | const [inline] |
void osg::TextureRectangle::copyTexImage2D | ( | State & | state, | |
int | x, | |||
int | y, | |||
int | width, | |||
int | height | |||
) |
Copies pixels into a 2D texture image, as per glCopyTexImage2D.
Creates an OpenGL texture object from the current OpenGL background framebuffer contents at position x, y with width width and height height. width and height must be a power of two.
void osg::TextureRectangle::copyTexSubImage2D | ( | State & | state, | |
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 void osg::TextureRectangle::apply | ( | State & | state | ) | const [virtual] |
On first apply (unless already compiled), create and bind the texture, subsequent apply will simply bind to texture.
Implements osg::Texture.
virtual void osg::TextureRectangle::computeInternalFormat | ( | ) | const [protected, virtual] |
Implements osg::Texture.
void osg::TextureRectangle::allocateMipmap | ( | State & | state | ) | const [protected, virtual] |
Allocate mipmap levels of the texture by subsequent calling of glTexImage* function.
Implements osg::Texture.
void osg::TextureRectangle::applyTexParameters | ( | GLenum | target, | |
State & | state | |||
) | const [protected] |
void osg::TextureRectangle::applyTexImage_load | ( | GLenum | target, | |
Image * | image, | |||
State & | state, | |||
GLsizei & | inwidth, | |||
GLsizei & | inheight | |||
) | const [protected] |
void osg::TextureRectangle::applyTexImage_subload | ( | GLenum | target, | |
Image * | image, | |||
State & | state, | |||
GLsizei & | inwidth, | |||
GLsizei & | inheight, | |||
GLint & | inInternalFormat | |||
) | const [protected] |
ref_ptr<Image> osg::TextureRectangle::_image [mutable, protected] |
GLsizei osg::TextureRectangle::_textureWidth [mutable, protected] |
GLsizei osg::TextureRectangle::_textureHeight [mutable, protected] |
ImageModifiedCount osg::TextureRectangle::_modifiedCount [mutable, protected] |