7#include "gfx_surface_state.hpp"
8#include "draw_context.hpp"
9#include "subpixel_orientation.hpp"
10#include "gfx_system_globals.hpp"
20 gfx_surface_state state = gfx_surface_state::no_device;
24 subpixel_orientation subpixel_orientation = subpixel_orientation::BlueRight;
34 virtual void init() {}
36 gfx_surface(gfx_system &system) : system(system) {}
45 [[nodiscard]]
gfx_device *device() const noexcept
55 void set_closed() noexcept
57 ttlet lock = std::scoped_lock(gfx_system_mutex);
58 state = gfx_surface_state::window_lost;
61 [[nodiscard]]
bool is_closed() const noexcept
63 ttlet lock = std::scoped_lock(gfx_system_mutex);
64 return state == gfx_surface_state::no_window;
75 [[nodiscard]]
virtual std::optional<draw_context> render_start(
aarectangle redraw_rectangle) = 0;
76 virtual void render_finish(
draw_context const &context,
color background_color) = 0;
81 virtual void teardown() = 0;
This is a RGBA floating point color.
Definition color.hpp:36
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:20
Draw context for drawing using the TTauri shaders.
Definition draw_context.hpp:28
Definition gfx_device.hpp:22
Definition gfx_surface.hpp:16
virtual void set_device(gfx_device *device) noexcept
virtual extent2 size() const noexcept=0
Get the size of the surface.
virtual void update(extent2 new_size) noexcept=0
Update the surface.
Graphics system.
Definition gfx_system.hpp:21
int recurse_lock_count() const noexcept
This function should be used in tt_axiom() to check if the lock is held by current thread.
Definition unfair_recursive_mutex.hpp:60