Rendering Engine 0.2.0
Modular Graphics Rendering Engine | v0.2.0
Loading...
Searching...
No Matches
quad_2d.hpp
Go to the documentation of this file.
1// This file is part of the Rendering Engine project.
2// Author: Alexander Obzherin <alexanderobzherin@gmail.com>
3// Copyright (c) 2025 Alexander Obzherin
4// Distributed under the terms of the zlib License. See LICENSE.md for details.
5
6#pragma once
7
9#include "drawable_2d.hpp"
10
11namespace rendering_engine
12{
13/**
14 * @class Quad2D
15 * @brief 2D drawable component for rendering rectangular primitives.
16 *
17 * Represents a simple 2D quad used for sprites, UI widgets, text, or procedural
18 * materials. Provides a lightweight implementation of a 2D drawable
19 * with transform and material properties inherited from Drawable2D.
20 *
21 * @note Not copyable or assignable.
22 * @see Drawable2D, DrawableComponent, SceneComponent2D, Camera2D
23 */
24class RE_API Quad2D : public Drawable2D
25{
26public:
27 /**
28 * @brief Constructs the Quad2D with a render context.
29 * @param renderContext Resource context.
30 */
31 Quad2D(RenderResourceContext renderContext);
32
33 /**
34 * @copydoc DrawableComponent::Initialize
35 */
36 void Initialize() override;
37
38 /**
39 * @copydoc DrawableComponent::Update
40 */
41 void Update(float deltaTime) override;
42
43 /**
44 * @copydoc Drawable2D::Draw
45 */
46 void Draw(const Camera2D& camera) override;
47
48 using DrawableComponent::SetMaterialName; ///< @copydoc DrawableComponent::SetMaterialName
49 using DrawableComponent::SetMeshName; ///< @copydoc DrawableComponent::SetMeshName
50
51 Quad2D(const Quad2D& rhs) = delete;
52 Quad2D& operator=(const Quad2D& rhs) = delete;
53};
54
55} // namespace rendering_engine
Represents a 2D camera with position, rotation, and zoom control.
Definition camera_2d.hpp:36
Drawable2D(RenderResourceContext renderContext)
Constructs the Drawable2D with a resource context.
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).
Quad2D(const Quad2D &rhs)=delete
<
Quad2D & operator=(const Quad2D &rhs)=delete
void Initialize() override
Initializes render resource pointers (material, mesh, etc.). Must be called after setting material an...
Definition quad_2d.cpp:14
void Update(float deltaTime) override
Updates logic (animation, movement, etc.) for this drawable.
Definition quad_2d.cpp:19
Quad2D(RenderResourceContext renderContext)
Constructs the Quad2D with a render context.
Definition quad_2d.cpp:9
void Draw(const Camera2D &camera) override
Submits this quad to the renderer for drawing.
Definition quad_2d.cpp:24
#define RE_API
Aggregates pointers to global rendering resource managers.