Yukino::Core Class Reference

Class that manages the base system. More...

#include <Core.h>

List of all members.

Public Member Functions

UINT Init (const char *name)
 Function to initialize the object Core.
UINT InitAll (const char *name, int w, int h, int bpp=32, bool winmode=false, int frequency=DEFAULT_FREQUENCY22, word format=DEFAULT_FORMAT, int channels=DEFAULT_NUM_CHANNELS, int chunksize=DEFAULT_CHUNKSIZE)
 Function to initialize the whole library.
void Release (void)
 Function to finalize the object Core.
void ReleaseAll (void)
 Function to finalize the whole library.
void ErrMsg (const char *msg)
 Function to send a message of error by screen.
void Delay (UINT ms)
 Function to stop the execution of the program.
dword GetTime (void)
 Function to obtain the passed time.

Static Public Member Functions

static CoreGetInstance (void)
 Function to obtain the instance of Core.

Public Attributes

GraphicsAppGraphics
 Object to handle the graphical section.
InputAppInput
 Object to handle the input of the program.
AudioAppAudio
 Object to handle the section of the audio one.
ScriptAppScript
 Object to handle the section of scripting with Lua.


Detailed Description

Class that manages the base system.

The main reason for the existence of the class Core is to initialize the base system of the library, on which the rest of functionalities of the library mounts. In order to make the use more comfortable of the other sections, Core contains pointers to the classes Graphics, Input, Audio and Script.


Member Function Documentation

void Yukino::Core::Delay ( UINT  ms  )  [inline]

Function to stop the execution of the program.

This function serves to stop the execution of the program during a determined number of milliseconds.

Parameters:
ms Number of milliseconds that we stopped the execution.

void Yukino::Core::ErrMsg ( const char *  msg  )  [inline]

Function to send a message of error by screen.

This function serves to show the user a message of error of the application, in case that after finding an error, we may want to show an explanation of what it is what it has happened.

Parameters:
msg Message of error that we want to show the user.

Core * Yukino::Core::GetInstance ( void   )  [static]

Function to obtain the instance of Core.

This function creates an instance of Core, in case of not being created, and gives back a pointer of this if memory is successful requesting.

Returns:
It gives back to a pointer to the object Core if everything has gone well, if there is no memory for the object, gives back NULL.

dword Yukino::Core::GetTime ( void   )  [inline]

Function to obtain the passed time.

This function serves to obtain the time passed from the beginning of the application. Normally this one is used to chronometrate parts of the code.

UINT Yukino::Core::Init ( const char *  name  ) 

Function to initialize the object Core.

This function serves to initialize only the object Core, passing to him the name of the application, that is going to use the library.

Parameters:
name Name of the application.
See also:
InitAll(), Release(), ReleaseAll().
Returns:
If everything goes well returns 0, on errors returns: CORE_ERROR_SDLINIT.

UINT Yukino::Core::InitAll ( const char *  name,
int  w,
int  h,
int  bpp = 32,
bool  winmode = false,
int  frequency = DEFAULT_FREQUENCY22,
word  format = DEFAULT_FORMAT,
int  channels = DEFAULT_NUM_CHANNELS,
int  chunksize = DEFAULT_CHUNKSIZE 
)

Function to initialize the whole library.

This function serves to initialize the whole library, passing to him the parameters necessary to initiate Core, Graphics, Input, Audio and Script.

Parameters:
name Name of the application.
w Width of the application.
h Height of the application.
bpp Depth of color of the application.
winmode Window mode activated.
frequency Audio's frequency.
format Audio's format.
channels Audio's channels's number.
chunksize Audio's buffer's size.
See also:
Init(), Release(), ReleaseAll().
Returns:
If everything goes well returns 0, on errors returns: CORE_ERROR_SDLINIT, GRAPHICS_ERROR_VIDEOMODEOK, GRAPHICS_ERROR_SETVIDEOMODE, GRAPHICS_ERROR_TTFINIT, INPUT_ERROR_GETKEYSTATE, AUDIO_ERROR_OPEN, AUDIO_ERROR_QUERYSPEC, AUDIO_ERROR_NOTEQU, SCRIPT_ERROR_LUAOPEN.

void Yukino::Core::Release ( void   ) 

Function to finalize the object Core.

This function serves to finalize only the object Core.

See also:
Init(), InitAll(), ReleaseAll().

void Yukino::Core::ReleaseAll ( void   ) 

Function to finalize the whole library.

This function serves to finalize the whole library.

See also:
Init(), InitAll(), Release().


Member Data Documentation

Audio* Yukino::Core::AppAudio

Object to handle the section of the audio one.

This variable is a pointer to the object that handles the section of the audio one of the library. From him we will be able to handle the audio one and to reproduce sounds.

Graphics* Yukino::Core::AppGraphics

Object to handle the graphical section.

This variable is a pointer to the object that handles the graphical section of the library. From him we will be able to make calls to paint any Surface that we have in the screen of the application.

Input* Yukino::Core::AppInput

Object to handle the input of the program.

This variable is a pointer to the object that handles the section of the input of the library. From him we will be able to handle the keyboard and the mouse.

Script* Yukino::Core::AppScript

Object to handle the section of scripting with Lua.

This variable is a pointer to the object that handles the section of scripting with Lua of the library. From him we will be able to configure interpreter, and to handle the stack of Lua, when we create our functions.


The documentation for this class was generated from the following files:
Generated on Sun Jun 25 03:43:36 2006 for Yukino by  doxygen 1.4.7