Brenta Engine 1.1
Loading...
Searching...
No Matches
engine.hpp
1/*
2 * MIT License
3 *
4 * Copyright (c) 2024 Giovanni Santini
5
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 *
25 */
26
27#pragma once
28
29#include "buffer.hpp"
30#include "camera.hpp"
31#include "engine_audio.hpp"
32#include "engine_input.hpp"
33#include "engine_logger.hpp"
34#include "engine_time.hpp"
35#include "frame_buffer.hpp"
36#include "gl_helper.hpp"
37#include "gui.hpp"
38#include "mesh.hpp"
39#include "model.hpp"
40#include "particles.hpp"
41#include "screen.hpp"
42#include "shader.hpp"
43#include "text.hpp"
44#include "texture.hpp"
45#include "translation.hpp"
46#include "vao.hpp"
47
48namespace brenta
49{
50
60class engine
61{
62 public:
63 bool uses_screen;
64 bool uses_audio;
65 bool uses_input;
66 bool uses_logger;
67 bool uses_text;
68 int screen_width;
69 int screen_height;
70 bool screen_is_mouse_captured;
71 const char *screen_title;
72 bool screen_msaa;
73 bool screen_vsync;
74 oak::level log_level;
75 std::string log_file;
76 std::string text_font;
77 int text_size;
78 bool gl_blending;
79 bool gl_cull_face;
80 bool gl_multisample;
81 bool gl_depth_test;
82
83 engine(bool uses_screen, bool uses_audio, bool uses_input, bool uses_logger,
84 bool uses_text, int screen_width, int screen_height,
85 bool screen_is_mouse_captured, bool screen_msaa, bool screen_vsync,
86 const char *screen_title, oak::level log_level,
87 std::string log_file, std::string text_font, int text_size,
88 bool gl_blending, bool gl_cull_face, bool gl_multisample,
89 bool gl_depth_test);
90 ~engine();
91
92 class builder;
93};
94
103{
104 public:
105 bool uses_screen = false;
106 bool uses_audio = false;
107 bool uses_input = false;
108 bool uses_logger = false;
109 bool uses_text = false;
110 int screen_width = 1280;
111 int screen_height = 720;
112 bool screen_is_mouse_captured = false;
113 bool screen_msaa = false;
114 bool screen_vsync = false;
115 const char *screen_title = "";
116 oak::level log_level = oak::level::info;
117 std::string log_file = "";
118 std::string text_font = "arial.ttf";
119 int text_size = 48;
120 bool gl_blending = true;
121 bool gl_cull_face = true;
122 bool gl_multisample = true;
123 bool gl_depth_test = true;
124
125 builder &use_screen(bool uses_screen);
126 builder &use_audio(bool uses_audio);
127 builder &use_input(bool uses_input);
128 builder &use_logger(bool uses_logger);
129 builder &use_text(bool uses_text);
130 builder &set_screen_width(int screen_width);
131 builder &set_screen_height(int screen_height);
132 builder &set_screen_is_mouse_captured(bool screen_is_mouse_captured);
133 builder &set_screen_title(const char *screen_title);
134 builder &set_screen_msaa(bool screen_msaa);
135 builder &set_screen_vsync(bool screen_vsync);
136 builder &set_log_level(oak::level log_level);
137 builder &set_log_file(std::string log_file);
138 builder &set_text_font(std::string text_font);
139 builder &set_text_size(int text_size);
140 builder &set_gl_blending(bool gl_blending);
141 builder &set_gl_cull_face(bool gl_cull_face);
142 builder &set_gl_multisample(bool gl_multisample);
143 builder &set_gl_depth_test(bool gl_depth_test);
144
145 engine build();
146};
147
148} // namespace brenta
149
150// Doxygen Documnetation:
151
152// cmake-format: off
564// cmake-format: on
Engine builder.
Definition engine.hpp:103
Engine setup.
Definition engine.hpp:61