Unravel Engine C++ Reference
Loading...
Searching...
No Matches
settings.h
Go to the documentation of this file.
1#pragma once
2#include <engine/engine_export.h>
3
4#include <base/basetypes.hpp>
6#include <engine/ecs/scene.h>
11#include <graphics/texture.h>
12
13#include <string>
14#include <vector>
15
16
17namespace unravel
18{
19
21{
23 {
24 std::string company;
25 std::string product;
26 std::string version;
27 friend auto operator==(const app_settings& lhs, const app_settings& rhs) -> bool = default;
28
29 auto operator=(const app_settings& rhs) -> app_settings&
30 {
31 if(this == &rhs)
32 {
33 return *this;
34 }
35 company = rhs.company;
36 product = rhs.product;
37 version = rhs.version;
38 return *this;
39 }
40 } app;
41
43 {
45 float duration_sec = 2.0f;
46
47 friend auto operator==(const splash_logo_entry& lhs, const splash_logo_entry& rhs) -> bool = default;
48 };
49
51 {
52 bool enabled = true;
53 bool show_made_with = true;
54 float fade_in_sec = 0.5f;
55 float fade_out_sec = 0.5f;
56 std::vector<splash_logo_entry> logos;
57
58 friend auto operator==(const splash_settings& lhs, const splash_settings& rhs) -> bool = default;
60
77
79 {
83
84 friend auto operator==(const graphics_settings& lhs, const graphics_settings& rhs) -> bool = default;
86
88 {
89 friend auto operator==(const resolution_settings& lhs, const resolution_settings& rhs) -> bool = default;
90
91 auto get_current_resolution_index() const -> int
92 {
93 for(size_t i = 0; i < resolutions.size(); ++i)
94 {
96 {
97 return static_cast<int>(i);
98 }
99 }
100 return 0;
101 }
103 {
104 if(index < resolutions.size())
105 {
107 }
108 }
109
111 {
112 std::string name;
113 int width;
115 float aspect; // 0 means free aspect
116
117 friend auto operator==(const resolution& lhs, const resolution& rhs) -> bool = default;
118 };
119
120 std::vector<resolution> resolutions = {
121 {"Free Aspect", 0, 0, 0.0f},
122 {"16:9 Aspect", 0, 0, 16.0f / 9.0f},
123 {"16:10 Aspect", 0, 0, 16.0f / 10.0f},
124 {"Full HD (1920x1080)", 1920, 1080, 16.0f / 9.0f},
125 {"WXGA (1366x768)", 1366, 768, 16.0f / 9.0f},
126 {"QHD (2560x1440)", 2560, 1440, 16.0f / 9.0f},
127 {"4K UHD (3840x2160)", 3840, 2160, 16.0f / 9.0f}
128 };
129
132
133
140
142 {
143 friend auto operator==(const input_settings& lhs, const input_settings& rhs) -> bool = default;
144
147
149 {
150 friend auto operator==(const layer_settings& lhs, const layer_settings& rhs) -> bool = default;
151
152 std::array<std::string, 32> layers = get_reserved_layers_as_array();
154
156 {
157 friend auto operator==(const time_settings& lhs, const time_settings& rhs) -> bool = default;
158
159 float fixed_timestep{0.02f};
162
163 friend auto operator==(const settings& lhs, const settings& rhs) -> bool = default;
164
165};
166} // namespace unravel
uint16_t index
std::string name
Definition hub.cpp:33
auto get_reserved_layers_as_array() -> const std::array< std::string, 32 > &
Thread-safe handle to an asset.
static auto get_default_mapping() -> input::action_map
Definition input.cpp:13
friend auto operator==(const app_settings &lhs, const app_settings &rhs) -> bool=default
auto operator=(const app_settings &rhs) -> app_settings &
Definition settings.h:29
friend auto operator==(const mesh_settings &lhs, const mesh_settings &rhs) -> bool=default
texture_importer_meta::compression_quality default_compression
Definition settings.h:66
friend auto operator==(const texture_importer_settings &lhs, const texture_importer_settings &rhs) -> bool=default
texture_importer_meta::texture_size default_max_size
Definition settings.h:65
struct unravel::settings::asset_settings::texture_importer_settings texture
struct unravel::settings::asset_settings::mesh_settings mesh
friend auto operator==(const asset_settings &lhs, const asset_settings &rhs) -> bool=default
friend auto operator==(const graphics_settings &lhs, const graphics_settings &rhs) -> bool=default
friend auto operator==(const input_settings &lhs, const input_settings &rhs) -> bool=default
std::array< std::string, 32 > layers
Definition settings.h:152
friend auto operator==(const layer_settings &lhs, const layer_settings &rhs) -> bool=default
friend auto operator==(const resolution &lhs, const resolution &rhs) -> bool=default
friend auto operator==(const resolution_settings &lhs, const resolution_settings &rhs) -> bool=default
auto set_current_resolution_index(size_t index) -> void
Definition settings.h:102
std::vector< resolution > resolutions
Definition settings.h:120
auto get_current_resolution_index() const -> int
Definition settings.h:91
Definition settings.h:43
friend auto operator==(const splash_logo_entry &lhs, const splash_logo_entry &rhs) -> bool=default
asset_handle< gfx::texture > logo
Definition settings.h:44
float duration_sec
Definition settings.h:45
friend auto operator==(const splash_settings &lhs, const splash_settings &rhs) -> bool=default
std::vector< splash_logo_entry > logos
Definition settings.h:56
asset_handle< scene_prefab > startup_scene
Definition settings.h:138
friend auto operator==(const standalone_settings &lhs, const standalone_settings &rhs) -> bool=default
friend auto operator==(const time_settings &lhs, const time_settings &rhs) -> bool=default
struct unravel::settings::input_settings input
struct unravel::settings::splash_settings splash
struct unravel::settings::graphics_settings graphics
friend auto operator==(const settings &lhs, const settings &rhs) -> bool=default
struct unravel::settings::app_settings app
struct unravel::settings::standalone_settings standalone
struct unravel::settings::asset_settings assets
struct unravel::settings::time_settings time
struct unravel::settings::layer_settings layer
struct unravel::settings::resolution_settings resolution