|
Flint Engine
Modular C++20 2D game engine powered by SDL3
|
Interface for objects that contribute ordered work to a rendered frame. More...
#include <flint/graphics/drawable.h>
Inheritance diagram for Flint::Drawable:
Collaboration diagram for Flint::Drawable:Public Member Functions | |
| virtual void | emit (RenderQueue &queue) const =0 |
| Emit this drawable's rendering work for the current frame. | |
| void | setGPUTexture (GPUTexture *texture) |
| Associate a texture with this drawable. | |
| GPUTexture * | getGPUTexture () const |
| Get the associated GPU texture. | |
Protected Attributes | |
| GPUTexture * | m_gpuTexture = nullptr |
| Non-owning reference to the GPU texture asset. | |
Interface for objects that contribute ordered work to a rendered frame.
Concrete drawables implement emit() to describe their geometry or custom rendering through RenderQueue.
Definition at line 21 of file drawable.h.
|
pure virtual |
Emit this drawable's rendering work for the current frame.
Called once after submitted drawables have been sorted by DrawLayer. Implementations must enqueue work through queue rather than issuing immediate GPU commands.
| queue | Queue receiving this drawable's rendering work. |
Implemented in Flint::CircleShape, Flint::PrimitiveArray, Flint::RectangleShape, and Flint::Sprite.
|
inlinenodiscard |
Get the associated GPU texture.
Definition at line 51 of file drawable.h.
|
inline |
Associate a texture with this drawable.
| texture | Non-owning pointer. It must remain valid while the drawable may be submitted. |
Definition at line 42 of file drawable.h.
|
protected |
Non-owning reference to the GPU texture asset.
Definition at line 56 of file drawable.h.