Kale
Loading...
Searching...
No Matches
Node.hpp
Go to the documentation of this file.
1/*
2 Copyright 2022 Rishi Challa
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#pragma once
18
20
21#include <mutex>
22#include <optional>
23
24namespace Kale {
25
29 class Scene;
30
34 class Node {
35 private:
36
37 protected:
38
43 std::optional<std::mutex> mutex;
44
50 virtual void begin(const Scene& scene);
51
56 virtual void render(const Camera& camera, float deltaTime) const;
57
64 virtual void update(size_t threadNum, const Scene& scene, float deltaTime);
65
72 virtual void preUpdate(size_t threadNum, const Scene& scene, float deltaTime);
73
77 virtual void end(const Scene& scene);
78
82 Node();
83
89 Node(float preUpdateTime, float updateTime);
90
91 friend class Scene;
92
93 public:
94
98 std::string name;
99
108 const float updateTime = 100.0f;
109
113 const float preUpdateTime = 100.0f;
114 };
115}
const float updateTime
Definition Node.hpp:108
virtual void preUpdate(size_t threadNum, const Scene &scene, float deltaTime)
Definition Node.cpp:70
virtual void render(const Camera &camera, float deltaTime) const
Definition Node.cpp:50
std::optional< std::mutex > mutex
Definition Node.hpp:43
virtual void update(size_t threadNum, const Scene &scene, float deltaTime)
Definition Node.cpp:60
std::string name
Definition Node.hpp:98
const float preUpdateTime
Definition Node.hpp:113
virtual void begin(const Scene &scene)
Definition Node.cpp:42
virtual void end(const Scene &scene)
Definition Node.cpp:77