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 Methods

 GfxGLTexture (const ImagePtr &image, Int32 format)
virtual ~GfxGLTexture ()
UInt32 getTextureId () const
GePoint 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).

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 Methods

RCShdPtr< GfxImagemakePow2 (const GfxImage &)
 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.


Private Methods

 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.


The documentation for this class was generated from the following files:
Generated on Fri May 2 16:51:23 2003 for Freecloth by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002