ReXGlue SDK
Loading...
Searching...
No Matches
graphics_system.h
Go to the documentation of this file.
1
10
11#pragma once
12
13#include <string>
14
15#include <rex/module.h>
16#include <rex/platform.h>
17#include <rex/setting.h>
19#include <rex/types.h>
20
21namespace rex::gpu {
22
23struct FrameStats {
24 f64 frame_time_ms = 0.0;
25 f64 fps = 0.0;
26 u64 frame_count = 0;
27};
28
29class REX_GPU_API GraphicsSettings final : public SettingOwner {
30 public:
31 GraphicsSettings();
32
33 REX_SETTING(
34 std::string, driver, "any",
35 "Graphics driver within the title's family. Values are d3d12, vulkan, null, none for no "
36 "driver in an app that does not require one, or any for d3d12 on Windows and vulkan "
37 "elsewhere",
38 kStartupOnly);
39 REX_SETTING(bool, vsync, true, "Wait for vertical blank when presenting");
40 REX_SETTING(f64, frame_limit, 0.0, "Most presents per second, 0 for no limit",
41 Range{0.0, 1000.0});
42 REX_SETTING(i32, resolution_scale_x, 1, "Draw resolution scale X", Range{1, 8}, kRestart);
43 REX_SETTING(i32, resolution_scale_y, 1, "Draw resolution scale Y", Range{1, 8}, kRestart);
44 REX_SETTING(i32, anisotropic_override, 3,
45 "Anisotropic filtering, -1 for the title's choice, 0 for off, 1 to 5 for 1x to 16x",
46 Range{-1, 5});
47};
48
55 virtual GraphicsSettings& GetSettings() = 0;
56
57 virtual bool HasDriver() const = 0;
58
60 virtual std::string GetDriverName() const = 0;
61
65 virtual void ReportFrame() = 0;
66
68 virtual FrameStats GetFrameStats() const = 0;
69};
70
71} // namespace rex::gpu
SettingOwner(std::string_view scope)
Definition graphics_system.h:29
Definition graphics_system.h:54
Interfaces, factory and module declaration.
#define REX_DECLARE_INTERFACE(Name, version)
Definition module.h:114
Definition app.h:38
Platform flags, packing macros and export markers.
#define REX_GPU_API
Definition platform.h:245
Typed settings and the owners that declare them.
The registry of every registered setting.
Definition setting.h:78
Definition graphics_system.h:23
u64 frame_count
Definition graphics_system.h:26
f64 frame_time_ms
Definition graphics_system.h:24
Integer types, byte order wrappers and size literals.