mSDL Namespace Reference


Classes

class  GFX
 A graphic object. It handles surfaces manipulation and animation. More...
class  ScreenObject
 A screen object. It handles objects positioning and drawing on screen. More...
class  Sprite
 Sprite objects handling module. More...
class  BG
 BackGround layers handling module. More...
class  Banner
 Text banners handling module. More...
struct  ButtonStatus
struct  KeyHandler
struct  MouseHandler
class  Music
 Music playback handling module. More...
class  Sound
 Sound playback and mixing handling module. More...

Typedefs

typedef Sint8 s8
 8-bit signed integer
typedef Uint8 u8
 8-bit unsigned integer
typedef Sint16 s16
 16-bit signed integer
typedef Uint16 u16
 16-bit unsigned integer
typedef Sint32 s32
 32-bit signed integer
typedef Uint32 u32
 32-bit unsigned integer
typedef SDL_Rect Rect
 see http://www.libsdl.org/cgi/docwiki.cgi/SDL_Rect
typedef SDL_Rect Point
typedef SDL_Surface Surface
 see http://www.libsdl.org/cgi/docwiki.cgi/SDL_Surface
typedef SDL_Color Color
 see http://www.libsdl.org/cgi/docwiki.cgi/SDL_Color

Functions

void Init (const u16 LogicalScreenWidth=DEFAULT_SCREEN_WIDTH, const u16 LogicalScreenHeight=DEFAULT_SCREEN_HEIGHT)
 Initialize (m)SDL. Need to be invoked before using any mSDL module. Initialize SDL subsystems used by mSDL (video, audio,...). Abort execution if it fails. If the logical screen size is not equal to the real screen the surface is automatically scaled appropriately (this is useful for cross-platform porting).
void Screenshot (const std::string Filename)
 Save a screenshot into a BMP file.
u8 GetFPS (void)
 get rendered Frames-Per-Second.
void DrawScreen ()
 draw ALL registered screen objects (sprites, BGs and banners). Normally you won't invoke this function directly, WaitForVBL() will invoke it for you.
u16 Distance (const ScreenObject &First, const ScreenObject &Second)
 Compute the distance (in pixels) between the centers of two screen objects (function version).
s16 Angle (const ScreenObject &First, const ScreenObject &Second)
 Compute the angle (in degrees) between the centers of two screen objects (function version).
bool CollisionRect (const ScreenObject &First, const ScreenObject &Second, u16 Range=0)
 Rectangular collision checker (function version).
bool CollisionCirc (const ScreenObject &First, const ScreenObject &Second, u16 Range=0)
 Circular collision checker (function version).
void HideAllSprites ()
void ShowAllSprites ()
void Sleep (const u32 ms)
 sleep for the specified number of milliseconds.
void WaitForVBL (void)
 Very important function: it draws the screen and read user input. Must be invoked only once for every program cycle. (Similar to PA_WaitForVBL.).

Variables

const u16 DEFAULT_BANNER_PRIO = 50
const u16 DEFAULT_SPRITE_PRIO = 100
const u16 DEFAULT_BG_PRIO = 200
const std::string DEFAULT_FONT_FILE = "FreeSans.ttf"
const int DEFAULT_FONT_SIZE = 32
const int DEFAULT_SCREEN_WIDTH = 640
const int DEFAULT_SCREEN_HEIGHT = 480
const Uint32 DEFAULT_SCREEN_FLAGS = (SDL_HWSURFACE | SDL_HWPALETTE | SDL_DOUBLEBUF)
const int DEFAULT_SCREEN_BPP = 0
const u32 MAX_FPS = 60
const int MIX_CHUNKSIZE = 4096
const int MIX_CHANNELS = 16
const SDL_Color NONE = { 1, 1, 1, 1 }
const SDL_Color BLACK = { 0, 0, 0, 0 }
const SDL_Color WHITE = { 255, 255, 255, 0 }
const SDL_Color RED = { 255, 0, 0, 0 }
const SDL_Color GREEN = { 0, 255, 0, 0 }
const SDL_Color BLUE = { 0, 0, 255, 0 }
const SDL_Color YELLOW = { 255, 255, 0, 0 }
const SDL_Color CYAN = { 0, 255, 255, 0 }
const SDL_Color MAGENTA = { 255, 0, 255, 0 }
const SDL_Color AZURE = { 0, 127, 255, 0 }
const SDL_Color VIOLET = { 127, 0, 255, 0 }
const SDL_Color ROSE = { 255, 0, 127, 0 }
const SDL_Color ORANGE = { 255, 127, 0, 0 }
const SDL_Color CHARTREUSE = { 127, 225, 0, 0 }
const SDL_Color SPRING_GREEN = { 0, 225, 127, 0 }
const SDL_Color GRAY = { 127, 127, 127, 0 }
const SDL_Color GREY = { 127, 127, 127, 0 }
const SDL_Color SILVER = { 191, 191, 191, 0 }
const SDL_Color MAROON = { 127, 0, 0, 0 }
const SDL_Color PINK = { 255, 192, 203, 0 }
SDL_Surface * Screen
 The logical screen surface. User blits should be done to this surface instead of the one returned by SDL_GetVideoSurface.
KeyHandler Key
 default instance from which to read keyboard buttons state
MouseHandler Mouse
 default instance from which to read mouse position and buttons state
