Graphics Class Reference

#include <graphics.h>

Inheritance diagram for Graphics:

OpenGLGraphics

List of all members.


Detailed Description

A central point of control for graphics.

Definition at line 70 of file graphics.h.


Public Member Functions

 Graphics ()
 Constructor.
virtual ~Graphics ()
 Destructor.
virtual bool setVideoMode (int w, int h, int bpp, bool fs, bool hwaccel)
 Try to create a window with the given settings.
bool setFullscreen (bool fs)
 Set fullscreen mode.
bool drawImage (Image *image, int x, int y)
 Blits an image onto the screen.
void drawImage (gcn::Image const *image, int srcX, int srcY, int dstX, int dstY, int width, int height)
 Overrides with our own drawing method.
virtual bool drawImage (Image *image, int srcX, int srcY, int dstX, int dstY, int width, int height, bool useColor=false)
 Blits an image onto the screen.
virtual void drawImagePattern (Image *image, int x, int y, int w, int h)
void drawImageRect (int x, int y, int w, int h, Image *topLeft, Image *topRight, Image *bottomLeft, Image *bottomRight, Image *top, Image *right, Image *bottom, Image *left, Image *center)
 Draws a rectangle using images.
void drawImageRect (int x, int y, int w, int h, const ImageRect &imgRect)
 Draws a rectangle using images.
virtual void updateScreen ()
 Updates the screen.
int getWidth () const
 Returns the width of the screen.
int getHeight () const
 Returns the height of the screen.
virtual SDL_Surface * getScreenshot ()
 Takes a screenshot and returns it as SDL surface.

Protected Attributes

SDL_Surface * mScreen
bool mFullscreen
bool mHWAccel

Constructor & Destructor Documentation

Graphics::Graphics (  ) 

Constructor.

Definition at line 30 of file graphics.cpp.

Graphics::~Graphics (  )  [virtual]

Destructor.

Definition at line 35 of file graphics.cpp.


Member Function Documentation

bool Graphics::setVideoMode ( int  w,
int  h,
int  bpp,
bool  fs,
bool  hwaccel 
) [virtual]

Try to create a window with the given settings.

Reimplemented in OpenGLGraphics.

Definition at line 40 of file graphics.cpp.

bool Graphics::setFullscreen ( bool  fs  ) 

Set fullscreen mode.

Definition at line 99 of file graphics.cpp.

bool Graphics::drawImage ( Image image,
int  x,
int  y 
)

Blits an image onto the screen.

Returns:
true if the image was blitted properly false otherwise.

Definition at line 118 of file graphics.cpp.

void Graphics::drawImage ( gcn::Image const *  image,
int  srcX,
int  srcY,
int  dstX,
int  dstY,
int  width,
int  height 
)

Overrides with our own drawing method.

Definition at line 145 of file graphics.cpp.

bool Graphics::drawImage ( Image image,
int  srcX,
int  srcY,
int  dstX,
int  dstY,
int  width,
int  height,
bool  useColor = false 
) [virtual]

Blits an image onto the screen.

Returns:
true if the image was blitted properly false otherwise.

Reimplemented in OpenGLGraphics.

Definition at line 123 of file graphics.cpp.

void Graphics::drawImagePattern ( Image image,
int  x,
int  y,
int  w,
int  h 
) [virtual]

Reimplemented in OpenGLGraphics.

Definition at line 154 of file graphics.cpp.

void Graphics::drawImageRect ( int  x,
int  y,
int  w,
int  h,
Image topLeft,
Image topRight,
Image bottomLeft,
Image bottomRight,
Image top,
Image right,
Image bottom,
Image left,
Image center 
)

Draws a rectangle using images.

4 corner images, 4 side images and 1 image for the inside.

Definition at line 187 of file graphics.cpp.

void Graphics::drawImageRect ( int  x,
int  y,
int  w,
int  h,
const ImageRect imgRect 
)

Draws a rectangle using images.

4 corner images, 4 side images and 1 image for the inside.

Definition at line 230 of file graphics.cpp.

void Graphics::updateScreen (  )  [virtual]

Updates the screen.

This is done by either copying the buffer to the screen or swapping pages.

Reimplemented in OpenGLGraphics.

Definition at line 239 of file graphics.cpp.

int Graphics::getWidth (  )  const

Returns the width of the screen.

Definition at line 108 of file graphics.cpp.

int Graphics::getHeight (  )  const

Returns the height of the screen.

Definition at line 113 of file graphics.cpp.

SDL_Surface * Graphics::getScreenshot (  )  [virtual]

Takes a screenshot and returns it as SDL surface.

Reimplemented in OpenGLGraphics.

Definition at line 244 of file graphics.cpp.


Member Data Documentation

SDL_Surface* Graphics::mScreen [protected]

Definition at line 165 of file graphics.h.

bool Graphics::mFullscreen [protected]

Definition at line 166 of file graphics.h.

bool Graphics::mHWAccel [protected]

Definition at line 166 of file graphics.h.


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

Generated on Sun Apr 26 17:30:43 2009 for The Mana World by  doxygen 1.5.5