34 using TextureBuffer::TextureBuffer;
40 [[nodiscard]]
bool has_budget()
const {
return m_budget_width > 0; }
48 return m_budget_width > 0 ? m_budget_width : get_width();
57 return m_budget_height > 0 ? m_budget_height : get_height();
78 [[nodiscard]]
const uint32_t&
get_cursor_x()
const {
return m_cursor_x; }
85 [[nodiscard]]
const uint32_t&
get_cursor_y()
const {
return m_cursor_y; }
104 m_render_bounds_w = w;
105 m_render_bounds_h =
h;
127 void setup_rendering(
const RenderConfig& config)
override;
132 uint32_t m_budget_width {};
134 uint32_t m_budget_height {};
136 uint32_t m_cursor_x {};
137 uint32_t m_cursor_y {};
139 uint32_t m_render_bounds_w { 1280 };
140 uint32_t m_render_bounds_h { 720 };
uint32_t & get_cursor_y()
void set_render_bounds(uint32_t w, uint32_t h)
Hard render bounds.
void clear_accumulated_text()
uint32_t & get_cursor_x()
uint32_t get_render_bounds_h() const
bool has_budget() const
Whether this buffer was created with a pre-allocated budget exceeding the initial content dimensions.
uint32_t get_render_bounds_w() const
const uint32_t & get_cursor_x() const
Horizontal pen position in pixels for the next impress() run.
std::string m_accumulated_text
uint32_t get_budget_width() const
Full allocated GPU texture width.
const uint32_t & get_cursor_y() const
Vertical baseline position in pixels for the next impress() run.
void set_budget(uint32_t w, uint32_t h)
Sets the budget dimensions for this buffer.
void reset_cursor()
Resets the write cursor to the origin.
const std::string & get_accumulated_text() const
Full accumulated text composited into this buffer since the last repress().
void append_accumulated_text(std::string_view s)
void set_accumulated_text(std::string_view s)
uint32_t get_budget_height() const
Full allocated GPU texture height.
TextureBuffer specialization for CPU-composited glyph textures.
A hybrid buffer managing both a textured quad geometry and its pixel data.