Brenta Engine 1.0
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 "gl_helper.hpp"
36#include "mesh.hpp"
37#include "model.hpp"
38#include "particles.hpp"
39#include "screen.hpp"
40#include "shader.hpp"
41#include "text.hpp"
42#include "texture.hpp"
43#include "translation.hpp"
44#include "vao.hpp"
45
46namespace Brenta
47{
48
58class Engine
59{
60 public:
61 bool uses_screen;
62 bool uses_audio;
63 bool uses_input;
64 bool uses_logger;
65 bool uses_text;
66 bool uses_ecs;
67 int screen_width;
68 int screen_height;
69 bool screen_is_mouse_captured;
70 const char *screen_title;
71 bool screen_msaa;
72 bool screen_vsync;
73 Types::LogLevel log_level;
74 std::string log_file;
75 std::string text_font;
76 int text_size;
77 bool gl_blending;
78 bool gl_cull_face;
79 bool gl_multisample;
80 bool gl_depth_test;
81
82 Engine(bool uses_screen, bool uses_audio, bool uses_input, bool uses_logger,
83 bool uses_text, bool uses_ecs, int screen_width, int screen_height,
84 bool screen_is_mouse_captured, bool screen_msaa, bool screen_vsync,
85 const char *screen_title, Types::LogLevel log_level,
86 std::string log_file, std::string text_font, int text_size,
87 bool gl_blending, bool gl_cull_face, bool gl_multisample,
88 bool gl_depth_test);
89 ~Engine();
90
91 class Builder;
92};
93
102{
103 public:
104 bool uses_screen = false;
105 bool uses_audio = false;
106 bool uses_input = false;
107 bool uses_logger = false;
108 bool uses_text = false;
109 bool uses_ecs = 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 Types::LogLevel log_level = Types::LogLevel::WARNING;
117 std::string log_file = "./logs/log.txt";
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 &use_ecs(bool uses_ecs);
131 Builder &set_screen_width(int screen_width);
132 Builder &set_screen_height(int screen_height);
133 Builder &set_screen_is_mouse_captured(bool screen_is_mouse_captured);
134 Builder &set_screen_title(const char *screen_title);
135 Builder &set_screen_msaa(bool screen_msaa);
136 Builder &set_screen_vsync(bool screen_vsync);
137 Builder &set_log_level(Types::LogLevel log_level);
138 Builder &set_log_file(std::string log_file);
139 Builder &set_text_font(std::string text_font);
140 Builder &set_text_size(int text_size);
141 Builder &set_gl_blending(bool gl_blending);
142 Builder &set_gl_cull_face(bool gl_cull_face);
143 Builder &set_gl_multisample(bool gl_multisample);
144 Builder &set_gl_depth_test(bool gl_depth_test);
145
146 Engine build();
147};
148
149} // namespace Brenta
150
151// Doxygen Documnetation:
152
153// cmake-format: off
699// cmake-format: on
Engine builder.
Definition engine.hpp:102
Engine setup.
Definition engine.hpp:59