List of all members.
Classes |
class | SubloadCallback |
Public Member Functions |
| Texture2D () |
| Texture2D (Image *image) |
| Texture2D (const Texture2D &text, const CopyOp ©op=CopyOp::SHALLOW_COPY) |
| META_StateAttribute (osg, Texture2D, TEXTURE) |
virtual int | compare (const StateAttribute &rhs) const |
virtual GLenum | getTextureTarget () const |
void | setImage (Image *image) |
Image * | getImage () |
const Image * | getImage () const |
unsigned int & | getModifiedCount (unsigned int contextID) const |
virtual void | setImage (unsigned int, Image *image) |
virtual Image * | getImage (unsigned int) |
virtual const Image * | getImage (unsigned int) const |
virtual unsigned int | getNumImages () const |
void | setTextureSize (int width, int height) const |
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 |
unsigned int | getNumMipmapLevels () const |
void | copyTexImage2D (State &state, int x, int y, int width, int height) |
void | copyTexSubImage2D (State &state, int xoffset, int yoffset, int x, int y, int width, int height) |
virtual void | apply (State &state) const |
Protected Types |
typedef buffered_value
< unsigned int > | ImageModifiedCount |
Protected Member Functions |
virtual | ~Texture2D () |
virtual void | computeInternalFormat () const |
void | allocateMipmap (State &state) const |
Protected Attributes |
ref_ptr< Image > | _image |
GLsizei | _textureWidth |
GLsizei | _textureHeight |
GLsizei | _numMipmapLevels |
ref_ptr< SubloadCallback > | _subloadCallback |
ImageModifiedCount | _modifiedCount |
Detailed Description
Encapsulates OpenGl 2D texture functionality. Doesn't support cube maps, so ignore face parameters.
Member Typedef Documentation
Constructor & Destructor Documentation
osg::Texture2D::Texture2D |
( |
) |
|
osg::Texture2D::Texture2D |
( |
Image * |
image ) |
|
osg::Texture2D::Texture2D |
( |
const Texture2D & |
text, |
|
|
const CopyOp & |
copyop = CopyOp::SHALLOW_COPY |
|
) |
| |
Copy constructor using CopyOp to manage deep vs shallow copy.
virtual osg::Texture2D::~Texture2D |
( |
) |
[protected, virtual] |
Member Function Documentation
void osg::Texture2D::allocateMipmap |
( |
State & |
state ) |
const [protected, virtual] |
Allocate mipmap levels of the texture by subsequent calling of glTexImage* function.
Implements osg::Texture.
virtual void osg::Texture2D::apply |
( |
State & |
state ) |
const [virtual] |
virtual int osg::Texture2D::compare |
( |
const StateAttribute & |
rhs ) |
const [virtual] |
virtual void osg::Texture2D::computeInternalFormat |
( |
) |
const [protected, virtual] |
void osg::Texture2D::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::Texture2D::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 Image* osg::Texture2D::getImage |
( |
unsigned int |
) |
[inline, virtual] |
Gets the texture image, ignoring face.
Implements osg::Texture.
Image* osg::Texture2D::getImage |
( |
) |
[inline] |
virtual const Image* osg::Texture2D::getImage |
( |
unsigned int |
) |
const [inline, virtual] |
Gets the const texture image, ignoring face.
Implements osg::Texture.
const Image* osg::Texture2D::getImage |
( |
) |
const [inline] |
Gets the const texture image.
unsigned int& osg::Texture2D::getModifiedCount |
( |
unsigned int |
contextID ) |
const [inline] |
virtual unsigned int osg::Texture2D::getNumImages |
( |
) |
const [inline, virtual] |
unsigned int osg::Texture2D::getNumMipmapLevels |
( |
) |
const [inline] |
Gets the number of mipmap levels created.
const SubloadCallback* osg::Texture2D::getSubloadCallback |
( |
) |
const [inline] |
virtual int osg::Texture2D::getTextureDepth |
( |
) |
const [inline, virtual] |
virtual int osg::Texture2D::getTextureHeight |
( |
) |
const [inline, virtual] |
virtual GLenum osg::Texture2D::getTextureTarget |
( |
) |
const [inline, virtual] |
virtual int osg::Texture2D::getTextureWidth |
( |
) |
const [inline, virtual] |
osg::Texture2D::META_StateAttribute |
( |
osg |
, |
|
|
Texture2D |
, |
|
|
TEXTURE |
|
|
) |
| |
void osg::Texture2D::setImage |
( |
Image * |
image ) |
|
virtual void osg::Texture2D::setImage |
( |
unsigned int |
, |
|
|
Image * |
image |
|
) |
| [inline, virtual] |
void osg::Texture2D::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::Texture2D::setTextureHeight |
( |
int |
height ) |
[inline] |
void osg::Texture2D::setTextureSize |
( |
int |
width, |
|
|
int |
height |
|
) |
| const [inline] |
Sets the texture width and height. If width or height are zero, calculate the respective value from the source image size.
void osg::Texture2D::setTextureWidth |
( |
int |
width ) |
[inline] |
Member Data Documentation
Number of mipmap levels created.
Subloaded images can have different texture and image sizes.
The documentation for this class was generated from the following file: