Flint Engine
Modular C++20 2D game engine powered by SDL3
Loading...
Searching...
No Matches
sprite.h
1
// SPDX-License-Identifier: MIT
2
// SPDX-FileCopyrightText: 2025-2026 Manuel Osorio
3
#pragma once
4
#include "flint/graphics/gpu/gpu-texture.h"
5
#include "flint/ui/ui-node.h"
6
7
namespace
Flint {
8
16
class
UISprite
:
public
UINode
{
17
public
:
18
UISprite
() =
default
;
19
22
explicit
UISprite
(
GPUTexture
&texture);
23
~UISprite
()
override
=
default
;
24
25
void
setTexture(
GPUTexture
&texture);
26
27
void
measure
(
UIConstraints
constraints)
override
;
28
void
arrange
(
const
Rect<float>
&rect)
override
;
29
void
render
(
UICanvas
&canvas)
const override
;
30
31
private
:
32
GPUTexture
*m_texture =
nullptr
;
33
};
34
35
}
Flint::GPUTexture
Owns an SDL GPU texture and its associated sampler.
Definition
gpu-texture.h:20
Flint::UICanvas
Dynamic 2D batching engine processing shape vector geometry and hardware-accelerated text strings....
Definition
ui-canvas.h:106
Flint::UINode
Abstract base class for all UI widgets, managing hierarchy tracking, layout passes,...
Definition
ui-node.h:30
Flint::UISprite::arrange
void arrange(const Rect< float > &rect) override
Pass 2 of the layout engine: Evaluates layout adjustments to pin final screen coordinate values to th...
Flint::UISprite::render
void render(UICanvas &canvas) const override
Pushes current styling rules and geometries straight down to the active pipeline vertex drawing queue...
Flint::UISprite::measure
void measure(UIConstraints constraints) override
Pass 1 of the layout engine: Crawls branches recursively to compute base display boundaries requested...
Flint::UISprite
A static texture rendering frame component wrapper.
Definition
sprite.h:16
Flint::UISprite::UISprite
UISprite(GPUTexture &texture)
Hooks the sprite wrapper directly to a non-owning raw handle texture resource asset.
Flint::Rect
Generic axis-aligned rectangle defined by a position and size.
Definition
types.h:87
Flint::UIConstraints
Represents the boundary budget passed down the node tree during layout allocation.
Definition
ui-types.h:76
include
flint
ui
widgets
sprite.h
Generated by
1.12.0