![]() |
Rendering Engine 0.2.0
Modular Graphics Rendering Engine | v0.2.0
|
2D drawable component for rendering objects in 2D space. More...
#include <drawable_2d.hpp>
Inherits rendering_engine::DrawableComponent.
Inherited by rendering_engine::Quad2D.
Public Member Functions | |
| Drawable2D (RenderResourceContext renderContext) | |
| Constructs the Drawable2D with a resource context. | |
| void | Initialize () override |
| Initializes render resources. | |
| void | Update (float deltaTime) override |
| Updates model matrix (and any other logic). | |
| virtual void | Draw (const Camera2D &camera)=0 |
| Submits this quad to the renderer for drawing. | |
| void | SetPosition (const glm::vec2 &position) |
| Sets the quad position in 2D space. | |
| void | SetRotation (float angleDegrees) |
| Sets the quad rotation. | |
| void | SetScale (const glm::vec2 &scale) |
| Sets the quad scale along each axis. | |
| const glm::vec2 & | GetPosition () const |
| Gets the quad position. | |
| float | GetRotation () const |
| Gets the quad rotation angle (degrees). | |
| const glm::vec2 & | GetScale () const |
| Gets the quad scale. | |
| SceneComponent2D & | GetTransform () |
| Access to the underlying SceneComponent2D (transform). | |
| const SceneComponent2D & | GetTransform () const |
| Public Member Functions inherited from rendering_engine::DrawableComponent | |
| DrawableComponent (RenderResourceContext renderContext) | |
| Constructs the DrawableComponent with a resource context. | |
| virtual | ~DrawableComponent ()=default |
| Virtual destructor. | |
| virtual void | Shutdown () |
| DrawableComponent (const DrawableComponent &)=delete | |
| DrawableComponent & | operator= (const DrawableComponent &)=delete |
Protected Attributes | |
| SceneComponent2D | mSceneComponent |
| Protected Attributes inherited from rendering_engine::DrawableComponent | |
| RenderResourceContext | mRenderContext |
| std::unique_ptr< IRenderResources > | mRenderResources |
| std::string | mMaterialName |
| std::string | mMeshName |
| Material * | mMaterial |
| PackedMaterialData | mMaterialParameters |
| MeshDataGpu * | mMeshData |
Additional Inherited Members | |
| Protected Member Functions inherited from rendering_engine::DrawableComponent | |
| void | SetMaterialName (const std::string &materialName) |
| Sets the material to use (by name). | |
| void | SetMeshName (const std::string &meshName) |
| Sets the mesh to use (by name). | |
2D drawable component for rendering objects in 2D space.
Encapsulates a 2D transform (SceneComponent2D). Provides per-frame update, transform access, and render submission.
Definition at line 26 of file drawable_2d.hpp.
| rendering_engine::Drawable2D::Drawable2D | ( | RenderResourceContext | renderContext | ) |
Constructs the Drawable2D with a resource context.
| renderContext | Rendering resource context (renderer, caches). |
Definition at line 6 of file drawable_2d.cpp.
|
pure virtual |
Submits this quad to the renderer for drawing.
Implemented in rendering_engine::Quad2D.
| const glm::vec2 & rendering_engine::Drawable2D::GetPosition | ( | ) | const |
Gets the quad position.
Definition at line 36 of file drawable_2d.cpp.
| float rendering_engine::Drawable2D::GetRotation | ( | ) | const |
Gets the quad rotation angle (degrees).
Definition at line 41 of file drawable_2d.cpp.
| const glm::vec2 & rendering_engine::Drawable2D::GetScale | ( | ) | const |
Gets the quad scale.
Definition at line 46 of file drawable_2d.cpp.
| SceneComponent2D & rendering_engine::Drawable2D::GetTransform | ( | ) |
Access to the underlying SceneComponent2D (transform).
Definition at line 51 of file drawable_2d.cpp.
| const SceneComponent2D & rendering_engine::Drawable2D::GetTransform | ( | ) | const |
Definition at line 56 of file drawable_2d.cpp.
|
overridevirtual |
Initializes render resources.
Reimplemented from rendering_engine::DrawableComponent.
Reimplemented in rendering_engine::Quad2D.
Definition at line 11 of file drawable_2d.cpp.
| void rendering_engine::Drawable2D::SetPosition | ( | const glm::vec2 & | position | ) |
Sets the quad position in 2D space.
| position | New position vector (x, y). |
Definition at line 21 of file drawable_2d.cpp.
| void rendering_engine::Drawable2D::SetRotation | ( | float | angleDegrees | ) |
Sets the quad rotation.
| angleDegrees | Rotation angle in degrees (counterclockwise). |
Definition at line 26 of file drawable_2d.cpp.
| void rendering_engine::Drawable2D::SetScale | ( | const glm::vec2 & | scale | ) |
Sets the quad scale along each axis.
| scale | New scale vector (x, y). |
Definition at line 31 of file drawable_2d.cpp.
|
overridevirtual |
Updates model matrix (and any other logic).
| deltaTime | Time step (seconds). |
Implements rendering_engine::DrawableComponent.
Reimplemented in rendering_engine::Quad2D.
Definition at line 16 of file drawable_2d.cpp.
|
protected |
Definition at line 92 of file drawable_2d.hpp.