SpiecsEngine
 
Loading...
Searching...
No Matches
TimeStep.h
Go to the documentation of this file.
1/**
2* @file TimeStep.h.
3* @brief Time Counting for our Engine.
4* The TimeStep Class Definitions.
5* @author Spices.
6*/
7
8#pragma once
9#include "Core/Core.h"
10#include <chrono>
11
12namespace Spices {
13
14 /**
15 * @brief This Class handles our engine time step during frames.
16 * Global Unique.
17 * @todo Entity timeStep System.
18 * @todo operator() return m_FrameTime.
19 * @todo ms / s / us counting.
20 */
22 {
23 public:
24
25 /**
26 * @brief Constructor Function.
27 */
28 TimeStep();
29
30 /**
31 * @brief Destructor Function.
32 */
33 virtual ~TimeStep() = default;
34
35 /**
36 * @brief Copy Constructor Function.
37 * @note This Class not allowed copy behaves.
38 */
39 TimeStep(const TimeStep&) = delete;
40
41 /**
42 * @brief Copy Assignment Operation.
43 * @note This Class not allowed copy behaves.
44 */
45 TimeStep& operator=(const TimeStep&) = delete;
46
47 /**
48 * @brief Get time step during frames.
49 * @return time step(s) during frames.
50 */
51 const float& ft() const { return m_FrameTime; }
52
53 /**
54 * @brief Get time step since Engine Start.
55 * @return time step(s) since Engine Start.
56 */
57 const float& gt() const { return m_GameTime; }
58
59 /**
60 * @brief Get frames count.
61 * @return Returns frames count.
62 */
63 const uint64_t& fs() const { return m_Frames; }
64
65 /**
66 * @brief Refresh time in each engine loop.
67 */
68 void Flush();
69
70 public:
71
72 /**
73 * @brief Engine Start time.
74 */
75 std::chrono::steady_clock::time_point m_StartTime;
76
77 /**
78 * @brief Last frame time.
79 */
80 std::chrono::steady_clock::time_point m_LastTime;
81
82 /**
83 * @brief time step(s) during frames.
84 */
86
87 /**
88 * @brief time step(s) since Engine Start.
89 */
91
92 /**
93 * @brief Frames since Engine Start.
94 */
95 uint64_t m_Frames;
96 };
97}
int main()
Main Function.
Definition EntryPoint.h:15
#define PROCESS_INSTANCE_ENTRY
Macros of modify Process instance state.
#define PROCESS_INSTANCE_EXIT
#define SPICES_PROFILE_ZONE
Application()
Constructor Function.
static void Run()
Run Our World.
Application Class. Our Engine Start here.
Definition Application.h:20
float m_FrameTime
time step(s) during frames.
Definition TimeStep.h:85
std::chrono::steady_clock::time_point m_StartTime
Engine Start time.
Definition TimeStep.h:75
void Flush()
Refresh time in each engine loop.
Definition TimeStep.cpp:26
const float & ft() const
Get time step during frames.
Definition TimeStep.h:51
TimeStep(const TimeStep &)=delete
Copy Constructor Function.
const uint64_t & fs() const
Get frames count.
Definition TimeStep.h:63
TimeStep()
Constructor Function.
Definition TimeStep.cpp:12
virtual ~TimeStep()=default
Destructor Function.
std::chrono::steady_clock::time_point m_LastTime
Last frame time.
Definition TimeStep.h:80
float m_GameTime
time step(s) since Engine Start.
Definition TimeStep.h:90
uint64_t m_Frames
Frames since Engine Start.
Definition TimeStep.h:95
TimeStep & operator=(const TimeStep &)=delete
Copy Assignment Operation.
const float & gt() const
Get time step since Engine Start.
Definition TimeStep.h:57
This Class handles our engine time step during frames. Global Unique.
Definition TimeStep.h:22
static TracyGPUContext & Get()
Get this Single Instance.
static std::shared_ptr< TracyGPUContext > m_TracyGPUContext
This Single Instance.
virtual ~TracyGPUContext()=default
Destructor Function.
tracy::VkCtx * m_Context
Tracy Vulkan Context.
TracyGPUContext(VulkanState &state)
Constructor Function.
VulkanState & m_VulkanState
VulkanState.
tracy::VkCtx *& GetContext()
Get Context.
static void CreateInstance(VulkanState &state)
Create this Single Instance.
Wapper of Tracy GPU collect features.
World Class. This class defines the basic behaves of World. When we create an new world,...
Definition World.h:41
static const char * memoryPoolNames[3]
MemoryPool's name.
Definition Core.h:43
std::shared_ptr< World > CreateWorld()
extern WorldCreation definition in Game.
Definition EntryPoint.cpp:6
static constexpr char const * name
Define a named category tag type.
static constexpr char const * name
Define a custom domain tag type.
static constexpr char const * message
Define a registered string tag type.
This struct contains all Vulkan object in used global.
Definition VulkanUtils.h:74