Core functions


Functions

int SAL (const char *name, int width, int height, int depth, int refresh_rate, bool full_screen)
 Initialise the SAL library. Get it up and running.
int SAL_set_video_mode (int width, int height, int depth, int refresh_rate, bool full_screen)
 Load correct video module and init the video.
void salStop (void)
 Stop SAL.
int SAL_load_library (const char *name, void *&lib)
 Load library.
void SAL_quit ()
 Exit function of SAL.

Detailed Description

The core functions are the most basic functions that make SAL run
Note: Not all functions are available outside the library

Function Documentation

int SAL ( const char *  name,
int  width,
int  height,
int  depth,
int  refresh_rate,
bool  full_screen 
)

Initialise the SAL library. Get it up and running.

Parameters:
name window name
width window width
height window height
depth color depth
refresh_rate refresh rate (deprecated)
full_screen full screen on or off
Warning:
This function has to be called before other SAL functions are used.
This function does a number of things. First it init's the SDL library (audio video timer). When done it loads the SAL config file and set's the default variables. When everything is set, the functions initialises video and network capability. After that the event listener and rendere kick in and everything is good to go.

TODO: Load ALL from config

Definition at line 55 of file SAL.cpp.

References SAL_set_cmask::a, SAL_action_handler::action, SAL_int_event::action_handler, SAL_int_event::active_object, SAL_setting::audio, SAL_set_cmask::b, SAL_set_button::bgcolor, SAL_set_button::bocolor, SAL_set_gui::button, SAL_int_gui::buttons, SAL_intern::checks, SAL_set_render::cmask, SAL_setting::common, SAL_intern::event, SAL_set_button::fgcolor, SAL_set_button::font, SAL_set_cmask::g, salConf::getColor(), salConf::getFont(), salConf::getInt(), salConf::getString(), SAL_intern::gui, SAL_setting::gui, SAL_set_button::h, SAL_int_gui::images, SAL_int_gui::inputBoxes, SAL_structure::internal, SAL_action_handler::keyboard, SAL_set_gui::keyboard_delay, SAL_GuiContainer::last_id, SAL_set_common::library_dir, SAL_set_common::max_con_network_listener, SAL_set_render::mode, SAL_action_handler::mouse, SAL_set_gui::mouse_delay, SAL_set_common::network_time_out_time, SAL_set_audio::on, SAL_set_button::prcolor, SAL_set_cmask::r, SAL_set_render::refresh_rate, SAL_setting::render, SAL_quit(), SAL_set_video_mode(), SAL_start_event_listener(), SAL_start_network(), SAL_start_renderer(), salError(), SAL_structure::setting, SAL_int_checks::start, SAL_int_gui::textboxes, and SAL_set_button::w.

int SAL_load_library ( const char *  name,
void *&  lib 
)

Load library.

Parameters:
name Name of library used
lib SDL format library structure
The functions dynamicaly loads an library.
Returns the load library by the lib variable

Definition at line 318 of file SAL.cpp.

References SAL_setting::common, SAL_set_common::library_dir, salError(), salPrint(), and SAL_structure::setting.

Referenced by SAL_set_video_mode().

void SAL_quit ( void   ) 

Exit function of SAL.

Note:
Defined internaly.
Called when program exits
Makes the program wait on SAL to quit properly
This is also the reason why the program doesn't quit after exiting the main function.

Definition at line 349 of file SAL.cpp.

References SAL_intern::event, SAL_structure::internal, SAL_intern::render, SAL_stop_network(), SAL_int_event::thread, and SAL_int_render::thread.

Referenced by SAL().

int SAL_set_video_mode ( int  width,
int  height,
int  depth,
int  refresh_rate,
bool  full_screen 
)

Load correct video module and init the video.

Parameters:
width window width
height window height
depth color depth
refresh_rate refresh rate (deprecated)
full_screen full screen on or off
Note:
Defined internaly.
First this function loads an video module that is selected by the end user(user that uses application)
Then it init's the video module
And at last the render functions get connected with the module

Definition at line 165 of file SAL.cpp.

References SAL_int_checks::alive, SAL_set_gui::button, SAL_intern::checks, SAL_int_render::display, SAL_set_button::font, SAL_setting::gui, SAL_structure::internal, SAL_set_render::mode, SAL_set_render::refresh_rate, SAL_intern::render, SAL_setting::render, SAL_load_library(), salClear, SALDrawCImage, salDrawCImage, SALDrawImage, salDrawImage, SALDrawLine, salDrawLine, SALDrawRect, salDrawRect, SALDrawText, salDrawText, salError(), SALFillRect, salFillRect, salLoadFont, salNewSurface, SAL_structure::setting, and SAL_int_checks::start.

Referenced by SAL().

void salStop ( void   ) 

Stop SAL.

Warning:
This Will end the application
Stop SAL and stop the application(quit)

Definition at line 285 of file SAL.cpp.

References SAL_int_checks::alive, SAL_intern::checks, and SAL_structure::internal.

Referenced by SAL_event_listener().