GG: GG::SubTexture Class Reference

GG

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

List of all members
GG::SubTexture Class Reference

`#include <Texture.h>`

## Structors
| SubTexture ()
| SubTexture (const boost::shared_ptr< const Texture > &texture, X x1, Y y1, X x2, Y y2)
| SubTexture (const SubTexture &rhs)
const SubTexture & | operator= (const SubTexture &rhs)
virtual | ~SubTexture ()

## Accessors
bool | Empty () const
const GLfloat * | TexCoords () const
X | Width () const
Y | Height () const
const Texture * | GetTexture () 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 171 of file Texture.h.

## Constructor & Destructor Documentation

GG::SubTexture::SubTexture | ( | const boost::shared_ptr< const Texture > & | texture,
|  | X | x1,
|  | Y | y1,
|  | X | x2,
|  | Y | 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.

## Member Function Documentation

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:

- Texture.h