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

List of all members.

Public Member Functions

void invalidate ()
void render (const Rect &rect, SDL_Surface *dst, unsigned char alpha=255)
- Public Member Functions inherited from FIFE::Image
 Image (SDL_Surface *surface)
 Image (const uint8_t *data, unsigned int width, unsigned int height)
void render (const Rect &rect, unsigned char alpha=255)
SDL_Surface * detachSurface ()
- Public Member Functions inherited from FIFE::ResourceClass
const ResourceLocationgetResourceLocation ()
virtual void setResourceLocation (const ResourceLocation &location)
int getPoolId ()
- Public Member Functions inherited from FIFE::FifeClass
fifeid_t getFifeId ()
virtual void addRef ()
virtual void decRef ()
virtual unsigned int getRefCount ()
- Public Member Functions inherited from FIFE::IReferenceCounted
virtual void addRef ()=0
virtual void decRef ()=0
virtual unsigned int getRefCount ()=0
- Public Member Functions inherited from FIFE::AbstractImage
virtual SDL_Surface * getSurface ()=0
virtual unsigned int getWidth () const =0
virtual unsigned int getHeight () const =0
virtual const RectgetArea ()=0
virtual bool putPixel (int x, int y, int r, int g, int b, int a=255)=0
virtual void drawLine (const Point &p1, const Point &p2, int r, int g, int b, int a=255)=0
virtual void drawTriangle (const Point &p1, const Point &p2, const Point &p3, int r, int g, int b, int a=255)=0
virtual void drawRectangle (const Point &p, uint16_t w, uint16_t h, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0
virtual void fillRectangle (const Point &p, uint16_t w, uint16_t h, uint8_t r, uint8_t g, uint8_t b, uint8_t a=255)=0
virtual void drawQuad (const Point &p1, const Point &p2, const Point &p3, const Point &p4, int r, int g, int b, int a=255)=0
virtual void drawVertex (const Point &p, const uint8_t size, int r, int g, int b, int a=255)=0
virtual void drawLightPrimitive (const Point &p, uint8_t intensity, float radius, int subdivisions, float xstretch, float ystretch, uint8_t red, uint8_t green, uint8_t blue)=0
virtual void getPixelRGBA (int x, int y, uint8_t *r, uint8_t *g, uint8_t *b, uint8_t *a)=0
virtual void pushClipArea (const Rect &cliparea, bool clear=true)=0
virtual void popClipArea ()=0
virtual const RectgetClipArea () const =0
virtual void saveImage (const std::string &filename)=0
virtual void setAlphaOptimizerEnabled (bool enabled)=0
virtual bool isAlphaOptimizerEnabled ()=0

Protected Member Functions

void setClipArea (const Rect &cliparea, bool clear)
- Protected Member Functions inherited from FIFE::Image
virtual void clearClipArea ()

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.
Todo:
Check the correctness of the generateTexture function on big endian systems (ppc)

Definition at line 58 of file glimage.h.


Member Function Documentation

void FIFE::GLImage::invalidate ( )
virtual

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

Implements FIFE::Image.

Definition at line 65 of file glimage.cpp.

void FIFE::GLImage::render ( const Rect rect,
SDL_Surface *  dst,
unsigned char  alpha = 255 
)
virtual

Renders itself to the Destination surface at the rectangle rect.

Parameters:
rectThe position and clipping where to draw this image to.
targetTarget surface to draw to, e.g. main screen or other image
alphaThe alpha value, with which to draw self. opaque by default.

Implements FIFE::Image.

Definition at line 90 of file glimage.cpp.

References FIFE::RectType< T >::bottom(), FIFE::RectType< T >::h, FIFE::RectType< T >::right(), FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.

void FIFE::GLImage::setClipArea ( const Rect cliparea,
bool  clear 
)
protectedvirtual

Sets given clip area into image

See also:
pushClipArea

Implements FIFE::Image.

Definition at line 238 of file glimage.cpp.

References FIFE::RectType< T >::h, FIFE::RectType< T >::w, FIFE::RectType< T >::x, and FIFE::RectType< T >::y.


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