entity system!

This commit is contained in:
Asuro
2025-02-09 19:30:18 +01:00
parent d1270c47a9
commit 90bc5753a9
19 changed files with 306 additions and 67 deletions

View File

@@ -2,17 +2,54 @@
#include <cstdint>
struct SharedData;
struct IVec2
{
int32_t X = 0;
int32_t Y = 0;
};
struct IVec3
{
int32_t X = 0;
int32_t Y = 0;
};
struct Vec2
{
float X = 0.0f;
float Y = 0.0f;
};
struct Vec3
{
float X = 0.0f;
float Y = 0.0f;
float Z = 0.0f;
};
struct Quat
{
float X = 0.0f;
float Y = 0.0f;
float Z = 0.0f;
float W = 1.0f;
};
struct Mat4
{
float M[16] {
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0,
};
};
namespace Game
{
struct GameInstance
{
bool IsInitialized = false;
uint64_t Size = sizeof(GameInstance);
uint32_t FrameCounter = 0;
int64_t StartTime = 0;
};
struct GameInstance;
SharedData& GetShared();
void SetShared(SharedData& instance);
GameInstance& GetInstance();