Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

base_renderer Class Reference

base class for easily creating renderer instances More...

#include <brenderer.h>

Inheritance diagram for base_renderer:

Inheritance graph
[legend]
Collaboration diagram for base_renderer:

Collaboration graph
[legend]
List of all members.

Public Methods

int get_frame () const throw ()
 base_renderer () throw ()
virtual ~base_renderer () throw ()
virtual bool init_frame (const point &size) throw (std::exception)
 start of animation output

virtual char * lock_frame (int frame) throw (std::exception)
 lock a frame buffer

virtual bool unlock_frame () throw ()
 unlock a frame buffer

virtual bool flip_frame () throw ()
 flip a frame buffer

virtual bool set_palette (const palette &pal) throw ()
 set a new palette

virtual bool start_decode (const std::string &fname, int version, int nbframes) throw ()
 start of animation output

virtual sound_rendererget_sound_renderer () throw (std::exception)
 request for a sound_renderer

virtual bool wait (int ms)=0 throw (std::exception)
 wait for some time

virtual bool save_current () throw ()
 debugging function : do not use


Protected Methods

virtual void save (int frame=-1)=0
const std::string & get_filename () const throw ()
int get_nbframes () const throw ()
int get_width () const throw ()
int get_height () const throw ()
const palettepal () const throw ()
const char * data () const throw ()
void clean () throw ()
 memory cleanup (deletes frame buffer)

void set_frame (int f) throw ()

Private Attributes

palette _pal
 The current palette.

char * _data
 The current frame buffer.

int _frame
 The current frame number.

int _nbframes
 The number of frames in the animation.

int _width
 The current frame's width.

int _height
 The current frame's height.

std::string _fname
 The filename of the animation being played.


Detailed Description

base class for easily creating renderer instances

This class implements some function available in the renderer abstract class, so that creation of subclasses of renderer is easier.

Definition at line 36 of file brenderer.h.


Constructor & Destructor Documentation

base_renderer::base_renderer   throw ()
 

Definition at line 33 of file brenderer.cpp.

base_renderer::~base_renderer   throw () [virtual]
 

Definition at line 41 of file brenderer.cpp.


Member Function Documentation

void base_renderer::clean   throw () [protected]
 

memory cleanup (deletes frame buffer)

Reimplemented in window_renderer.

Definition at line 25 of file brenderer.cpp.

const char* base_renderer::data   const throw () [inline, protected]
 

Definition at line 54 of file brenderer.h.

References _data.

Referenced by font_renderer::save().

bool base_renderer::flip_frame   throw () [virtual]
 

flip a frame buffer

This is called by the animation player when the current frame should be shown.

Returns:
true if everything went fine, false otherwise

Implements renderer.

Definition at line 65 of file brenderer.cpp.

const std::string& base_renderer::get_filename   const throw () [inline, protected]
 

Definition at line 49 of file brenderer.h.

References _fname.

int base_renderer::get_frame   const throw () [inline]
 

Definition at line 58 of file brenderer.h.

References _frame.

int base_renderer::get_height   const throw () [inline, protected]
 

Definition at line 52 of file brenderer.h.

References _height.

Referenced by font_renderer::save().

int base_renderer::get_nbframes   const throw () [inline, protected]
 

Definition at line 50 of file brenderer.h.

References _nbframes.

virtual sound_renderer* base_renderer::get_sound_renderer   throw (std::exception) [inline, virtual]
 

request for a sound_renderer

This is called by the animation player when sound output is required by the animation.

Returns:
a valid pointer to an uninitialized sound_renderer instance, or null if none is available.

Implements renderer.

Reimplemented in window_renderer.

Definition at line 68 of file brenderer.h.

int base_renderer::get_width   const throw () [inline, protected]
 

Definition at line 51 of file brenderer.h.

References _width.

Referenced by font_renderer::save().

bool base_renderer::init_frame const point   size throw (std::exception) [virtual]
 

