Change demo to showcase instancing.

This commit is contained in:
2025-01-03 19:36:42 -05:00
parent 6664925621
commit 283678e257
7 changed files with 55 additions and 24 deletions

View File

@@ -21,8 +21,9 @@ public:
* If there is no instanced alpha mask and unique alpha mask is set
* to nullptr, Then there is no alpha mask. - Redacted.
*/
~InstancedSprite() override;
InstancedSprite(const Vector2& position, unsigned int layer, const std::string& instanced_texture_filesystem_path,
float face_angle = 0.0f, const Color4& base_color = Colors::White, Texture* unique_alpha_mask = nullptr, const std::string& instanced_alpha_mask_filesystem_path = "")
: texture_path(instanced_texture_filesystem_path), alpha_mask_path(instanced_alpha_mask_filesystem_path),
Sprite(position, layer, face_angle, base_color, nullptr, unique_alpha_mask) {}
: Sprite(position, layer, face_angle, base_color, nullptr, unique_alpha_mask), texture_path(instanced_texture_filesystem_path),
alpha_mask_path(instanced_alpha_mask_filesystem_path) {}
};

View File

@@ -34,8 +34,11 @@ public:
[[nodiscard]] size_t EntityCount() const;
[[nodiscard]] std::string GetName() const;
[[nodiscard]] Camera* GetActiveCamera() const;
[[nodiscard]] Texture* GetInstancedTexture(const InstancedSprite* user);
[[nodiscard]] Texture* GetInstancedAlphaMask(const InstancedSprite* user);
[[nodiscard]] InstancedTexture* GetInstancedTexture(const InstancedSprite* user);
[[nodiscard]] InstancedTexture* GetInstancedAlphaMask(const InstancedSprite* user);
void DestroyInstancedTexture(const InstancedTexture* itx);
void DestroyInstancedAlphaMask(const InstancedTexture* alpha_mask);
public:
void AppendEntity(Entity* entity);
void AppendFixed(Fixed* fixed);