Introduce eco2d-cli
parent
b3bff8c7fd
commit
43bd646071
|
@ -3,7 +3,11 @@ project(eco2d)
|
|||
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
|
||||
|
||||
include_directories(eco2d-cli code/vendors code/common)
|
||||
include_directories(eco2d-client code/vendors code/common)
|
||||
include_directories(eco2d-server code/vendors code/common)
|
||||
|
||||
|
|
|
@ -19,16 +19,33 @@ if (NOT raylib_FOUND)
|
|||
endif()
|
||||
endif()
|
||||
|
||||
add_executable(eco2d-client
|
||||
source/main.c
|
||||
add_library(client-common STATIC
|
||||
source/network.c
|
||||
source/renderer.c
|
||||
source/game.c
|
||||
|
||||
header/renderer.h
|
||||
header/network.h
|
||||
header/renderer.h
|
||||
header/game.h
|
||||
)
|
||||
|
||||
add_executable(eco2d-client
|
||||
source/main.c
|
||||
source/renderer_raylib.c
|
||||
)
|
||||
|
||||
add_executable(eco2d-cli
|
||||
source/main.c
|
||||
source/renderer_text.c
|
||||
)
|
||||
|
||||
include_directories(header/)
|
||||
target_link_libraries(eco2d-client raylib)
|
||||
target_link_libraries(eco2d-client raylib client-common)
|
||||
target_link_libraries(eco2d-cli client-common)
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(eco2d-cli winmm)
|
||||
target_link_libraries(eco2d-client winmm)
|
||||
elseif (UNIX)
|
||||
target_link_libraries(eco2d-cli pthread m dl)
|
||||
target_link_libraries(eco2d-client pthread m dl)
|
||||
endif()
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#pragma once
|
||||
#include "system.h"
|
||||
|
||||
void game_init();
|
||||
void game_shutdown();
|
||||
uint8_t game_is_running();
|
||||
|
||||
void game_input();
|
||||
void game_update();
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
#pragma once
|
||||
#include "system.h"
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#pragma once
|
||||
#include "system.h"
|
||||
|
||||
void gfx_init();
|
||||
void gfx_shutdown();
|
||||
uint8_t gfx_is_running();
|
||||
|
||||
void gfx_render();
|
||||
|
|
|
@ -9,6 +9,9 @@ void game_shutdown() {
|
|||
gfx_shutdown();
|
||||
}
|
||||
|
||||
uint8_t game_is_running() {
|
||||
return gfx_is_running();
|
||||
}
|
||||
|
||||
void game_input() {
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
#define ZPL_IMPL
|
||||
#include "zpl.h"
|
||||
#include "game.h"
|
||||
|
||||
int main(void)
|
||||
{
|
||||
game_init();
|
||||
|
||||
while (!WindowShouldClose())
|
||||
while (game_is_running())
|
||||
{
|
||||
game_input();
|
||||
game_update();
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#include "system.h"
|
||||
#include "renderer.h"
|
||||
#include "raylib.h"
|
||||
|
||||
|
@ -14,6 +13,10 @@ void gfx_shutdown() {
|
|||
CloseWindow();
|
||||
}
|
||||
|
||||
uint8_t gfx_is_running() {
|
||||
return !WindowShouldClose();
|
||||
}
|
||||
|
||||
void gfx_render() {
|
||||
BeginDrawing();
|
||||
ClearBackground(RAYWHITE);
|
|
@ -0,0 +1,18 @@
|
|||
#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
|
||||
}
|
Loading…
Reference in New Issue