BlockArena, a bit of allocator rework

This commit is contained in:
Krzosa Karol
2025-11-30 19:54:46 +01:00
parent c19c60fe22
commit c2f4686bc4
15 changed files with 337 additions and 224 deletions

View File

@@ -27,7 +27,7 @@ int64_t TotalVertexCount;
unsigned VBO, VAO;
Shader Shader2D;
Arena RenderArena;
BlockArena RenderArena;
Rect2 CurrentScissor;
Font MainFont;
@@ -139,12 +139,6 @@ Shader CreateShaderES3(const char *vsrc, const char *fsrc) {
// ---------- InitRender for ES3 ----------
void InitRender() {
#if OS_WASM
RenderArena = *AllocArena(GetSystemAllocator(), MiB(64));
#else
InitArena(&RenderArena);
#endif
#if !OS_WASM
glDebugMessageCallback(&GLDebugCallback, NULL);
glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
@@ -184,7 +178,7 @@ void InitRender() {
}
void BeginFrameRender(float wx, float wy) {
Clear(&RenderArena);
Release(&RenderArena);
TotalVertexCount = 0;
Vertices.first = NULL;
Vertices.last = NULL;
@@ -392,8 +386,6 @@ void DrawCircle(Vec2 pos, float radius, Color color) {
}
}
// ---------- ReloadFont - replace DSA texture calls ----------
void ReloadFont() {
Int size = StyleFontSize;
size = ClampBottom((Int)2, size);