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++.
Loading...
Searching...
No Matches
core.h
Go to the documentation of this file.
1
8
9#ifndef ASW_CORE_H
10#define ASW_CORE_H
11
12#include <functional>
13
14namespace asw::core {
15
18void update();
19
26float get_delta_time();
27
39void run(const std::function<void()>& frame);
40
47void init(int width, int height, int scale = 1);
48
55void init_opengl(int width, int height, int scale = 1);
56
59void print_info();
60
64void exit();
65
68bool is_exiting();
69
72void shutdown();
73
74} // namespace asw::core
75
76#endif // ASW_CORE_H
void exit()
Exit the application. Sets exiting flag to true, which will cause the main loop to exit on the next u...
Definition core.cpp:227
void print_info()
Prints information about the core module.
Definition core.cpp:212
void init_opengl(int width, int height, int scale=1)
Initializes the core module for opengl.
Definition core.cpp:187
void run(const std::function< void()> &frame)
Run a main loop until exit() is called.
Definition core.cpp:257
void shutdown()
Cleanup resources used by the core module. Should be called on application exit.
Definition core.cpp:232
void init(int width, int height, int scale=1)
Initializes the core module.
Definition core.cpp:168
void update()
Updates core module functionality.
Definition core.cpp:32
float get_delta_time()
Get the time between the last two calls to update(). Capped at a quarter of a second,...
Definition core.cpp:163
bool is_exiting()
Return exiting status.
Definition core.cpp:289