Added a basic MemoryArena.

Added one scratch, one engine and one game arena.
Converted the game alloc to arena + the display stuff.
WIP

Made using Antigravity+gemini
This commit is contained in:
2026-01-17 21:09:23 -05:00
parent 98783b7e8f
commit f95ba51c13
28 changed files with 462 additions and 59 deletions

View File

@@ -17,6 +17,8 @@
#include <Core/Common/String.h>
#include <Core/Memory/Utils.h>
#include <Core/Memory/MemoryArena.h>
#include <Core/Memory/EngineArena.h>
#include <cstdlib>
// TODO : Replace with message box from framework + call main and not winmain + subsystem
@@ -33,7 +35,7 @@ using namespace Juliet;
namespace
{
using GameInit_t = void (*)(void);
using GameInit_t = void (*)(GameInitParams*);
using GameShutdown_t = void (*)(void);
using GameUpdate_t = void (*)(float deltaTime);
struct GameFunctionTable
@@ -158,7 +160,10 @@ void JulietApplication::Init()
InitHotReloadCode(GameCode, ConstString("Game.dll"), ConstString("Game_Temp.dll"), ConstString("lock.tmp"));
if ((Running = GameCode.IsValid))
{
Game.Init();
GameInitParams params;
params.GameArena = GetGameArena();
params.ScratchArena = GetScratchArena();
Game.Init(&params);
}
// Initialize DebugDisplay
@@ -383,6 +388,9 @@ void JulietApplication::Update()
// Submit Commands
SubmitCommandLists(cmdList);
// Reset Scratch Arena at the end of the frame
ScratchArenaReset();
}
bool JulietApplication::IsRunning()