5#include "viotecs/viotecs.hpp"
11using namespace viotecs;
14engine::engine(
bool uses_screen,
bool uses_audio,
bool uses_input,
15 bool uses_logger,
bool uses_text,
int screen_width,
16 int screen_height,
bool screen_is_mouse_captured,
17 bool screen_msaa,
bool screen_vsync,
const char *screen_title,
18 oak::level log_level, std::string log_file,
19 std::string text_font,
int text_size,
bool gl_blending,
20 bool gl_cull_face,
bool gl_multisample,
bool gl_depth_test)
22 this->uses_screen = uses_screen;
23 this->uses_audio = uses_audio;
24 this->uses_input = uses_input;
25 this->uses_logger = uses_logger;
26 uses_text = uses_text;
27 this->screen_width = screen_width;
28 this->screen_height = screen_height;
29 this->screen_is_mouse_captured = screen_is_mouse_captured;
30 this->screen_msaa = screen_msaa;
31 this->screen_vsync = screen_vsync;
32 this->screen_title = screen_title;
33 this->log_level = log_level;
34 this->log_file = log_file;
35 this->text_font = text_font;
36 this->text_size = text_size;
37 this->gl_blending = gl_blending;
38 this->gl_cull_face = gl_cull_face;
39 this->gl_multisample = gl_multisample;
40 this->gl_depth_test = gl_depth_test;
45 oak::set_level(log_level);
48 auto file = oak::set_file(log_file);
49 if (!file.has_value())
51 ERROR(
"Failed to open log file: {}", log_file);
53 INFO(
"Set log file: {}", log_file);
59 screen::init(screen_width, screen_height, screen_is_mouse_captured,
60 screen_title, screen_msaa, screen_vsync);
102 if (this->uses_screen)
107 if (this->uses_logger)
115 this->uses_screen = uses_screen;
121 this->uses_audio = uses_audio;
127 this->uses_input = uses_input;
133 this->uses_logger = uses_logger;
139 this->uses_text = uses_text;
145 this->screen_width = screen_width;
151 this->screen_height = screen_height;
156engine::builder::set_screen_is_mouse_captured(
bool screen_is_mouse_captured)
158 this->screen_is_mouse_captured = screen_is_mouse_captured;
162engine::builder &engine::builder::set_screen_title(
const char *screen_title)
164 this->screen_title = screen_title;
170 this->screen_msaa = screen_msaa;
176 this->screen_vsync = screen_vsync;
182 this->log_level = log_level;
188 this->log_file = log_file;
194 this->text_font = text_font;
200 this->text_size = text_size;
206 this->gl_blending = gl_blending;
212 this->gl_cull_face = gl_cull_face;
216engine::builder &engine::builder::set_gl_multisample(
bool gl_multisample)
218 this->gl_multisample = gl_multisample;
224 this->gl_depth_test = gl_depth_test;
228engine engine::builder::build()
230 return engine(uses_screen, uses_audio, uses_input, uses_logger, uses_text,
231 screen_width, screen_height, screen_is_mouse_captured,
232 screen_msaa, screen_vsync, screen_title, log_level, log_file,
233 text_font, text_size, gl_blending, gl_cull_face,
234 gl_multisample, gl_depth_test);
static void destroy()
Destroy the audio system.
static void init()
Initialize the audio system.
static void load_opengl(bool gl_blending=true, bool gl_cull_face=true, bool gl_multisample=true, bool gl_depth_test=true)
Load OpenGL.
static void destroy()
Delete the gui.
static void init()
Initialize the gui.
static void terminate()
Terminate the window.
static void init(int SCR_WIDTH, int SCR_HEIGHT, bool is_mouse_captured=false, const char *title="OpenGL", bool msaa=false, bool vsync=false)
Initialize the window.
static void init()
Initialize the text subsystem.
static void load(std::string font_name, unsigned int font_size)
Load a font.