Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
SpriteSystem.hpp
Go to the documentation of this file.
1#pragma once
2#include "ecs/System.hpp"
3#include "ecs/Registry.hpp"
6
7namespace Engine {
8
26 public:
33
39 void update(float dt) override;
40
41 private:
44
46 uint32_t m_quadMeshId = 0;
47
52 uint32_t getOrCreateQuadMesh();
53
59 void setupSprite(Entity entity, SpriteRenderer& sprite);
60
66 void syncSprite(Entity entity, SpriteRenderer& sprite);
67 };
68
69} // namespace Engine
#define ENGINE_API
Definition EngineAPI.hpp:10
void setupSprite(Entity entity, SpriteRenderer &sprite)
Performs initial setup for a newly-seen SpriteRenderer entity.
Definition SpriteSystem.cpp:73
SpriteSystem(Registry &reg, VulkanRenderer &rend)
Construct a new Sprite System.
Definition SpriteSystem.cpp:14
VulkanRenderer & renderer
Definition SpriteSystem.hpp:43
Registry & registry
Definition SpriteSystem.hpp:42
void update(float dt) override
Per-frame update: synchronises all SpriteRenderer components with their Mesh and Material counterpart...
Definition SpriteSystem.cpp:29
uint32_t getOrCreateQuadMesh()
Ensures the shared unit quad mesh exists and is uploaded to the GPU.
Definition SpriteSystem.cpp:44
void syncSprite(Entity entity, SpriteRenderer &sprite)
Syncs a SpriteRenderer component's colour, texture, and sort order to its Material.
Definition SpriteSystem.cpp:136
uint32_t m_quadMeshId
Shared quad mesh ID (reused across all sprites). 0 = not yet created.
Definition SpriteSystem.hpp:46
Lightweight identifier representing a game object in the Entity Component System.
Definition Entity.hpp:11
Coordinates entities and components, providing creation, removal, lookup, and views.
Definition Registry.hpp:30
Base class for ECS systems that process sets of entities.
Definition System.hpp:12
Manages core Vulkan pipeline states, device interaction, frames, buffers, and command submissions.
Definition VulkanRenderer.hpp:127
Definition Application.hpp:16
Component that renders a textured 2D quad (sprite) on an entity.
Definition SpriteRenderer.hpp:24