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>
10
11#include <string>
12#include <vector>
13
14
15namespace unravel
16{
17
19{
21 {
22 std::string company;
23 std::string product;
24 std::string version;
25 friend auto operator==(const app_settings& lhs, const app_settings& rhs) -> bool = default;
26 } app;
27
44
46 {
47 friend auto operator==(const graphics_settings& lhs, const graphics_settings& rhs) -> bool = default;
49
51 {
52 friend auto operator==(const resolution_settings& lhs, const resolution_settings& rhs) -> bool = default;
53
54 auto get_current_resolution_index() const -> int
55 {
56 for(size_t i = 0; i < resolutions.size(); ++i)
57 {
59 {
60 return static_cast<int>(i);
61 }
62 }
63 return 0;
64 }
65 auto set_current_resolution_index(size_t index) -> void
66 {
67 if(index < resolutions.size())
68 {
70 }
71 }
72
74 {
75 std::string name;
76 int width;
77 int height;
78 float aspect; // 0 means free aspect
79
80 friend auto operator==(const resolution& lhs, const resolution& rhs) -> bool = default;
81 };
82
83 std::vector<resolution> resolutions = {
84 {"Free Aspect", 0, 0, 0.0f},
85 {"16:9 Aspect", 0, 0, 16.0f / 9.0f},
86 {"16:10 Aspect", 0, 0, 16.0f / 10.0f},
87 {"Full HD (1920x1080)", 1920, 1080, 16.0f / 9.0f},
88 {"WXGA (1366x768)", 1366, 768, 16.0f / 9.0f},
89 {"QHD (2560x1440)", 2560, 1440, 16.0f / 9.0f},
90 {"4K UHD (3840x2160)", 3840, 2160, 16.0f / 9.0f}
91 };
92
95
96
103
105 {
106 friend auto operator==(const input_settings& lhs, const input_settings& rhs) -> bool = default;
107
110
112 {
113 friend auto operator==(const layer_settings& lhs, const layer_settings& rhs) -> bool = default;
114
115 std::array<std::string, 32> layers = get_reserved_layers_as_array();
117
119 {
120 friend auto operator==(const time_settings& lhs, const time_settings& rhs) -> bool = default;
121
122 float fixed_timestep{0.02f};
125
126 friend auto operator==(const settings& lhs, const settings& rhs) -> bool = default;
127
128};
129} // namespace unravel
std::string name
Definition hub.cpp:27
auto get_reserved_layers_as_array() -> const std::array< std::string, 32 > &
Represents a handle to an asset, providing access and management functions.
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
friend auto operator==(const mesh_settings &lhs, const mesh_settings &rhs) -> bool=default
texture_importer_meta::compression_quality default_compression
Definition settings.h:33
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:32
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:115
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:65
std::vector< resolution > resolutions
Definition settings.h:83
auto get_current_resolution_index() const -> int
Definition settings.h:54
asset_handle< scene_prefab > startup_scene
Definition settings.h:101
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::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