SetupProgram
Sets up OpenLayer, Allegro, AllegroGL and the specified input devices. Returns true on success.
Same as above but the parameters are passed by using the bitwise "or" of any of the following devices: KEYBOARD, MOUSE and TIMER. The first thing you should be doing in your program is to call this function. That's because you can't call any other OpenLayer function or any Allegro or AllegroGL function before you call this one. Besides setting up the libraries it also sets up the specified input devices. It's usually recommended to set up the keyboard even if you're not using keyboard functions anywhere. Also setting up the mouse will also set up timer functions even if you pass false as setupTimer. That's because the mouse handling routines require the timer routines. Calling the function with no parameters will by default set up all possible input devices and the timer routines. It's best to call Setup::SetupScreen right after calling this function because you can't load any Bitmaps or TextRenderers before you've set up the screen! Examples // Setup the libraries and all drivers //
Setup::SetupProgram(); // Setup the libraries and the keyboard but not the mouse // Setup::SetupProgram( true, false ); // Same as above by using the named arguments // Setup::SetupProgram( KEYBOARD ); // Setup the libraries and the keyboard and timer routines but not the mouse // Setup::SetupProgram( true, false, true ); // Same as above by using the named arguments // Setup::SetupProgram( KEYBOARD | TIMER ); // The function sets up all input devices and timer routines by default // Setup::SetupProgram(); // Now the keyboard, mouse and timer routines are all set up // Other functions of the class Setup
Questions about SetupProgram? Click here. |