HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
gfx_system.hpp
1// Copyright Take Vos 2021.
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 "../utility/module.hpp"
9#include <span>
10#include <memory>
11#include <mutex>
12#include <thread>
13#include <vector>
14
15namespace hi::inline v1 {
16class gfx_surface;
17
21public:
24
25 gfx_system() noexcept;
26
27 virtual ~gfx_system();
28
29 gfx_system(const gfx_system &) = delete;
30 gfx_system &operator=(const gfx_system &) = delete;
31 gfx_system(gfx_system &&) = delete;
32 gfx_system &operator=(gfx_system &&) = delete;
33
37 virtual void init(){};
38 virtual void deinit(){};
39
40 [[nodiscard]] virtual std::unique_ptr<gfx_surface> make_surface(os_handle instance, void *os_window) const noexcept = 0;
41
42 void log_memory_usage() const noexcept {
43 for (hilet &device: devices) {
44 device->log_memory_usage();
45 }
46 }
47
48 gfx_device *find_best_device_for_surface(gfx_surface const &surface);
49};
50
51} // namespace hi::inline v1
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:13
Graphics system.
Definition gfx_system.hpp:20
std::vector< std::shared_ptr< gfx_device > > devices
List of all devices.
Definition gfx_system.hpp:23