SpiecsEngine
 
Loading...
Searching...
No Matches
SlateRegister.cpp
Go to the documentation of this file.
1/**
2* @file SlateRegister.cpp.
3* @brief The SlateRegister Class Implementation.
4* @author Spices.
5*/
6
7#include "Pchheader.h"
9#include "Core/Thread/ThreadPoolBasic.h"
10#include "Core/Event/KeyEvent.h"
11
12namespace Spices {
13
15 {
17
18 /**
19 * @brief Iter hash map.
20 */
21 for (auto& pair : m_SlatesEventContainer)
22 {
23 pair.second->OnUpdate(ts);
24 }
25 }
26
27 void SlateRegister::OnRender() const
28 {
30
31 /**
32 * @brief Iter hash map.
33 */
34 for (auto& pair : m_SlatesRenderContainer)
35 {
36 pair.second->OnRender();
37 }
38 }
39
41 {
43
44 /**
45 * @brief Iter hash map.
46 */
47 for (auto& pair : m_SlatesEventContainer)
48 {
49 pair.second->OnEvent(event);
50 }
51 }
52
54 {
56
57 return std::static_pointer_cast<ImguiViewport>(m_SlatesRenderContainer["ViewPort"]);
58 }
59
60 std::shared_ptr<ImguiSlate> SlateRegister::GetSlate(const std::string& name)
61 {
63
64 if (m_SlatesEventContainer.find(name) != m_SlatesEventContainer.end())
65 {
66 return m_SlatesEventContainer[name];
67 }
68
69 return nullptr;
70 }
71}
#define SPICES_PROFILE_ZONE
This Class is the basic Event Class. Inherit from it and create specific event class.
Definition Event.h:96
This Class defines the basic behaves of specific slate. When we add an new Slate, we need inherit fro...
Definition ImguiUtils.h:27
The ImguiViewport Class. This class defines how to render a viewport.
std::shared_ptr< ImguiSlate > GetSlate(const std::string &name)
Get Slate by name.
std::shared_ptr< ImguiViewport > GetViewPort()
void OnEvent(Event &event)
This function will be called on global Event function pointer is called.
void OnRender() const
This function is called on SlateRenderer::Render.
void OnUpdate(TimeStep &ts) const
This Class is the manager of all slate, it keeps all slate handle.
This Class handles our engine time step during frames. Global Unique.
Definition TimeStep.h:22