Hosting courtesy of Sourceforge

SourceForge Logo
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Graphics::ImageManager Class Reference

#include <ImageManager.h>

Collaboration diagram for Graphics::ImageManager:

Collaboration graph
[legend]
List of all members.

Public Methods

SDL_Surface * getImage (const string &str)
void freeAll ()
void freeBMP (const string &str)
void freeBMP (SDL_Surface *surf)

Static Public Methods

ImageManager * getInstance ()
void destroy ()

Detailed Description

A singleton class for managing allocated SDL_Surface* returned from SDL_LoadBMP(). Use this class in order to avoid loading the same image twice.

Notes for usage:



Read this article if you want information on singletons Singleton Texture Manager . The article covers using textures in OpenGL but the concept is the same.

Definition at line 55 of file ImageManager.h.


Constructor & Destructor Documentation

ImageManager::~ImageManager  
 

Definition at line 35 of file ImageManager.cpp.


Member Function Documentation

void ImageManager::debugPrintPairs  
 

Definition at line 110 of file ImageManager.cpp.

void ImageManager::destroy   [static]
 

Destroys sole instance of ImageManager class, deallocating all memory and freeing all surfaces

Definition at line 85 of file ImageManager.cpp.

void ImageManager::freeAll  
 

Frees all stored surfaces, but does not delete instance of class

Definition at line 89 of file ImageManager.cpp.

void ImageManager::freeBMP SDL_Surface *    surf
 

Frees single image pointed by surf

Definition at line 61 of file ImageManager.cpp.

void ImageManager::freeBMP const string &    str
 

Frees single image referred to by str

Definition at line 72 of file ImageManager.cpp.

SDL_Surface * ImageManager::getImage const string &    str
 

Returns image stored by ImageManager with given filename.
If fast, repeated access is needed, instead save the surface after a single call

Parameters:
str  string specifying image to return
Returns:
image specified by given index

Definition at line 39 of file ImageManager.cpp.

ImageManager * ImageManager::getInstance   [static]
 

Return pointer to sole ImageManager instantion

Definition at line 26 of file ImageManager.cpp.


The documentation for this class was generated from the following files:
Generated on Tue May 21 07:26:55 2002 for BomberLAN by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001