5#include "flint/graphics/drawable.h"
6#include "flint/graphics/gpu/gpu-texture.h"
7#include "flint/graphics/types/color.h"
8#include "flint/math/types.h"
97 FloatRect m_dstRect = {
101 Vec2f m_position = {0, 0};
102 Vec2f m_scale = {1, 1};
103 float m_rotation = 0.0f;
104 Vec2f m_origin = {0, 0};
105 Color m_color = {255, 255, 255, 255};
Interface for objects that contribute ordered work to a rendered frame.
Owns an SDL GPU texture and its associated sampler.
Batches drawables into sorted geometry, primitive, and custom execution passes for GPURenderer.
void setTextureRect(const IntRect &rect)
Set the source rectangle (sub-region) within the texture.
void setRotation(float rotation)
Set the rotation angle.
Sprite(GPUTexture *texture)
Construct a Sprite backed by texture.
void setColor(const Color &color)
Set the RGBA tint color multiplied against the texture.
void emit(RenderQueue &queue) const override
Emit this drawable's rendering work for the current frame.
void setOrigin(const Vec2f &origin)
Set the local pivot point used for rotation and positioning.
void setPosition(const Vec2f &pos)
Set the world-space position of the sprite's local origin.
void setScale(const Vec2f &scale)
Set per-axis scale factors.
void move(const Vec2f &offset)
Translate the sprite by offset.
A 2-D textured quad that references a GPUTexture.
const Color & getColor() const
Get the current tint color.
const FloatRect & getSrcRect() const
Get the current source rectangle in texture space.
const FloatRect & getDstRect() const
Get the current destination rectangle in world space.
float getRotation() const
Get the current rotation angle in radians.
const Vec2f & getScale() const
Get the current scale factors.
const Vec2f & getOrigin() const
Get the current local pivot point.
const Vec2f & getPosition() const
Get the current world-space position.
RGBA color with 8-bit unsigned components.
Generic axis-aligned rectangle defined by a position and size.