code: added base

isolation_bkp/dynres
Vladyslav Hrytsenko 2021-01-10 18:42:01 +02:00
parent aff02ea737
commit a177e4c208
17 changed files with 17339 additions and 71 deletions

22
.editorconfig 100644
View File

@ -0,0 +1,22 @@
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# Set default charset
charset = utf-8
# 4 space indentation
indent_style = space
indent_size = 4
[Makefile]
indent_style = tab
[CMakeLists.txt]
indent_size = 2

1
.gitignore vendored
View File

@ -1 +1,2 @@
build build
.vscode

View File

@ -1,33 +1,11 @@
cmake_minimum_required(VERSION 3.15) cmake_minimum_required(VERSION 3.15)
project(eco2d) project(eco2d)
find_package(raylib 3.5 QUIET)
if (NOT raylib_FOUND)
include(FetchContent)
FetchContent_Declare(
raylib
URL https://github.com/raysan5/raylib/archive/master.tar.gz
)
FetchContent_GetProperties(raylib)
if (NOT raylib_POPULATED)
set(FETCHCONTENT_QUIET NO)
FetchContent_Populate(raylib)
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
# build raylib
add_subdirectory(${raylib_SOURCE_DIR} ${raylib_BINARY_DIR})
endif()
endif()
set(CMAKE_C_STANDARD 11) set(CMAKE_C_STANDARD 11)
add_executable(eco2d code/apps/client/main.c) include_directories(eco2d-client code/vendors)
include_directories(eco2d-server code/vendors)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/)
include_directories(eco2d code/vendors) add_subdirectory(code/apps/client)
add_subdirectory(code/apps/server)
target_link_libraries(eco2d raylib)

View File

@ -0,0 +1,34 @@
find_package(raylib 3.5 QUIET)
if (NOT raylib_FOUND)
include(FetchContent)
FetchContent_Declare(
raylib
URL https://github.com/raysan5/raylib/archive/master.tar.gz
)
FetchContent_GetProperties(raylib)
if (NOT raylib_POPULATED)
set(FETCHCONTENT_QUIET NO)
FetchContent_Populate(raylib)
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(${raylib_SOURCE_DIR} ${raylib_BINARY_DIR})
endif()
endif()
add_executable(eco2d-client
source/main.c
source/network.c
source/renderer.c
source/game.c
header/renderer.h
header/network.h
header/game.h
)
include_directories(header/)
target_link_libraries(eco2d-client raylib)

View File

@ -0,0 +1,8 @@
void game_init();
void game_shutdown();
void game_input();
void game_update();
void game_render();

View File

@ -0,0 +1,2 @@
#include "librg.h"

View File

@ -0,0 +1,5 @@
void gfx_init();
void gfx_shutdown();
void gfx_render();

View File

@ -1,44 +0,0 @@
#include "raylib.h"
// #define LIBRG_IMPL
#include "librg.h"
int main(void)
{
// Initialization
//--------------------------------------------------------------------------------------
const int screenWidth = 800;
const int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}

View File

@ -0,0 +1,24 @@
#include "game.h"
#include "renderer.h"
void game_init() {
gfx_init();
}
void game_shutdown() {
gfx_shutdown();
}
void game_input() {
}
void game_update() {
}
void game_render() {
gfx_render();
}

View File

@ -0,0 +1,17 @@
#include "raylib.h"
#include "game.h"
int main(void)
{
game_init();
while (!WindowShouldClose()) // Detect window close button or ESC key
{
game_input();
game_update();
game_render();
}
game_shutdown();
return 0;
}

View File

@ -0,0 +1,6 @@
#define ZPL_IMPL
#include "zpl.h"
#define LIBRG_IMPL
#define LIBRG_CUSTOM_ZPL
#include "librg.h"

View File

@ -0,0 +1,23 @@
#include "renderer.h"
#include "raylib.h"
#include "zpl.h"
const zpl_u32 screenWidth = 800;
const zpl_u32 screenHeight = 450;
void gfx_init() {
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
SetTargetFPS(60);
}
void gfx_shutdown() {
CloseWindow();
}
void gfx_render() {
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("NOBODY EXPECTS SPANISH INQUISITION!", 190, 200, 20, RED);
EndDrawing();
}

View File

@ -0,0 +1,9 @@
add_executable(eco2d-server
source/main.c
source/network.c
header/network.h
)
include_directories(header/)
target_link_libraries(eco2d-server raylib)

View File

View File

@ -0,0 +1,7 @@
#define LIBRG_IMPL
#include "librg.h"
int main(void) {
printf("hello world\n");
return 0;
}

View File

17176
code/vendors/zpl.h vendored 100644

File diff suppressed because it is too large Load Diff