FIFE  2008.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
FIFE::GLImage Class Reference

#include <glimage.h>

Inheritance diagram for FIFE::GLImage:
Inheritance graph
Collaboration diagram for FIFE::GLImage:
Collaboration graph

Public Member Functions

virtual void invalidate ()
 
virtual void setSurface (SDL_Surface *surface)
 
virtual void render (const Rect &rect, uint8_t alpha=255, uint8_t const *rgb=0)
 
virtual void useSharedImage (const ImagePtr &shared, const Rect &region)
 
virtual void forceLoadInternal ()
 
virtual void copySubimage (uint32_t xoffset, uint32_t yoffset, const ImagePtr &img)
 
- Public Member Functions inherited from FIFE::Image
 Image (IResourceLoader *loader=0)
 
 Image (SDL_Surface *surface)
 
 Image (const uint8_t *data, uint32_t width, uint32_t height)
 
virtual ~Image ()
 
SDL_Surface * detachSurface ()
 
void saveImage (const std::string &filename)
 
bool isSharedImage () const
 
const RectgetSubImageRect () const
 

Additional Inherited Members

- Static Public Member Functions inherited from FIFE::Image
static void saveAsPng (const std::string &filename, const SDL_Surface &surface)
 
- Protected Member Functions inherited from FIFE::Image
void reset (SDL_Surface *surface)
 

Detailed Description

Implements an Image using OpenGL.

This class contains a texture handle bound to the data given to the constructor; it draws a textured Quad to the screen.

See also
Image
Note
Width and height are not limited to powers of two; non-power of two images will be converted internally if they are not supported by the hardware (GLEE_ARB_texture_non_power_of_two).
Todo:
Check the correctness of the generateTexture function on big endian systems (ppc)

Definition at line 53 of file glimage.h.

Member Function Documentation

void FIFE::GLImage::copySubimage ( uint32_t  xoffset,
uint32_t  yoffset,
const ImagePtr img 
)
virtual

Copies given image into this one with respect to given offsets

Reimplemented from FIFE::Image.

Definition at line 371 of file glimage.cpp.

References FIFE::Image::copySubimage().

void FIFE::GLImage::forceLoadInternal ( )
virtual

Forces to load the image into internal memory of GPU

Implements FIFE::Image.

Definition at line 346 of file glimage.cpp.

void FIFE::GLImage::invalidate ( )
virtual

Invalidates the Image causing it to be reset or re-loaded

Implements FIFE::Image.

Definition at line 94 of file glimage.cpp.

void FIFE::GLImage::render ( const Rect rect,
uint8_t  alpha = 255,
uint8_t const *  rgb = 0 
)
virtual

Renders itself to the current render target (main screen or attached destination image) at the rectangle rect. Convenience function

Parameters
rectThe position and clipping where to draw this image to.
alphaThe alpha value, with which to draw self.
rgbThe color value of overlay if any.

Implements FIFE::Image.

Definition at line 125 of file glimage.cpp.

References FIFE::RenderBackend::addImageToArray(), FIFE::RectType< T >::bottom(), FIFE::RenderBackend::getRenderTargetSurface(), FIFE::RectType< T >::right(), FIFE::RectType< T >::x, and FIFE::RectType< T >::y.

void FIFE::GLImage::setSurface ( SDL_Surface *  surface)
virtual

This frees the current suface and replaces it with the surface passed in the parameter (which can be NULL).

See also
Image::reset(SDL_Surface* surface)
Parameters
surfacethe SDL_Surface to use for this image

Implements FIFE::Image.

Definition at line 98 of file glimage.cpp.

References FIFE::Image::reset().

void FIFE::GLImage::useSharedImage ( const ImagePtr shared,
const Rect region 
)
virtual

After this call all image data will be taken from the given image and its subregion

Implements FIFE::Image.

Definition at line 327 of file glimage.cpp.

References FIFE::SharedPtr< T >::get().


The documentation for this class was generated from the following files: