2
3
4
5
9#define GLM_ENABLE_EXPERIMENTAL
10#include <glm/gtx/string_cast.hpp>
13#pragma warning(push, 0
)
14#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_TRACE
15#include <spdlog/spdlog.h>
16#include <spdlog/fmt/ostr.h>
22
23
33
34
38
39
43
44
45
49
50
51
57
58
59 template <
typename...
Args>
63
64
65
66
67 template <
typename... Args>
68 static void PostHandle(format_string_t<Args...> fmt, Args &&...args);
73
74
78
79
83 template<
typename ...Args>
84 inline void Log::PostHandle(format_string_t<Args...> fmt, Args && ...args)
90template<
typename OStream, glm::length_t L,
typename T, glm::qualifier Q>
91inline OStream& operator<<(OStream& os,
const glm::vec<L, T, Q>& vector)
93 return os << glm::to_string(vector);
96template<
typename OStream, glm::length_t C, glm::length_t R,
typename T, glm::qualifier Q>
97inline OStream& operator<<(OStream& os,
const glm::mat<C, R, T, Q>& matrix)
99 return os << glm::to_string(matrix);
102template<
typename OStream,
typename T, glm::qualifier Q>
103inline OStream& operator<<(OStream& os, glm::qua<T, Q> quaternion)
105 return os << glm::to_string(quaternion);
111#define SPICES_CORE_TRACE(...) { if(Spices::Log::m_IsInitialized) { Spices::Log::GetCoreLogger()->trace (__VA_ARGS__); Spices::Log::PostHandle(__VA_ARGS__); } else { std::cout << __VA_ARGS__ << std::endl; } }
112#define SPICES_CORE_INFO(...) { if(Spices::Log::m_IsInitialized) { Spices::Log::GetCoreLogger()->info (__VA_ARGS__); Spices::Log::PostHandle(__VA_ARGS__); } else { std::cout << __VA_ARGS__ << std::endl; } }
113#define SPICES_CORE_WARN(...) { if(Spices::Log::m_IsInitialized) { Spices::Log::GetCoreLogger()->warn (__VA_ARGS__); Spices::Log::PostHandle(__VA_ARGS__); } else { std::cout << __VA_ARGS__ << std::endl; } }
114#define SPICES_CORE_ERROR(...) { if(Spices::Log::m_IsInitialized) { Spices::Log::GetCoreLogger()->error (__VA_ARGS__); Spices::Log::PostHandle(__VA_ARGS__); } else { std::cout << __VA_ARGS__ << std::endl; } }
115#define SPICES_CORE_CRITICAL(...) { if(Spices::Log::m_IsInitialized) { Spices::Log::GetCoreLogger()->critical (__VA_ARGS__); Spices::Log::PostHandle(__VA_ARGS__); } else { std::cout << __VA_ARGS__ << std::endl; } }
118#define SPICES_TRACE(...) { if(Spices::Log::m_IsInitialized) { Spices::Log::GetClientLogger()->trace (__VA_ARGS__); Spices::Log::PostHandle(__VA_ARGS__); } else { std::cout << __VA_ARGS__ << std::endl; } }
119#define SPICES_INFO(...) { if(Spices::Log::m_IsInitialized) { Spices::Log::GetClientLogger()->info (__VA_ARGS__); Spices::Log::PostHandle(__VA_ARGS__); } else { std::cout << __VA_ARGS__ << std::endl; } }
120#define SPICES_WARN(...) { if(Spices::Log::m_IsInitialized) { Spices::Log::GetClientLogger()->warn (__VA_ARGS__); Spices::Log::PostHandle(__VA_ARGS__); } else { std::cout << __VA_ARGS__ << std::endl; } }
121#define SPICES_ERROR(...) { if(Spices::Log::m_IsInitialized) { Spices::Log::GetClientLogger()->error (__VA_ARGS__); Spices::Log::PostHandle(__VA_ARGS__); } else { std::cout << __VA_ARGS__ << std::endl; } }
122#define SPICES_CRITICAL(...) { if(Spices::Log::m_IsInitialized) { Spices::Log::GetClientLogger()->critical (__VA_ARGS__); Spices::Log::PostHandle(__VA_ARGS__); } else { std::cout << __VA_ARGS__ << std::endl; } }
129#define SPICES_CORE_TRACE(...)
130#define SPICES_CORE_INFO(...)
131#define SPICES_CORE_WARN(...)
132#define SPICES_CORE_ERROR(...)
133#define SPICES_CORE_CRITICAL(...)
136#define SPICES_TRACE(...)
137#define SPICES_INFO(...)
138#define SPICES_WARN(...)
139#define SPICES_ERROR(...)
140#define SPICES_CRITICAL(...)
#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.
static std::shared_ptr< spdlog::logger > s_ClientLogger
Game Stage Logger.
static bool m_IsInitialized
static std::shared_ptr< spdlog::logger > s_CoreLogger
Engine Stage Logger.
static void Init()
Init Log.
static std::shared_ptr< spdlog::logger > & GetCoreLogger()
Get Engine Stage Logger.
static std::shared_ptr< spdlog::logger > & GetClientLogger()
Get Game Stage Logger.
static void PostHandle(format_string_t< Args... > fmt, Args &&...args)
Post handle with log message.
static void ShutDown()
Shutdown Log.
float m_FrameTime
time step(s) during frames.
std::chrono::steady_clock::time_point m_StartTime
Engine Start time.
void Flush()
Refresh time in each engine loop.
const float & ft() const
Get time step during frames.
TimeStep(const TimeStep &)=delete
Copy Constructor Function.
const uint64_t & fs() const
Get frames count.
TimeStep()
Constructor Function.
virtual ~TimeStep()=default
Destructor Function.
std::chrono::steady_clock::time_point m_LastTime
Last frame time.
float m_GameTime
time step(s) since Engine Start.
uint64_t m_Frames
Frames since Engine Start.
TimeStep & operator=(const TimeStep &)=delete
Copy Assignment Operation.
const float & gt() const
Get time step since Engine Start.
This Class handles our engine time step during frames. Global Unique.
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,...
static const char * memoryPoolNames[3]
MemoryPool's name.
std::shared_ptr< World > CreateWorld()
extern WorldCreation definition in Game.
static constexpr char const * name
static constexpr uint32_t id
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.