-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathconfig.hpp
79 lines (58 loc) · 1.66 KB
/
config.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
* @file liblava/app/config.hpp
* @brief Application configuration
* @authors Lava Block OÜ and contributors
* @copyright Copyright (c) 2018-present, MIT License
*/
#pragma once
#include "liblava/app/imgui.hpp"
#include "liblava/frame/window.hpp"
#include "liblava/fwd.hpp"
#include "liblava/resource/format.hpp"
namespace lava {
/**
* @brief Application configuration
*/
struct app_config : configurable {
/// Application
app* context = nullptr;
/// Organization name
name org = _liblava_;
/// Preferred compression file format
name ext = "zip";
/// Save window state
bool save_window = true;
/// Handle key events
bool handle_key_events = true;
/// Activate V-Sync
bool v_sync = false;
/// Prefer VK_PRESENT_MODE_MAILBOX_KHR over VK_PRESENT_MODE_IMMEDIATE_KHR
bool triple_buffer = true;
/// Frames per second cap
ui32 fps_cap = 0;
/// Request surface formats
surface_format_request surface;
/// Physical device index
index physical_device = 0;
/// ImGui font settings
imgui::font imgui_font;
/// Identification
string name_id = _default_;
/// @see configurable::set_json
void set_json(json_ref j) override;
/// @see configurable::get_json
json get_json() const override;
/**
* @brief Update window state
*/
void update_window_state();
/// Window state if available
window::state::optional window_state;
};
/**
* @brief Set the window icon
* @param window Target window
* @param icon_file Icon file
*/
void set_window_icon(window& window, string_ref icon_file = "icon.png");
} // namespace lava