Sprite¶
High-level sprite handling utilities.
Overview¶
Typical use cases:
Managing sprite instances and rendering.
Header¶
<RaeptorCogs/Sprite.hpp>
Metadata¶
- Author
Estorc
- Version
v1.0
- Copyright
Copyright (c) 2025 Estorc MIT License.
Classes¶
Class |
Description |
|---|---|
|
Class representing a 2D sprite. |
-
class Sprite2D : public RaeptorCogs::TransformableGraphic2D¶
Class representing a 2D sprite.
Manages texture and rendering for a 2D sprite. Inherits from TransformableGraphic2D to provide transformation capabilities.
See also
Public Functions
-
Sprite2D(Texture &texture)¶
Constructor for Sprite2D with a texture.
- Parameters:
texture – Texture to associate with the sprite.
-
virtual bool computeInstanceData(GAPI::Common::InstanceAllocator &instanceAllocator, ComputeInstanceDataMode mode = ComputeInstanceDataMode::NONE) override¶
Compute instance data for the sprite.
- Parameters:
instanceAllocator – Reference to the instance allocator.
mode – Mode for computing instance data.
- Returns:
true if updates were made, false otherwise.
-
virtual void bind() const override¶
Bind the sprite for rendering.
Note
Overrides the bind method from Graphic2D.
-
virtual GLuint getID() const override¶
Get the unique ID of the sprite.
- Returns:
Unique ID of the sprite.
-
virtual bool isOpaque() const override¶
Check if the sprite is opaque.
- Returns:
true if the sprite is opaque, false otherwise.
-
virtual bool isVisible() const override¶
Check if the sprite is visible.
- Returns:
true if the sprite is visible, false otherwise.
-
Sprite2D(Texture &texture)¶