Rendering Engine
0.2.9
Modular Graphics Rendering Engine | v0.2.9
create_actor_2d_subobject.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) 2026 Alexander Obzherin
4
// Distributed under the terms of the zlib License. See LICENSE.md for details.
5
6
#pragma once
7
8
#include "
actor_2d.hpp
"
9
#include "
scene.hpp
"
10
11
#include "
rectangle_2d.hpp
"
12
#include "
text_block_2d.hpp
"
13
14
namespace
rendering_engine
15
{
16
template
<>
17
Rectangle2D
* Actor2D::CreateSubobject<Rectangle2D>(
Rectangle2D::Properties
prop)
18
{
19
auto
rectangle2D = mScene.
Spawn
<
Rectangle2D
>(prop);
20
mWards.push_back(rectangle2D);
21
rectangle2D->UpdateOnTick(
bUpdateOnTick
);
22
23
return
rectangle2D;
24
}
25
26
template
<>
27
TextBlock2D
* Actor2D::CreateSubobject<TextBlock2D>(
TextBlock2D::Properties
prop)
28
{
29
auto
textBlock2D = mScene.
Spawn
<
TextBlock2D
>(prop);
30
mWards.push_back(textBlock2D);
31
textBlock2D->UpdateOnTick(
bUpdateOnTick
);
32
33
return
textBlock2D;
34
}
35
}
// namespace rendering_engine
actor_2d.hpp
rendering_engine::Actor2D::bUpdateOnTick
bool bUpdateOnTick
Definition:
actor_2d.hpp:208
rendering_engine::Rectangle2D
2D drawable component for rendering rectangle.
Definition:
rectangle_2d.hpp:22
rendering_engine::Scene::Spawn
T * Spawn(V arg)
Spawns and registers a drawable of type T.
rendering_engine::TextBlock2D
2D drawable representing a block of rendered text.
Definition:
text_block_2d.hpp:53
rendering_engine
Definition:
actor.hpp:13
rectangle_2d.hpp
scene.hpp
rendering_engine::Rectangle2D::Properties
Definition:
rectangle_2d.hpp:25
rendering_engine::TextBlock2D::Properties
Definition:
text_block_2d.hpp:60
text_block_2d.hpp
RenderingEngine
RenderingLibrary
Include
create_actor_2d_subobject.hpp
Generated by
1.9.4