MouseHandlerStylus

Typedef Documentation

typedef SDL_Color mSDL::Color

typedef SDL_Rect mSDL::Point

typedef SDL_Rect mSDL::Rect

typedef Sint16 mSDL::s16

16-bit signed integer

typedef Sint32 mSDL::s32

32-bit signed integer

typedef Sint8 mSDL::s8

8-bit signed integer

typedef SDL_Surface mSDL::Surface

typedef Uint16 mSDL::u16

16-bit unsigned integer

typedef Uint32 mSDL::u32

32-bit unsigned integer

typedef Uint8 mSDL::u8

8-bit unsigned integer


Function Documentation

s16 mSDL::Angle ( const ScreenObject First,
const ScreenObject Second 
) [inline]

Compute the angle (in degrees) between the centers of two screen objects (function version).

bool mSDL::CollisionCirc ( const ScreenObject First,
const ScreenObject Second,
u16  Range = 0 
) [inline]

Circular collision checker (function version).

bool mSDL::CollisionRect ( const ScreenObject First,
const ScreenObject Second,
u16  Range = 0 
) [inline]

Rectangular collision checker (function version).

u16 mSDL::Distance ( const ScreenObject First,
const ScreenObject Second 
) [inline]

Compute the distance (in pixels) between the centers of two screen objects (function version).

void mSDL::DrawScreen (  )  [inline]

draw ALL registered screen objects (sprites, BGs and banners). Normally you won't invoke this function directly, WaitForVBL() will invoke it for you.

u8 mSDL::GetFPS ( void   ) 

get rendered Frames-Per-Second.

void mSDL::HideAllSprites (  )  [inline]

void mSDL::Init ( const u16  LogicalScreenWidth = DEFAULT_SCREEN_WIDTH,
const u16  LogicalScreenHeight = DEFAULT_SCREEN_HEIGHT 
)

Initialize (m)SDL. Need to be invoked before using any mSDL module. Initialize SDL subsystems used by mSDL (video, audio,...). Abort execution if it fails. If the logical screen size is not equal to the real screen the surface is automatically scaled appropriately (this is useful for cross-platform porting).

void mSDL::Screenshot ( const std::string  Filename  )  [inline]

Save a screenshot into a BMP file.

void mSDL::ShowAllSprites (  )  [inline]

void mSDL::Sleep ( const u32  ms  )  [inline]

sleep for the specified number of milliseconds.

void mSDL::WaitForVBL ( void   )  [inline]

Very important function: it draws the screen and read user input. Must be invoked only once for every program cycle. (Similar to PA_WaitForVBL.).


Variable Documentation

const SDL_Color mSDL::AZURE = { 0, 127, 255, 0 }

const SDL_Color mSDL::BLACK = { 0, 0, 0, 0 }

const SDL_Color mSDL::BLUE = { 0, 0, 255, 0 }

const SDL_Color mSDL::CHARTREUSE = { 127, 225, 0, 0 }

const SDL_Color mSDL::CYAN = { 0, 255, 255, 0 }

const std::string mSDL::DEFAULT_FONT_FILE = "FreeSans.ttf"

const int mSDL::DEFAULT_FONT_SIZE = 32

const int mSDL::DEFAULT_SCREEN_BPP = 0

const Uint32 mSDL::DEFAULT_SCREEN_FLAGS = (SDL_HWSURFACE | SDL_HWPALETTE | SDL_DOUBLEBUF)

const int mSDL::DEFAULT_SCREEN_HEIGHT = 480

const int mSDL::DEFAULT_SCREEN_WIDTH = 640

const SDL_Color mSDL::GRAY = { 127, 127, 127, 0 }

const SDL_Color mSDL::GREEN = { 0, 255, 0, 0 }

const SDL_Color mSDL::GREY = { 127, 127, 127, 0 }

default instance from which to read keyboard buttons state

const SDL_Color mSDL::MAGENTA = { 255, 0, 255, 0 }

const SDL_Color mSDL::MAROON = { 127, 0, 0, 0 }

const u32 mSDL::MAX_FPS = 60

const int mSDL::MIX_CHANNELS = 16

const int mSDL::MIX_CHUNKSIZE = 4096

default instance from which to read mouse position and buttons state

const SDL_Color mSDL::NONE = { 1, 1, 1, 1 }

const SDL_Color mSDL::ORANGE = { 255, 127, 0, 0 }

const SDL_Color mSDL::PINK = { 255, 192, 203, 0 }

const SDL_Color mSDL::RED = { 255, 0, 0, 0 }

const SDL_Color mSDL::ROSE = { 255, 0, 127, 0 }

SDL_Surface* mSDL::Screen

The logical screen surface. User blits should be done to this surface instead of the one returned by SDL_GetVideoSurface.

Referenced by GFX::GFX().

const SDL_Color mSDL::SILVER = { 191, 191, 191, 0 }

const SDL_Color mSDL::SPRING_GREEN = { 0, 225, 127, 0 }

const SDL_Color mSDL::VIOLET = { 127, 0, 255, 0 }

const SDL_Color mSDL::WHITE = { 255, 255, 255, 0 }

const SDL_Color mSDL::YELLOW = { 255, 255, 0, 0 }


Generated on Tue May 12 09:01:35 2009 for libmSDL by  doxygen 1.5.9