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 "../unfair_recursive_mutex.hpp"
9#include "../subsystem.hpp"
10#include <span>
11#include <memory>
12#include <mutex>
13#include <thread>
14#include <vector>
15
16namespace hi::inline v1 {
17class gfx_surface;
18
22public:
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
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:15
Graphics system.
Definition gfx_system.hpp:21
std::vector< std::shared_ptr< gfx_device > > devices
List of all devices.
Definition gfx_system.hpp:24