7#include "gfx_draw_context.hpp"
8#include "gfx_surface_state.hpp"
9#include "gfx_system_globals.hpp"
11namespace hi::inline
v1 {
14class gfx_surface_delegate;
23 virtual ~gfx_surface() {}
25 gfx_surface(
const gfx_surface &) =
delete;
26 gfx_surface &operator=(
const gfx_surface &) =
delete;
27 gfx_surface(gfx_surface &&) =
delete;
28 gfx_surface &operator=(gfx_surface &&) =
delete;
30 virtual void init() {}
32 gfx_surface(
gfx_system &system) : system(system) {}
41 [[nodiscard]]
gfx_device *device() const noexcept
49 [[nodiscard]]
virtual extent2
size() const noexcept = 0;
57 virtual
void update(extent2 new_size) noexcept = 0;
60 [[nodiscard]] virtual
std::optional<gfx_draw_context> render_start(aarectangle redraw_rectangle) = 0;
61 virtual
void render_finish(gfx_draw_context const& context) = 0;
76 virtual
void teardown() noexcept = 0;
#define hi_axiom(expression,...)
Specify an axiom; an expression that is true.
Definition assert.hpp:253
DOXYGEN BUG.
Definition algorithm.hpp:13
unfair_recursive_mutex gfx_system_mutex
Global mutex for GUI elements, like gfx_system, gfx_device.
Definition gfx_system_globals.hpp:14
gfx_surface_state
Definition gfx_surface_state.hpp:9
@ has_window
The initial state: The surface is associated with a window.
Definition gfx_surface_state.hpp:11
gfx_surface_loss
Definition gfx_surface_state.hpp:16
@ none
Everything is running normally.
Definition gfx_surface_state.hpp:17
Definition gfx_device.hpp:20
virtual void set_device(gfx_device *device) noexcept
virtual void add_delegate(gfx_surface_delegate *delegate) noexcept=0
Add a delegate to handle extra rendering.
virtual void remove_delegate(gfx_surface_delegate *delegate) noexcept=0
Remove a delegate.
virtual extent2 size() const noexcept=0
Get the size of the surface.
virtual void update(extent2 new_size) noexcept=0
Update the surface.
Definition gfx_surface_delegate.hpp:9
Graphics system.
Definition gfx_system.hpp:20