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:
@@ -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(¶ms);
|
||||
}
|
||||
|
||||
// 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()
|
||||
|
||||
Reference in New Issue
Block a user