-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBoolEngine.cpp
More file actions
32 lines (29 loc) · 878 Bytes
/
BoolEngine.cpp
File metadata and controls
32 lines (29 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "BoolEngine.h"
bool initializeFramework(bool keyboard, bool mouse, bool joystick, bool image, bool font, bool audio, int samples) {
bool initialize = false;
if (al_init()) {
initialize = true;
if (keyboard) al_install_keyboard();
if (mouse) al_install_mouse();
if (joystick) al_install_joystick();
if (image) al_init_image_addon();
if (font) {
al_init_font_addon();
al_init_ttf_addon();
}
if (audio) {
al_install_audio();
al_init_acodec_addon();
al_reserve_samples(samples);
}
}
return initialize;
}
void destroyFramework(bool keyboard, bool mouse, bool joystick, bool image, bool font, bool audio) {
if (keyboard) al_uninstall_keyboard();
if (mouse) al_uninstall_mouse();
if (joystick) al_uninstall_joystick();
if (image) al_shutdown_image_addon();
if (font) al_shutdown_font_addon();
if (audio) al_uninstall_audio();
}