HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
src
hikogui
GFX
gfx_system.hpp
1
// Copyright Take Vos 2020.
2
// Distributed under the Boost Software License, Version 1.0.
3
// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5
#pragma once
6
7
#include "gfx_device.hpp"
8
#include "../unfair_recursive_mutex.hpp"
9
#include "../subsystem.hpp"
10
#include <span>
11
#include <memory>
12
#include <mutex>
13
#include <thread>
14
#include <vector>
15
16
namespace
hi::inline v1 {
17
class
gfx_surface;
18
21
class
gfx_system
{
22
public
:
24
std::vector<std::shared_ptr<gfx_device>
>
devices
;
25
26
gfx_system
() noexcept;
27
28
virtual ~
gfx_system
();
29
30
gfx_system
(const
gfx_system
&) = delete;
31
gfx_system
&operator=(const
gfx_system
&) = delete;
32
gfx_system
(
gfx_system
&&) = delete;
33
gfx_system
&operator=(
gfx_system
&&) = delete;
34
38
virtual
void
init(){};
39
virtual
void
deinit(){};
40
41
[[nodiscard]]
virtual
std::unique_ptr<gfx_surface>
make_surface(os_handle instance,
void
*os_window)
const
noexcept
= 0;
42
43
void
log_memory_usage() const noexcept {
44
for
(
hilet
&device: devices) {
45
device->log_memory_usage();
46
}
47
}
48
49
gfx_device *find_best_device_for_surface(gfx_surface
const
&surface);
50
};
51
52
}
// namespace hi::inline v1
hilet
#define hilet
Invariant should be the default for variables.
Definition
required.hpp:23
v1::gfx_system
Graphics system.
Definition
gfx_system.hpp:21
v1::gfx_system::devices
std::vector< std::shared_ptr< gfx_device > > devices
List of all devices.
Definition
gfx_system.hpp:24
std::unique_ptr
std::vector
Generated on Mon Apr 22 2024 12:53:25 for HikoGUI by
1.10.0