Restore console, server/client stuff.

This commit is contained in:
2025-04-21 08:23:58 -05:00
parent 697b5f7ee2
commit 4aaabb3882
22 changed files with 549 additions and 47 deletions

View File

@@ -0,0 +1,12 @@
# Copyright (c) 2025 Dominic Masters
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
# Sources
target_sources(${DUSK_TARGET_NAME}
PRIVATE
render.c
)
# Subdirs

36
src/display/render.c Normal file
View File

@@ -0,0 +1,36 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#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();
}

38
src/display/render.h Normal file
View File

@@ -0,0 +1,38 @@
/**
* Copyright (c) 2025 Dominic Masters
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
#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.
*/
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();