|
ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
|
Functions | |
| void | update () |
| Updates core module functionality. | |
| float | get_delta_time () |
| Get the time between the last two calls to update(). Capped at a quarter of a second, so a breakpoint or a stalled window does not send things flying. | |
| void | run (const std::function< void()> &frame) |
| Run a main loop until exit() is called. | |
| void | init (int width, int height, int scale=1) |
| Initializes the core module. | |
| void | init_opengl (int width, int height, int scale=1) |
| Initializes the core module for opengl. | |
| void | print_info () |
| Prints information about the core module. | |
| void | exit () |
| Exit the application. Sets exiting flag to true, which will cause the main loop to exit on the next update. | |
| bool | is_exiting () |
| Return exiting status. | |
| void | shutdown () |
| Cleanup resources used by the core module. Should be called on application exit. | |
| void asw::core::exit | ( | ) |
| float asw::core::get_delta_time | ( | ) |
| void asw::core::init | ( | int | width, |
| int | height, | ||
| int | scale = 1 ) |
| void asw::core::init_opengl | ( | int | width, |
| int | height, | ||
| int | scale = 1 ) |
| void asw::core::print_info | ( | ) |
| void asw::core::run | ( | const std::function< void()> & | frame | ) |
Run a main loop until exit() is called.
Calls frame once per frame. Call update() and asw::display::present() inside it as usual. On desktop this is a plain loop that returns once exit() is called. In the browser (Emscripten) the browser drives the loop, so run() does not return and code after it never runs; the loop stops when exit() is called, and Module.onStop is called if the page defines it.
| frame | The function to call each frame. |
| void asw::core::shutdown | ( | ) |