Compare commits
6 Commits
69be7aa529
...
440fd87ccc
Author | SHA1 | Date | |
---|---|---|---|
![]() |
440fd87ccc | ||
![]() |
f759fd3302 | ||
![]() |
59bdc552e3 | ||
![]() |
579bca1940 | ||
![]() |
64f7bad682 | ||
![]() |
d417b147ed |
5
.gitignore
vendored
5
.gitignore
vendored
@ -18,4 +18,7 @@ venv/
|
||||
typer.py
|
||||
|
||||
# Cache Files
|
||||
.cache/
|
||||
.cache/
|
||||
|
||||
# Script output files
|
||||
output.txt
|
@ -4,6 +4,13 @@ project(FarmFighter)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
||||
if(POLICY CMP0077)
|
||||
cmake_policy(SET CMP0077 NEW)
|
||||
endif()
|
||||
set(FETCHCONTENT_QUIET OFF)
|
||||
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
raylib
|
||||
@ -15,6 +22,15 @@ FetchContent_MakeAvailable(raylib)
|
||||
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_GAMES OFF CACHE BOOL "" FORCE)
|
||||
|
||||
FetchContent_Declare(
|
||||
enet
|
||||
URL https://github.com/zpl-c/enet/archive/refs/tags/v2.3.10.zip
|
||||
)
|
||||
FetchContent_MakeAvailable(enet)
|
||||
|
||||
add_library(enet INTERFACE)
|
||||
target_include_directories(enet INTERFACE ${enet_SOURCE_DIR}/include)
|
||||
|
||||
add_subdirectory(networking)
|
||||
add_subdirectory(engine)
|
||||
add_subdirectory(client)
|
||||
|
@ -22,7 +22,6 @@ add_library(ImGui STATIC
|
||||
)
|
||||
target_include_directories(ImGui PUBLIC ${imgui_SOURCE_DIR})
|
||||
|
||||
# rlImGui
|
||||
FetchContent_Declare(
|
||||
rlImGui
|
||||
GIT_REPOSITORY https://github.com/raylib-extras/rlImGui.git
|
||||
@ -46,8 +45,10 @@ target_include_directories(client PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../networking/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../engine/include
|
||||
${enet_SOURCE_DIR}/include
|
||||
)
|
||||
target_link_libraries(client raylib networking engine rlImGui ImGui)
|
||||
|
||||
target_link_libraries(client raylib networking engine rlImGui ImGui enet)
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(client ws2_32)
|
||||
|
@ -1,6 +1,13 @@
|
||||
#include <stdio.h>
|
||||
#define ENET_IMPLEMENTATION
|
||||
#include <enet.h>
|
||||
|
||||
int main() {
|
||||
printf("This is the farm fighter client!\n");
|
||||
return 0;
|
||||
if (enet_initialize() != 0) {
|
||||
printf("Error init enet\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
@ -7,6 +7,7 @@ add_library(engine STATIC
|
||||
target_include_directories(engine PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
${raylib_SOURCE_DIR}/src
|
||||
${enet_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
target_include_directories(engine PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
@ -7,6 +7,9 @@ add_library(networking STATIC
|
||||
target_include_directories(networking PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
${raylib_SOURCE_DIR}/src
|
||||
${enet_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
target_include_directories(networking PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
target_include_directories(networking PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
||||
target_link_libraries(networking enet)
|
File diff suppressed because it is too large
Load Diff
@ -8,10 +8,11 @@ target_include_directories(server PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../networking/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../engine/include
|
||||
${enet_SOURCE_DIR}/include
|
||||
)
|
||||
|
||||
target_link_libraries(server networking engine raylib)
|
||||
target_link_libraries(server networking engine raylib enet)
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(server ws2_32)
|
||||
endif()
|
||||
endif()
|
||||
|
@ -1,8 +1,16 @@
|
||||
#include <stdio.h>
|
||||
#define ENET_IMPLEMENTATION
|
||||
#include <enet.h>
|
||||
|
||||
int main() {
|
||||
printf("Server starting...\n");
|
||||
if (enet_initialize() != 0) {
|
||||
printf("Error init enet\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
printf("Press any key to exit...\n");
|
||||
scanf_s("0");
|
||||
return 0;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user