#include <freecloth/gfx/gfxGLTexture.h>
Inheritance diagram for GfxGLTexture:
Public Types | |
typedef RCShdPtr< GfxImage > | ImagePtr |
Public Member Functions | |
GfxGLTexture (const ImagePtr &image, Int32 format) | |
UInt32 | getTextureId () const |
GePoint | getCorner () const |
void | bind () const |
void | generateMipmaps () |
UInt32 | getOriginalWidth () const |
Get width of texture image prior to power-of-2 related padding. | |
UInt32 | getOriginalHeight () const |
Get height of texture image prior to power-of-2 related padding. | |
Float | getOriginalAspectRatio () const |
Get aspect ratio prior to power-of-2 related padding. | |
const GfxImage & | getImage () const |
Get actual image used for texture. | |
Static Public Member Functions | |
RCShdPtr< GfxImage > | makePow2 (const GfxImage &) |
Private Member Functions | |
GfxGLTexture (const GfxGLTexture &) | |
Disallowed. | |
GfxGLTexture & | operator= (const GfxGLTexture &) |
Disallowed. | |
Private Attributes | |
ImagePtr | _image |
UInt32 | _textureId |
Int32 | _format |
UInt32 | _originalWidth |
UInt32 | _originalHeight |
Image is padded to a power-of-2 size, as required by OpenGL.
Definition at line 50 of file gfxGLTexture.h.
|
Get position of top-right corner of image in texture co-ordinates. If the input image is a large enough power-of-2 size, this will always be (1,1). Otherwise, the image is padded with zeros to a power-of-2 size, and the top-right corner will have a (u,v) position somewhere between (.5,.5) and (1,1) Definition at line 115 of file gfxGLTexture.cpp. |
|
Embeds input image in a larger image whose size is a power of two. Keep in mind that texture co-ordinates need to take into account the new image size. Definition at line 147 of file gfxGLTexture.cpp. References GfxImage::getFormat(), GfxImage::getHeight(), GfxImage::getNbComponents(), GfxImage::getRawData(), and GfxImage::getWidth(). |