Main Page   Class Hierarchy   Compound List   File List   Compound Members  

GfxGLTexture Class Reference

Wrapper around an image and handle allocation of graphics RAM. More...

#include <freecloth/gfx/gfxGLTexture.h>

Inheritance diagram for GfxGLTexture:

Inheritance graph
[legend]
Collaboration diagram for GfxGLTexture:

Collaboration graph
[legend]
List of all members.

Public Types

typedef RCShdPtr< GfxImageImagePtr

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 GfxImagegetImage () const
 Get actual image used for texture.


Static Public Member Functions

RCShdPtr< GfxImagemakePow2 (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

Detailed Description

Wrapper around an image and handle allocation of graphics RAM.

Image is padded to a power-of-2 size, as required by OpenGL.

Definition at line 50 of file gfxGLTexture.h.


Member Function Documentation

GePoint GfxGLTexture::getCorner   const
 

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.

RCShdPtr< GfxImage > GfxGLTexture::makePow2 const GfxImage   [static]
 

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().


The documentation for this class was generated from the following files:
Generated on Wed Apr 23 15:58:56 2003 for Freecloth by doxygen1.3-rc3