start of animation output

This is called by the animation player when the frame size is changing.

Parameters:
size  new size of the frames.
Returns:
true if everything went fine, false otherwise

Implements renderer.

Reimplemented in bitmap_renderer, bitmap_file_renderer, and window_renderer.

Definition at line 45 of file brenderer.cpp.

Referenced by bitmap_renderer::init_frame().

char * base_renderer::lock_frame int    frame throw (std::exception) [virtual]
 

lock a frame buffer

This is called by the animation player when a frame is going to be decoded.

Parameters:
frame  the frame number.
Returns:
a pointer to the frame buffer to output data to.

Implements renderer.

Definition at line 55 of file brenderer.cpp.

const palette& base_renderer::pal   const throw () [inline, protected]
 

Definition at line 53 of file brenderer.h.

virtual void base_renderer::save int    frame = -1 [protected, pure virtual]
 

Implemented in null_renderer, font_renderer, and bitmap_renderer.

virtual bool renderer::save_current   throw () [inline, virtual, inherited]
 

debugging function : do not use

Returns:
true if everything went fine, false otherwise

Reimplemented in bitmap_file_renderer.

Definition at line 151 of file renderer.h.

void base_renderer::set_frame int    f throw () [inline, protected]
 

Definition at line 56 of file brenderer.h.

References _frame.

bool base_renderer::set_palette const palette   pal throw () [virtual]
 

set a new palette

This is called by the animation player when the palette is changing.

Parameters:
pal  new palette.
Returns:
true if everything went fine, false otherwise

Implements renderer.

Reimplemented in bitmap_renderer.

Definition at line 70 of file brenderer.cpp.

Referenced by bitmap_renderer::set_palette().

virtual bool base_renderer::start_decode const std::string &    fname,
int    version,
int    nbframes
throw () [inline, virtual]
 

start of animation output

This is called by the animation player when output is going to start.

Parameters:
fname  name of the animation being played.
version  version number of the animation
nbframes  total number of frames of the animation.
Returns:
true if initialisation was ok, false otherwise

Implements renderer.

Definition at line 67 of file brenderer.h.

References _fname, and _nbframes.

bool base_renderer::unlock_frame   throw () [virtual]
 

unlock a frame buffer

This is called by the animation player when a frame has been decoded.

Returns:
true if everything went fine, false otherwise

Implements renderer.

Definition at line 61 of file brenderer.cpp.

virtual bool renderer::wait int    ms throw (std::exception) [pure virtual, inherited]
 

wait for some time

This is called by the animation player when the animation should stay idle.

Parameters:
ms  number of millisecond to wait.
Returns:
true if everything went fine, false otherwise

Implemented in null_renderer, font_renderer, bitmap_file_renderer, and window_renderer.


Member Data Documentation

char* base_renderer::_data [private]
 

The current frame buffer.

Definition at line 39 of file brenderer.h.

Referenced by data().

std::string base_renderer::_fname [private]
 

The filename of the animation being played.

Definition at line 44 of file brenderer.h.

Referenced by get_filename(), and start_decode().

int base_renderer::_frame [private]
 

The current frame number.

Definition at line 40 of file brenderer.h.

Referenced by get_frame(), and set_frame().

int base_renderer::_height [private]
 

The current frame's height.

Definition at line 43 of file brenderer.h.

Referenced by get_height().

int base_renderer::_nbframes [private]
 

The number of frames in the animation.

Definition at line 41 of file brenderer.h.

Referenced by get_nbframes(), and start_decode().

palette base_renderer::_pal [private]
 

The current palette.

Definition at line 38 of file brenderer.h.

int base_renderer::_width [private]
 

The current frame's width.

Definition at line 42 of file brenderer.h.

Referenced by get_width().


The documentation for this class was generated from the following files:
Generated on Fri Aug 9 22:54:30 2002 for san_player by doxygen1.2.16