49 const void* initial_pixel_data =
nullptr);
59 [[nodiscard]] uint32_t
get_width()
const {
return m_width; }
60 [[nodiscard]] uint32_t
get_height()
const {
return m_height; }
71 [[nodiscard]] std::shared_ptr<Core::VKImage>
get_texture()
const {
return m_gpu_texture; }
72 [[nodiscard]]
bool has_texture()
const {
return m_gpu_texture !=
nullptr; }
76 return m_texture_processor;
86 void set_pixel_data(
const void* data,
size_t size);
92 void mark_pixels_dirty();
105 void set_position(
float x,
float y);
114 void set_scale(
float width,
float height);
122 void set_rotation(
float angle_radians);
125 [[nodiscard]] glm::vec2
get_scale()
const {
return m_scale; }
132 void set_custom_vertices(
const std::vector<Nodes::TextureQuadVertex>& vertices);
138 void use_default_quad();
140 [[nodiscard]]
const std::vector<uint8_t>&
get_pixel_data()
const {
return m_pixel_data; }
150 void setup_rendering(
const RenderConfig& config);
154 return m_render_processor;
164 m_texture_processor = processor;
179 bool m_texture_dirty =
true;
182 glm::vec2 m_position { 0.0F, 0.0F };
183 glm::vec2 m_scale { 1.0F, 1.0F };
184 float m_rotation { 0.0F };
185 bool m_geometry_dirty =
true;
189 bool m_uses_custom_vertices =
false;
196 void generate_default_quad();
197 void generate_quad_with_transform();
198 static size_t calculate_quad_vertex_size();
std::shared_ptr< TextureProcessor > get_texture_processor() const
uint32_t get_width() const
std::shared_ptr< TextureProcessor > m_texture_processor
std::shared_ptr< Core::VKImage > m_gpu_texture
Portal::Graphics::ImageFormat get_format() const
std::vector< uint8_t > m_pixel_data
void mark_texture_dirty()
std::shared_ptr< RenderProcessor > m_render_processor
bool is_texture_dirty() const
float get_rotation() const
~TextureBuffer() override=default
glm::vec2 get_scale() const
uint32_t get_height() const
glm::vec2 get_position() const
const std::vector< uint8_t > & get_pixel_data() const
Portal::Graphics::ImageFormat m_format
std::shared_ptr< Core::VKImage > get_texture() const
Get GPU texture image Suitable for binding to shaders via RenderProcessor::bind_texture()
std::vector< uint8_t > m_vertex_bytes
std::shared_ptr< RenderProcessor > get_render_processor() const
void set_texture_processor(const std::shared_ptr< TextureProcessor > &processor)
Allow inherited classes to set the TextureProcessor directly.
A hybrid buffer managing both a textured quad geometry and its pixel data.
Internal processor: handles CPU→GPU transfers for TextureBuffer.