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
5
#include "flint/core/api.h"
6
#include "flint/graphics/gpu/gpu-texture.h"
7
#include "flint/ui/ui-node.h"
8
9
namespace
Flint {
10
18
class
UISprite
:
public
UINode
{
19
public
:
20
UISprite
() =
default
;
21
24
FLINT_API
explicit
UISprite
(
GPUTexture
&texture);
25
~UISprite
()
override
=
default
;
26
27
FLINT_API
void
setTexture(
GPUTexture
&texture);
28
29
FLINT_API
void
measure
(
UIConstraints
constraints)
override
;
30
FLINT_API
void
arrange
(
const
Rect<float>
&rect)
override
;
31
FLINT_API
void
render
(
UICanvas
&canvas)
const override
;
32
33
private
:
34
GPUTexture
*m_texture =
nullptr
;
35
};
36
37
}
Flint::GPUTexture
Owns an SDL GPU texture and its associated sampler.
Definition
gpu-texture.h:21
Flint::UICanvas
Dynamic 2D batching engine processing shape vector geometry and hardware-accelerated text strings....
Definition
ui-canvas.h:107
Flint::UINode
Abstract base class for all UI widgets, managing hierarchy tracking, layout passes,...
Definition
ui-node.h:31
Flint::UISprite
A static texture rendering frame component wrapper.
Definition
sprite.h:18
Flint::UISprite::arrange
FLINT_API 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
FLINT_API void render(UICanvas &canvas) const override
Pushes current styling rules and geometries straight down to the active pipeline vertex drawing queue...
Flint::UISprite::UISprite
FLINT_API UISprite(GPUTexture &texture)
Hooks the sprite wrapper directly to a non-owning raw handle texture resource asset.
Flint::UISprite::measure
FLINT_API void measure(UIConstraints constraints) override
Pass 1 of the layout engine: Crawls branches recursively to compute base display boundaries requested...
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