Practical Tools for Simple Design
Loading...
Searching...
No Matches
Renderer.hpp
1#ifndef UTIL_Renderer_HPP
2#define UTIL_Renderer_HPP
3
4#include <memory>
5#include <vector>
6
7#include "Util/GameObject.hpp"
8
9class App;
10
11namespace Util {
17class Renderer final {
18public:
25 Renderer(const std::vector<std::shared_ptr<GameObject>> &children = {});
26
32 void AddChild(const std::shared_ptr<GameObject> &child);
33
39 void AddChildren(const std::vector<std::shared_ptr<GameObject>> &children);
40
46 void RemoveChild(std::shared_ptr<GameObject> child);
47
53 void Update();
54
55private:
56 std::vector<std::shared_ptr<GameObject>> m_Children;
57};
58} // namespace Util
59
60#endif
A class handling GameObjects' Draw()
Definition: Renderer.hpp:17
void RemoveChild(std::shared_ptr< GameObject > child)
Remove the child.
Renderer(const std::vector< std::shared_ptr< GameObject > > &children={})
Parameterized constructor. `.
void Update()
Draw children according to their z-index.
void AddChild(const std::shared_ptr< GameObject > &child)
Add a child to Renderer.
void AddChildren(const std::vector< std::shared_ptr< GameObject > > &children)
Add children to Renderer.
Useful tools for development.
Definition: Animation.hpp:12