Annchienta::Surface Class Reference

Inherits Annchienta::Cacheable.

Inherited by SwigDirector_Surface.

List of all members.

Public Member Functions

void draw (int x1, int y1, int x2, int y2) const
void draw (int dx, int dy, int sx1, int sy1, int sx2, int sy2) const
void draw (int x, int y) const
float getBottomTexCoord () const
virtual CacheableType getCacheableType () const
int getGlHeight () const
int getGlWidth () const
int getHeight () const
float getLeftTexCoord () const
float getRightTexCoord () const
GLuint getTexture () const
float getTopTexCoord () const
int getWidth () const
void setLinearScaling () const
void setNearestScaling () const
 Surface (const char *filename)
 Surface (int width, int height, int pixelSize=3)
virtual ~Surface ()

Private Member Functions

void compileList ()
void generateTextureFromPixels ()

Private Attributes

float bottomTexCoord
int glHeight
int glWidth
int height
float leftTexCoord
GLuint list
GLubyte * pixels
int pixelSize
float rightTexCoord
GLuint texture
float topTexCoord
int width


Detailed Description

Holds Surfaces, so mostly images.

Constructor & Destructor Documentation

Annchienta::Surface::Surface ( int  width,
int  height,
int  pixelSize = 3 
)

Construct a new empty instance.

Parameters:
width Width of the new Surface.
height Height of the new Surface.
pixelSize Number of bytes per pixel. Use 3 for RGB and 4 for RGBA.

Annchienta::Surface::Surface ( const char *  filename  ) 

Load an image into a surface.

Parameters:
filename Valid PNG file.

virtual Annchienta::Surface::~Surface (  )  [virtual]


Member Function Documentation

void Annchienta::Surface::compileList (  )  [private]

void Annchienta::Surface::draw ( int  x1,
int  y1,
int  x2,
int  y2 
) const

Draws the surface, stretched to rectangle on the screen.

Note:
Use VideoManager.drawSurface() instead.

Not available in Python.

void Annchienta::Surface::draw ( int  dx,
int  dy,
int  sx1,
int  sy1,
int  sx2,
int  sy2 
) const

Draws a part of the surface to the given position.

Note:
Use VideoManager.drawSurface() instead.

Not available in Python.

void Annchienta::Surface::draw ( int  x,
int  y 
) const

Draws the surface at the given position. This method is slightly faster than the other draw() methods because it makes use of display lists.

Note:
Use VideoManager.drawSurface() instead.

Not available in Python.

void Annchienta::Surface::generateTextureFromPixels (  )  [private]

float Annchienta::Surface::getBottomTexCoord (  )  const

Returns:
Bottom Texture Coordinate of the image on the OpenGL texture.
Note:
Not available in Python.

virtual CacheableType Annchienta::Surface::getCacheableType (  )  const [virtual]

Returns:
SurfaceCacheable

Reimplemented from Annchienta::Cacheable.

Reimplemented in SwigDirector_Surface.

int Annchienta::Surface::getGlHeight (  )  const

Returns:
The actual height of the OpenGL texture, so a power of two.
Note:
Not available in Python.

int Annchienta::Surface::getGlWidth (  )  const

Returns:
The actual width of the OpenGL texture, so a power of two.
Note:
Not available in Python.

int Annchienta::Surface::getHeight (  )  const

Returns:
The Surface height.

float Annchienta::Surface::getLeftTexCoord (  )  const

Returns:
Left Texture Coordinate of the image on the OpenGL texture.
Note:
Not available in Python.

float Annchienta::Surface::getRightTexCoord (  )  const

Returns:
Right Texture Coordinate of the image on the OpenGL texture.
Note:
Not available in Python.

GLuint Annchienta::Surface::getTexture (  )  const

Returns:
The actual OpenGL texture.
Note:
Not available in Python.

float Annchienta::Surface::getTopTexCoord (  )  const

Returns:
Top Texture Coordinate of the image on the OpenGL texture.
Note:
Not available in Python.

int Annchienta::Surface::getWidth (  )  const

Returns:
The Surface width.

void Annchienta::Surface::setLinearScaling (  )  const

Set OpenGL scaling mode to Linear for this surface.

void Annchienta::Surface::setNearestScaling (  )  const

Set OpenGL scaling mode to Nearest. This is the default behaviour.


Member Data Documentation

GLuint Annchienta::Surface::list [private]

GLubyte* Annchienta::Surface::pixels [private]

GLuint Annchienta::Surface::texture [private]


Generated on Wed Feb 4 16:31:47 2009 for Annchienta by  doxygen 1.5.7.1