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

CSurfaceImpl Class Reference

#include <cvideo.h>

Inheritance diagram for CSurfaceImpl:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual ~CSurfaceImpl ()
virtual void inc_ref_count ()=0
virtual void dec_ref_count ()=0
virtual int is_empty ()=0
virtual void set_transparent_color (CColor color)=0
virtual void blit (CSurfaceImpl &source)=0
virtual void blit (CSurfaceImpl &source, CPoint &dest_pos)=0
virtual void blit (CSurfaceImpl &source, CPoint &dest_pos, CRect &src_rect)=0
virtual void fill_rect (const CRect &rect, CColor color)=0
virtual void set_clipping_rect (CRect &rect)=0
virtual void clear_clipping_rect ()=0
virtual int get_depth ()=0
virtual int get_width ()=0
virtual int get_height ()=0
virtual void set_video_mode (int width, int height, int depth, int fullscreen)=0
virtual void flip ()=0
virtual void update_rects (CRectList &rects)=0

Detailed Description

This is the abstract base class for a bitmap surface implementation; its methods are used by CSurface and CScreen, which delegate out most of their methods to a concrete object of this class. Note that this object is the implementation end of a bridge pattern (CSurface and CScreen are the interface ends) and also serves as a "cheshire cat" to hide the actual implementation of the video subsystem.

Also note that a CSurfaceImpl represents the physical surface of the bitmap in memory; as such, it has a reference count of the number of bitmap (CSurface) objects that are pointing to it, and when this reference count reaches 0, the CSurfaceImpl should be destroyed.

Definition at line 229 of file cvideo.h.


Constructor & Destructor Documentation

virtual CSurfaceImpl::~CSurfaceImpl  )  [inline, virtual]
 

Define a virtual destructor so the subclass' destructors get called when a pointer to a CSurfaceImpl is deleted.

Definition at line 233 of file cvideo.h.


Member Function Documentation

virtual void CSurfaceImpl::blit CSurfaceImpl source,
CPoint dest_pos,
CRect src_rect
[pure virtual]
 

Blit a sub-rectangle of the given surface to this surface at the given position on this surface.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual void CSurfaceImpl::blit CSurfaceImpl source,
CPoint dest_pos
[pure virtual]
 

Blit the given surface to this surface at the given position on this surface.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual void CSurfaceImpl::blit CSurfaceImpl source  )  [pure virtual]
 

Blits the given surface to this surface.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual void CSurfaceImpl::clear_clipping_rect  )  [pure virtual]
 

Clear the clipping rectangle for the surface.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual void CSurfaceImpl::dec_ref_count  )  [pure virtual]
 

Decreases the reference count of the surface (garbage collection).

Implemented in SDLDriver::CSurfaceImplSDL.

virtual void CSurfaceImpl::fill_rect const CRect rect,
CColor  color
[pure virtual]
 

Fills the given rectangle on the surface with the given color.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual void CSurfaceImpl::flip  )  [pure virtual]
 

Flips the screen display, using double buffering or whatever is best supported on the given hardware. Call this after you've modified the screen and want the changes to take effect. Used by CScreen.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual int CSurfaceImpl::get_depth  )  [pure virtual]
 

Returns the depth of the surface, in bits per pixel.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual int CSurfaceImpl::get_height  )  [pure virtual]
 

Returns the height of the surface, in pixels.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual int CSurfaceImpl::get_width  )  [pure virtual]
 

Returns the width of the surface, in pixels.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual void CSurfaceImpl::inc_ref_count  )  [pure virtual]
 

Increases the reference count of the surface, i.e. the number of CSurface objects that are now pointing to this CSurfaceImpl. Used for garbage collection.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual int CSurfaceImpl::is_empty  )  [pure virtual]
 

Returns whether the reference count is 0 or not.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual void CSurfaceImpl::set_clipping_rect CRect rect  )  [pure virtual]
 

Set the clipping rectangle for the surface.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual void CSurfaceImpl::set_transparent_color CColor  color  )  [pure virtual]
 

Sets the transparent color of the bitmap.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual void CSurfaceImpl::set_video_mode int  width,
int  height,
int  depth,
int  fullscreen
[pure virtual]
 

Sets the video mode to the given width and height and depth; if fullscreen is nonzero, then the video mode is set to fullscreen, otherwise it is windowed. This method is used by the CScreen object.

Implemented in SDLDriver::CSurfaceImplSDL.

virtual void CSurfaceImpl::update_rects CRectList rects  )  [pure virtual]
 

Like flip(), but only updates the given list of rectangles on the screen.

Implemented in SDLDriver::CSurfaceImplSDL.


The documentation for this class was generated from the following file:
Generated on Wed Aug 27 11:59:23 2003 for GFW by doxygen 1.3.3