libER 0.1.4.2
ELDEN RING API library
Loading...
Searching...
No Matches
window.hpp
Go to the documentation of this file.
1
7#pragma once
8
9#include <detail/preprocessor.hpp>
10#include <fd4/component.hpp>
13
14namespace from {
15namespace CS {
16
17class CSWindow;
18class CSScreenModeCtrl;
19
25public:
26 FD4_SINGLETON_CLASS(CSWindow);
27
28 virtual ~CSWindow() LIBER_INTERFACE_ONLY;
29
31 using window_handle_type = void*;
32 using window_position_type = std::pair<int, int>;
33 using window_size_type = std::pair<int, int>;
35
40 enum class screen_mode : int {
41 window = 0,
42 fullscreen = 1,
43 borderless_window = 2,
44 };
45
50 enum class quality_level : int {
51 off = 0,
52 low = 1,
53 medium = 2,
54 high = 3,
55 max = 4,
56 };
57
61 bool auto_detect_best_rendering_settings;
62 quality_level graphics_quality;
63 quality_level texture_quality;
64 quality_level antialiasing_quality;
65 quality_level ssao;
66 quality_level depth_of_field;
67 quality_level motion_blur;
68 quality_level shadow_quality;
69 quality_level lighting_quality;
70 quality_level effects_quality;
71 quality_level reflection_quality;
72 quality_level water_surface_quality;
73 quality_level shader_quality;
74 quality_level volumetric_quality;
75 quality_level ray_tracing_quality;
76 quality_level global_illumination_quality;
77 quality_level grass_quality;
79 };
80
85 window_handle_type get_window_handle() const {
86 return this->window_handle;
87 }
88
93 window_position_type get_window_position() const {
94 return this->window_position;
95 }
96
100 window_size_type get_window_size() const {
101 return this->window_size;
102 }
103
109 bool is_window_fullscreen() const {
110 return this->window_full_screen;
111 }
112
117 return this->window_focused;
118 }
119
123 bool is_window_focused() const {
124 return this->window_focused;
125 }
126
133
138 return this->graphics_settings;
139 }
140
145 this->graphics_settings = graphics_settings;
146 }
147
148private:
149 window_handle_type window_handle;
150 int liber_unknown[4];
151 window_position_type window_position;
152 window_size_type window_size;
153 int liber_unknown[2];
154 CSScreenModeCtrl* screen_mode_ctrl;
155 int liber_unknown[8];
156 bool liber_unknown;
157 bool window_focused_previous;
158 bool window_full_screen;
159 bool window_focused;
160 int liber_unknown[32];
161 graphics_settings graphics_settings;
162};
163
164LIBER_ASSERTS_BEGIN(CSWindow);
165LIBER_ASSERT_OFFS(0x8, window_handle);
166LIBER_ASSERT_OFFS(0x20, window_position);
167LIBER_ASSERT_OFFS(0x28, window_size);
168LIBER_ASSERT_OFFS(0x38, screen_mode_ctrl);
169LIBER_ASSERT_OFFS(0x61, window_focused_previous);
170LIBER_ASSERT_OFFS(0x62, window_full_screen);
171LIBER_ASSERT_OFFS(0x63, window_focused);
172LIBER_ASSERT_OFFS(0xe4, graphics_settings.screen_mode);
173LIBER_ASSERT_OFFS(0xe8, graphics_settings.auto_detect_best_rendering_settings);
174LIBER_ASSERT_OFFS(0xec, graphics_settings.graphics_quality);
175LIBER_ASSERT_OFFS(0xf0, graphics_settings.texture_quality);
176LIBER_ASSERT_OFFS(0xf4, graphics_settings.antialiasing_quality);
177LIBER_ASSERT_OFFS(0xf8, graphics_settings.ssao);
178LIBER_ASSERT_OFFS(0xfc, graphics_settings.depth_of_field);
179LIBER_ASSERT_OFFS(0x100, graphics_settings.motion_blur);
180LIBER_ASSERT_OFFS(0x104, graphics_settings.shadow_quality);
181LIBER_ASSERT_OFFS(0x108, graphics_settings.lighting_quality);
182LIBER_ASSERT_OFFS(0x10c, graphics_settings.effects_quality);
183LIBER_ASSERT_OFFS(0x110, graphics_settings.reflection_quality);
184LIBER_ASSERT_OFFS(0x114, graphics_settings.water_surface_quality);
185LIBER_ASSERT_OFFS(0x118, graphics_settings.shader_quality);
186LIBER_ASSERT_OFFS(0x11c, graphics_settings.volumetric_quality);
187LIBER_ASSERT_OFFS(0x120, graphics_settings.ray_tracing_quality);
188LIBER_ASSERT_OFFS(0x124, graphics_settings.global_illumination_quality);
189LIBER_ASSERT_OFFS(0x128, graphics_settings.grass_quality);
190LIBER_ASSERT_OFFS(0x128, graphics_settings.grass_quality);
191LIBER_ASSERTS_END;
192
193} // namespace CS
194} // namespace from
The singleton responsible for managing the game window and graphics settings.
Definition window.hpp:24
graphics_settings & get_graphics_settings()
Return the current graphics quality settings.
Definition window.hpp:130
window_position_type get_window_position() const
Return a read-only view of the window position (if the game is in windowed mode)
Definition window.hpp:93
bool is_window_fullscreen() const
Check if the window is currently full screen.
Definition window.hpp:109
quality_level
The quality of a graphics_settings entry.
Definition window.hpp:50
bool is_window_focused() const
Check if the window is currently focused.
Definition window.hpp:123
const graphics_settings & get_graphics_settings() const
Return the current graphics quality settings.
Definition window.hpp:137
window_handle_type get_window_handle() const
Return a Win32 API window handle for the main Elden Ring game window.
Definition window.hpp:85
void set_graphics_settings(const graphics_settings &graphics_settings)
Set the graphics quality settings.
Definition window.hpp:144
screen_mode
The window screen mode.
Definition window.hpp:40
bool is_window_focused_previous() const
Check if the window was focused on the previous frame.
Definition window.hpp:116
window_size_type get_window_size() const
Return a read-only view of the window width and height.
Definition window.hpp:100
FD4ComponentBase implementation.
from::basic_string based on std::basic_string
FD4_SINGLETON_CLASS implementation.
Reflection implementation for a given class.
Definition component.hpp:34