FIFE::RenderBackend Class Reference

#include <renderbackend.h>

Inheritance diagram for FIFE::RenderBackend:
Inheritance graph
[legend]
Collaboration diagram for FIFE::RenderBackend:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RenderBackend (const SDL_Color &colorkey)
virtual ~RenderBackend ()
virtual const std::string & getName () const =0
virtual void startFrame ()=0
virtual void endFrame ()=0
virtual void init ()=0
virtual void deinit ()
virtual ImagecreateMainScreen (unsigned int width, unsigned int height, unsigned char bitsPerPixel, bool fullscreen, const std::string &title, const std::string &icon)=0
virtual ImagecreateImage (const uint8_t *data, unsigned int width, unsigned int height)=0
virtual ImagecreateImage (SDL_Surface *surface)=0
ImagegetScreenImage () const
void captureScreen (const std::string &filename)
void setColorKeyEnabled (bool colorkeyenable)
bool isColorKeyEnabled () const
void setColorKey (const SDL_Color &colorkey)
const SDL_Color & getColorKey () const

Detailed Description

Abstract interface for all the renderbackends.

Definition at line 50 of file renderbackend.h.


Constructor & Destructor Documentation

FIFE::RenderBackend::RenderBackend ( const SDL_Color &  colorkey  ) 

Constructor.

Parameters:
name The name of the new renderbackend.

Definition at line 37 of file renderbackend.cpp.

FIFE::RenderBackend::~RenderBackend (  )  [virtual]

Destructor.

Definition at line 46 of file renderbackend.cpp.


Member Function Documentation

void FIFE::RenderBackend::captureScreen ( const std::string &  filename  ) 

Creates a Screenshot and saves it to a file.

Definition at line 55 of file renderbackend.cpp.

virtual Image* FIFE::RenderBackend::createImage ( SDL_Surface *  surface  )  [pure virtual]

Helper function to create images from SDL_Surfaces. Takes ownership over the surface.

Parameters:
surface The surface to convert.
Returns:
The new Image.

Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.

virtual Image* FIFE::RenderBackend::createImage ( const uint8_t *  data,
unsigned int  width,
unsigned int  height 
) [pure virtual]

Creates an Image suitable for this renderbackend.

Parameters:
data Pointer to the imagedata (needs to be in RGBA, 8 bits per channel).
width Width of the image.
height Height of the image.
Returns:
The new Image.

Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.

virtual Image* FIFE::RenderBackend::createMainScreen ( unsigned int  width,
unsigned int  height,
unsigned char  bitsPerPixel,
bool  fullscreen,
const std::string &  title,
const std::string &  icon 
) [pure virtual]

Creates the mainscreen (the display window).

Parameters:
width Width of the window.
height Height of the window.
bitsPerPixel Bits per pixel, 0 means autodetect.
fullscreen Use fullscreen mode?
Returns:
The new Screen Image

Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.

void FIFE::RenderBackend::deinit (  )  [virtual]

Performs cleanup actions.

Definition at line 49 of file renderbackend.cpp.

virtual void FIFE::RenderBackend::endFrame (  )  [pure virtual]

Called when a frame is finished and ready to be displayed.

Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.

const SDL_Color & FIFE::RenderBackend::getColorKey (  )  const

Gets the global colorkey setting

Definition at line 142 of file renderbackend.cpp.

virtual const std::string& FIFE::RenderBackend::getName (  )  const [pure virtual]

The name of the renderbackend.

Returns:
The name of this renderbackend.

Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.

Image* FIFE::RenderBackend::getScreenImage (  )  const [inline]

Returns a pointer to the main screen Image

Returns:
A pointer to the main screen Image, or 0 if no mainscreen exists.

Definition at line 109 of file renderbackend.h.

virtual void FIFE::RenderBackend::init (  )  [pure virtual]

Initializes the backend.

Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.

bool FIFE::RenderBackend::isColorKeyEnabled (  )  const

Gets whether the colorkey feature is in use

Definition at line 134 of file renderbackend.cpp.

void FIFE::RenderBackend::setColorKey ( const SDL_Color &  colorkey  ) 

Sets the global colorkey to use for images

Definition at line 138 of file renderbackend.cpp.

void FIFE::RenderBackend::setColorKeyEnabled ( bool  colorkeyenable  ) 

Sets whether to use the colorkey feature

Definition at line 130 of file renderbackend.cpp.

virtual void FIFE::RenderBackend::startFrame (  )  [pure virtual]

Called when a new frame starts.

Implemented in FIFE::RenderBackendOpenGL, and FIFE::RenderBackendSDL.


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.2-20100208