This commit is contained in:
2025-06-08 14:38:22 -05:00
parent 8411c2981b
commit 0b6b33721b
69 changed files with 210 additions and 3384 deletions

View File

@@ -7,6 +7,4 @@
target_sources(${DUSK_TARGET_NAME}
PRIVATE
render.c
)
# Subdirs
)

View File

@@ -6,31 +6,7 @@
*/
#include "render.h"
#include "game/game.h"
#include "assert/assert.h"
#include "console/console.h"
void renderInit() {
// Initialize the rendering system
InitWindow(800, 600, "Dusk");
}
renderresult_t renderDraw() {
BeginDrawing();
ClearBackground(BLACK);
for(uint32_t i = 0; i < GAME.entityCount; i++) {
entityRender(&GAME.entities[i]);
}
consoleDraw();
EndDrawing();
if(WindowShouldClose()) return RENDER_EXIT;
return RENDER_OK;
}
void renderDispose() {
CloseWindow();
}

View File

@@ -6,33 +6,8 @@
*/
#pragma once
#include "dusk.h"
#define RENDER_FONT_SIZE 20
typedef enum {
RENDER_OK,
RENDER_EXIT,
RENDER_ERROR
} renderresult_t;
/**
* Initializes the rendering system.
*
* @return The result of the initialization.
* Init the render system.
*/
void renderInit();
/**
* Initializes the rendering system.
*
* @return The result of the initialization.
*/
renderresult_t renderDraw();
/**
* Renders the game.
*
* @return The result of the render operation.
*/
void renderDispose();
void renderInit();