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;
27 subpixel_orientation subpixel_orientation = subpixel_orientation::BlueRight;
37 virtual void init() {}
39 gfx_surface(gfx_system &system) : system(system) {}
48 [[nodiscard]]
gfx_device *device() const noexcept
54 void set_closed() noexcept
56 ttlet lock = std::scoped_lock(gfx_system_mutex);
57 state = gfx_surface_state::window_lost;
60 [[nodiscard]]
bool is_closed() const noexcept
62 ttlet lock = std::scoped_lock(gfx_system_mutex);
63 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:29
Definition gfx_device.hpp:22
Definition gfx_surface.hpp:16
virtual void set_device(gfx_device *device) noexcept
virtual extent2 update(extent2 minimum_size, extent2 maximum_size) noexcept=0
Update the surface.
extent2 size
The current size of the surface.
Definition gfx_surface.hpp:23
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