diff --git a/code/apps/client/CMakeLists.txt b/code/apps/client/CMakeLists.txt index cdb3a75..83084f7 100644 --- a/code/apps/client/CMakeLists.txt +++ b/code/apps/client/CMakeLists.txt @@ -24,18 +24,18 @@ add_library(client-common STATIC source/game.c header/network.h - header/renderer.h + header/platform.h header/game.h ) add_executable(eco2d-client source/main.c - source/renderer_raylib.c + source/platform_raylib.c ) add_executable(eco2d-cli source/main.c - source/renderer_text.c + source/platform_text.c ) include_directories(header/) diff --git a/code/apps/client/header/platform.h b/code/apps/client/header/platform.h new file mode 100644 index 0000000..df9f523 --- /dev/null +++ b/code/apps/client/header/platform.h @@ -0,0 +1,8 @@ +#pragma once +#include "system.h" + +void platform_init(); +void platform_shutdown(); +uint8_t platform_is_running(); + +void platform_render(); diff --git a/code/apps/client/header/renderer.h b/code/apps/client/header/renderer.h deleted file mode 100644 index 42998c0..0000000 --- a/code/apps/client/header/renderer.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include "system.h" - -void gfx_init(); -void gfx_shutdown(); -uint8_t gfx_is_running(); - -void gfx_render(); diff --git a/code/apps/client/source/game.c b/code/apps/client/source/game.c index bf4e0cb..a6af58a 100644 --- a/code/apps/client/source/game.c +++ b/code/apps/client/source/game.c @@ -1,16 +1,16 @@ #include "game.h" -#include "renderer.h" +#include "platform.h" void game_init() { - gfx_init(); + platform_init(); } void game_shutdown() { - gfx_shutdown(); + platform_shutdown(); } uint8_t game_is_running() { - return gfx_is_running(); + return platform_is_running(); } void game_input() { @@ -22,6 +22,6 @@ void game_update() { } void game_render() { - gfx_render(); + platform_render(); } diff --git a/code/apps/client/source/renderer_raylib.c b/code/apps/client/source/platform_raylib.c similarity index 74% rename from code/apps/client/source/renderer_raylib.c rename to code/apps/client/source/platform_raylib.c index 87325cf..1b0d4c7 100644 --- a/code/apps/client/source/renderer_raylib.c +++ b/code/apps/client/source/platform_raylib.c @@ -1,23 +1,23 @@ -#include "renderer.h" +#include "platform.h" #include "raylib.h" const uint16_t screenWidth = 800; const uint16_t screenHeight = 450; -void gfx_init() { +void platform_init() { InitWindow(screenWidth, screenHeight, "eco2d - client"); SetTargetFPS(60); } -void gfx_shutdown() { +void platform_shutdown() { CloseWindow(); } -uint8_t gfx_is_running() { +uint8_t platform_is_running() { return !WindowShouldClose(); } -void gfx_render() { +void platform_render() { BeginDrawing(); ClearBackground(RAYWHITE); DrawText("NOBODY EXPECTS SPANISH INQUISITION!", 190, 200, 20, RED); diff --git a/code/apps/client/source/platform_text.c b/code/apps/client/source/platform_text.c new file mode 100644 index 0000000..e11dfd4 --- /dev/null +++ b/code/apps/client/source/platform_text.c @@ -0,0 +1,18 @@ +#include "platform.h" +#include + +void platform_init() { + printf("eco2d-cli\n"); +} + +void platform_shutdown() { + printf("Bye!\n"); +} + +uint8_t platform_is_running() { + +} + +void platform_render() { + // TODO +} diff --git a/code/apps/client/source/renderer_text.c b/code/apps/client/source/renderer_text.c deleted file mode 100644 index a06aee1..0000000 --- a/code/apps/client/source/renderer_text.c +++ /dev/null @@ -1,18 +0,0 @@ -#include "renderer.h" -#include - -void gfx_init() { - printf("eco2d-cli\n"); -} - -void gfx_shutdown() { - printf("Bye!\n"); -} - -uint8_t gfx_is_running() { - -} - -void gfx_render() { - // TODO -}