GG::SubTexture Class Reference

This class is a convenient way to store the info needed to use a portion of an OpenGL texture. More...

#include <Texture.h>

List of all members.

Structors

 SubTexture ()
 SubTexture (const boost::shared_ptr< const Texture > &texture, int x1, int y1, int x2, int y2)
 SubTexture (const SubTexture &rhs)
const SubTextureoperator= (const SubTexture &rhs)
virtual ~SubTexture ()

Accessors

bool Empty () const
const GLfloat * TexCoords () const
GLint Width () const
GLint Height () const
const TextureGetTexture () const
void OrthoBlit (const Pt &pt1, const Pt &pt2) const
void OrthoBlit (const Pt &pt) const

Exceptions

 GG_ABSTRACT_EXCEPTION (Exception)
 GG_CONCRETE_EXCEPTION (BadTexture, GG::SubTexture, Exception)
 GG_CONCRETE_EXCEPTION (InvalidTextureCoordinates, GG::SubTexture, Exception)


Detailed Description

This class is a convenient way to store the info needed to use a portion of an OpenGL texture.

Definition at line 149 of file Texture.h.


Constructor & Destructor Documentation

GG::SubTexture::SubTexture (  ) 

default ctor

GG::SubTexture::SubTexture ( const boost::shared_ptr< const Texture > &  texture,
int  x1,
int  y1,
int  x2,
int  y2 
)

creates a SubTexture from a GG::Texture and coordinates into it.

Exceptions:
GG::SubTexture::BadTexture Throws if the given Texture is null.
GG::SubTexture::InvalidTextureCoordinates Throws if the texture coordinates are not well formed.

GG::SubTexture::SubTexture ( const SubTexture rhs  ) 

copy ctor

virtual GG::SubTexture::~SubTexture (  )  [virtual]

virtual dtor


Member Function Documentation

const SubTexture& GG::SubTexture::operator= ( const SubTexture rhs  ) 

assignment operator

bool GG::SubTexture::Empty (  )  const

returns true if this object has no associated GG::Texture

const GLfloat* GG::SubTexture::TexCoords (  )  const

texture coordinates to use when blitting this sub-texture

GLint GG::SubTexture::Width (  )  const

width of sub-texture in pixels

GLint GG::SubTexture::Height (  )  const

height of sub-texture in pixels

const Texture* GG::SubTexture::GetTexture (  )  const

returns the texture the SubTexture is a part of

void GG::SubTexture::OrthoBlit ( const Pt pt1,
const Pt pt2 
) const

blit sub-texture to any place on screen, scaling as necessary

See also:
GG::Texture::OrthoBlit

void GG::SubTexture::OrthoBlit ( const Pt pt  )  const

blit sub-texture unscaled to pt (upper left corner)

See also:
GG::Texture::OrthoBlit

GG::SubTexture::GG_ABSTRACT_EXCEPTION ( Exception   ) 

The base class for SubTexture exceptions.

GG::SubTexture::GG_CONCRETE_EXCEPTION ( BadTexture  ,
GG::SubTexture  ,
Exception   
)

Thrown when an attempt is made to create a SubTexture using a null texture.

GG::SubTexture::GG_CONCRETE_EXCEPTION ( InvalidTextureCoordinates  ,
GG::SubTexture  ,
Exception   
)

Thrown when invalid or out-of-order texture coordinates are supplied.


The documentation for this class was generated from the following file:
Generated on Wed Mar 26 14:35:42 2008 for GG by  doxygen 1.5.2