OpenSceneGraph
3.0.1
|
Encapsulates OpenGL 1D texture functionality. More...
Classes | |
class | SubloadCallback |
Public Member Functions | |
Texture1D () | |
Texture1D (Image *image) | |
Texture1D (const Texture1D &text, const CopyOp ©op=CopyOp::SHALLOW_COPY) | |
Copy constructor using CopyOp to manage deep vs shallow copy. | |
META_StateAttribute (osg, Texture1D, 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) |
Sets the texture image. | |
Image * | getImage () |
Gets the texture image. | |
const Image * | getImage () const |
Gets the const texture image. | |
unsigned int & | getModifiedCount (unsigned int contextID) const |
virtual void | setImage (unsigned int, Image *image) |
Sets the texture image, ignoring face. | |
virtual Image * | getImage (unsigned int) |
Gets the texture image, ignoring face. | |
virtual const Image * | getImage (unsigned int) const |
Gets the const texture image, ignoring face. | |
virtual unsigned int | getNumImages () const |
Gets the number of images that can be assigned to the Texture. | |
void | setTextureWidth (int width) |
Sets the texture width. | |
virtual int | getTextureWidth () const |
Gets the texture width. | |
virtual int | getTextureHeight () const |
virtual int | getTextureDepth () const |
void | setSubloadCallback (SubloadCallback *cb) |
SubloadCallback * | getSubloadCallback () |
const SubloadCallback * | getSubloadCallback () const |
void | setNumMipmapLevels (unsigned int num) const |
Helper function. | |
unsigned int | getNumMipmapLevels () const |
Gets the number of mipmap levels created. | |
void | copyTexImage1D (State &state, int x, int y, int width) |
Copies pixels into a 1D texture image, as per glCopyTexImage1D. | |
void | copyTexSubImage1D (State &state, int xoffset, int x, int y, int width) |
Copies a one-dimensional texture subimage, as per glCopyTexSubImage1D. | |
virtual void | apply (State &state) const |
Bind the texture object. | |
Protected Types | |
typedef buffered_value < unsigned int > | ImageModifiedCount |
Protected Member Functions | |
virtual | ~Texture1D () |
virtual void | computeInternalFormat () const |
void | allocateMipmap (State &state) const |
Allocate mipmap levels of the texture by subsequent calling of glTexImage* function. | |
void | applyTexImage1D (GLenum target, Image *image, State &state, GLsizei &width, GLsizei &numMipmapLevels) const |
Helper method. | |
Protected Attributes | |
ref_ptr< Image > | _image |
It's not ideal that _image is mutable, but it's required since Image::ensureDimensionsArePowerOfTwo() can only be called in a valid OpenGL context, and therefore within Texture::apply, which is const. | |
GLsizei | _textureWidth |
Subloaded images can have different texture and image sizes. | |
GLsizei | _numMipmapLevels |
Number of mipmap levels created. | |
ref_ptr< SubloadCallback > | _subloadCallback |
ImageModifiedCount | _modifiedCount |
Encapsulates OpenGL 1D texture functionality.
Doesn't support cube maps, so ignore face parameters.
typedef buffered_value<unsigned int> osg::Texture1D::ImageModifiedCount [protected] |
osg::Texture1D::Texture1D | ( | ) |
osg::Texture1D::Texture1D | ( | Image * | image | ) |
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual osg::Texture1D::~Texture1D | ( | ) | [protected, virtual] |
void osg::Texture1D::allocateMipmap | ( | State & | state | ) | const [protected, virtual] |
Allocate mipmap levels of the texture by subsequent calling of glTexImage* function.
Implements osg::Texture.
virtual void osg::Texture1D::apply | ( | State & | state | ) | const [virtual] |
Bind the texture object.
If the texture object hasn't already been compiled, create the texture mipmap levels.
Implements osg::Texture.
void osg::Texture1D::applyTexImage1D | ( | GLenum | target, |
Image * | image, | ||
State & | state, | ||
GLsizei & | width, | ||
GLsizei & | numMipmapLevels | ||
) | const [protected] |
Helper method.
Create the texture without setting or using a texture binding.
virtual int osg::Texture1D::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::Texture1D::computeInternalFormat | ( | ) | const [protected, virtual] |
Implements osg::Texture.
void osg::Texture1D::copyTexImage1D | ( | State & | state, |
int | x, | ||
int | y, | ||
int | width | ||
) |
Copies pixels into a 1D texture image, as per glCopyTexImage1D.
Creates an OpenGL texture object from the current OpenGL background framebuffer contents at position x, y with width width. width must be a power of two.
void osg::Texture1D::copyTexSubImage1D | ( | State & | state, |
int | xoffset, | ||
int | x, | ||
int | y, | ||
int | width | ||
) |
Copies a one-dimensional texture subimage, as per glCopyTexSubImage1D.
Updates a portion of an existing OpenGL texture object from the current OpenGL background framebuffer contents at position x, y with width width.
Image* osg::Texture1D::getImage | ( | ) | [inline] |
Gets the texture image.
const Image* osg::Texture1D::getImage | ( | ) | const [inline] |
Gets the const texture image.
virtual Image* osg::Texture1D::getImage | ( | unsigned int | ) | [inline, virtual] |
Gets the texture image, ignoring face.
Implements osg::Texture.
virtual const Image* osg::Texture1D::getImage | ( | unsigned int | ) | const [inline, virtual] |
Gets the const texture image, ignoring face.
Implements osg::Texture.
unsigned int& osg::Texture1D::getModifiedCount | ( | unsigned int | contextID | ) | const [inline] |
virtual unsigned int osg::Texture1D::getNumImages | ( | ) | const [inline, virtual] |
Gets the number of images that can be assigned to the Texture.
Implements osg::Texture.
unsigned int osg::Texture1D::getNumMipmapLevels | ( | ) | const [inline] |
Gets the number of mipmap levels created.
SubloadCallback* osg::Texture1D::getSubloadCallback | ( | ) | [inline] |
const SubloadCallback* osg::Texture1D::getSubloadCallback | ( | ) | const [inline] |
virtual int osg::Texture1D::getTextureDepth | ( | ) | const [inline, virtual] |
Reimplemented from osg::Texture.
virtual int osg::Texture1D::getTextureHeight | ( | ) | const [inline, virtual] |
Reimplemented from osg::Texture.
virtual GLenum osg::Texture1D::getTextureTarget | ( | ) | const [inline, virtual] |
Implements osg::Texture.
References GL_TEXTURE_1D.
virtual int osg::Texture1D::getTextureWidth | ( | ) | const [inline, virtual] |
Gets the texture width.
Reimplemented from osg::Texture.
osg::Texture1D::META_StateAttribute | ( | osg | , |
Texture1D | , | ||
TEXTURE | |||
) |
void osg::Texture1D::setImage | ( | Image * | image | ) |
Sets the texture image.
virtual void osg::Texture1D::setImage | ( | unsigned int | , |
Image * | image | ||
) | [inline, virtual] |
Sets the texture image, ignoring face.
Implements osg::Texture.
References setImage().
Referenced by setImage().
void osg::Texture1D::setNumMipmapLevels | ( | unsigned int | num | ) | const [inline] |
Helper function.
Sets the number of mipmap levels created for this texture. Should only be called within an osg::Texture::apply(), or during a custom OpenGL texture load.
void osg::Texture1D::setSubloadCallback | ( | SubloadCallback * | cb | ) | [inline] |
void osg::Texture1D::setTextureWidth | ( | int | width | ) | [inline] |
Sets the texture width.
If width is zero, calculate the value from the source image width.
ref_ptr<Image> osg::Texture1D::_image [mutable, protected] |
It's not ideal that _image is mutable, but it's required since Image::ensureDimensionsArePowerOfTwo() can only be called in a valid OpenGL context, and therefore within Texture::apply, which is const.
ImageModifiedCount osg::Texture1D::_modifiedCount [mutable, protected] |
GLsizei osg::Texture1D::_numMipmapLevels [mutable, protected] |
Number of mipmap levels created.
ref_ptr<SubloadCallback> osg::Texture1D::_subloadCallback [protected] |
GLsizei osg::Texture1D::_textureWidth [mutable, protected] |
Subloaded images can have different texture and image sizes.
![]() | Generated at Mon Oct 3 2011 12:39:44 for the OpenSceneGraph by doxygen 1.7.5. |