Rename renderer to platform

isolation_bkp/dynres
Dominik Madarász 2021-01-11 21:11:03 +01:00
parent 43bd646071
commit a9885f9763
7 changed files with 39 additions and 39 deletions

View File

@ -24,18 +24,18 @@ add_library(client-common STATIC
source/game.c source/game.c
header/network.h header/network.h
header/renderer.h header/platform.h
header/game.h header/game.h
) )
add_executable(eco2d-client add_executable(eco2d-client
source/main.c source/main.c
source/renderer_raylib.c source/platform_raylib.c
) )
add_executable(eco2d-cli add_executable(eco2d-cli
source/main.c source/main.c
source/renderer_text.c source/platform_text.c
) )
include_directories(header/) include_directories(header/)

View File

@ -0,0 +1,8 @@
#pragma once
#include "system.h"
void platform_init();
void platform_shutdown();
uint8_t platform_is_running();
void platform_render();

View File

@ -1,8 +0,0 @@
#pragma once
#include "system.h"
void gfx_init();
void gfx_shutdown();
uint8_t gfx_is_running();
void gfx_render();

View File

@ -1,16 +1,16 @@
#include "game.h" #include "game.h"
#include "renderer.h" #include "platform.h"
void game_init() { void game_init() {
gfx_init(); platform_init();
} }
void game_shutdown() { void game_shutdown() {
gfx_shutdown(); platform_shutdown();
} }
uint8_t game_is_running() { uint8_t game_is_running() {
return gfx_is_running(); return platform_is_running();
} }
void game_input() { void game_input() {
@ -22,6 +22,6 @@ void game_update() {
} }
void game_render() { void game_render() {
gfx_render(); platform_render();
} }

View File

@ -1,23 +1,23 @@
#include "renderer.h" #include "platform.h"
#include "raylib.h" #include "raylib.h"
const uint16_t screenWidth = 800; const uint16_t screenWidth = 800;
const uint16_t screenHeight = 450; const uint16_t screenHeight = 450;
void gfx_init() { void platform_init() {
InitWindow(screenWidth, screenHeight, "eco2d - client"); InitWindow(screenWidth, screenHeight, "eco2d - client");
SetTargetFPS(60); SetTargetFPS(60);
} }
void gfx_shutdown() { void platform_shutdown() {
CloseWindow(); CloseWindow();
} }
uint8_t gfx_is_running() { uint8_t platform_is_running() {
return !WindowShouldClose(); return !WindowShouldClose();
} }
void gfx_render() { void platform_render() {
BeginDrawing(); BeginDrawing();
ClearBackground(RAYWHITE); ClearBackground(RAYWHITE);
DrawText("NOBODY EXPECTS SPANISH INQUISITION!", 190, 200, 20, RED); DrawText("NOBODY EXPECTS SPANISH INQUISITION!", 190, 200, 20, RED);

View File

@ -0,0 +1,18 @@
#include "platform.h"
#include <stdio.h>
void platform_init() {
printf("eco2d-cli\n");
}
void platform_shutdown() {
printf("Bye!\n");
}
uint8_t platform_is_running() {
}
void platform_render() {
// TODO
}

View File

@ -1,18 +0,0 @@
#include "renderer.h"
#include <stdio.h>
void gfx_init() {
printf("eco2d-cli\n");
}
void gfx_shutdown() {
printf("Bye!\n");
}
uint8_t gfx_is_running() {
}
void gfx_render() {
// TODO
}