diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c855c8..7459337 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,4 +10,5 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) add_subdirectory(deerith_engine_core) add_subdirectory(deerith_engine_client) +add_subdirectory(deerith_engine_server) add_subdirectory(sandbox) \ No newline at end of file diff --git a/deerith_engine_client/CMakeLists.txt b/deerith_engine_client/CMakeLists.txt index 6ce2041..6b3b35c 100644 --- a/deerith_engine_client/CMakeLists.txt +++ b/deerith_engine_client/CMakeLists.txt @@ -1,6 +1,5 @@ find_package(glfw3 REQUIRED) find_package(OpenGL REQUIRED) -find_package(glm REQUIRED) find_package(PkgConfig REQUIRED) pkg_check_modules(IMGUI REQUIRED imgui) @@ -29,7 +28,6 @@ target_link_libraries(DeerithClient DeerithCore OpenGL::GL glfw - glm::glm ${IMGUI_LIBRARIES} ) diff --git a/deerith_engine_client/include/deerith/network/network.h b/deerith_engine_client/include/deerith/network/network.h new file mode 100644 index 0000000..4287ca8 --- /dev/null +++ b/deerith_engine_client/include/deerith/network/network.h @@ -0,0 +1 @@ +# \ No newline at end of file diff --git a/deerith_engine_core/CMakeLists.txt b/deerith_engine_core/CMakeLists.txt index 04b7d3e..0ec49f7 100644 --- a/deerith_engine_core/CMakeLists.txt +++ b/deerith_engine_core/CMakeLists.txt @@ -2,6 +2,7 @@ add_library(DeerithCore) find_package(spdlog REQUIRED) find_package(fmt REQUIRED) +find_package(glm REQUIRED) file(GLOB_RECURSE DEERITH_CORE_SOURCES CONFIGURE_DEPENDS @@ -22,4 +23,5 @@ target_link_libraries(DeerithCore PUBLIC spdlog::spdlog fmt::fmt + glm::glm ) \ No newline at end of file diff --git a/deerith_engine_core/include/deerith/network/client.h b/deerith_engine_core/include/deerith/network/client.h new file mode 100644 index 0000000..595ea65 --- /dev/null +++ b/deerith_engine_core/include/deerith/network/client.h @@ -0,0 +1,8 @@ +#pragma once + +namespace deerith +{ + class Client + { + }; +} \ No newline at end of file diff --git a/deerith_engine_core/include/deerith/network/network.h b/deerith_engine_core/include/deerith/network/network.h new file mode 100644 index 0000000..29b4d37 --- /dev/null +++ b/deerith_engine_core/include/deerith/network/network.h @@ -0,0 +1,6 @@ +#pragma once + +namespace deerith +{ + void connect_to_server(); +} \ No newline at end of file diff --git a/deerith_engine_core/include/deerith/world/world.h b/deerith_engine_core/include/deerith/world/world.h new file mode 100644 index 0000000..65c8691 --- /dev/null +++ b/deerith_engine_core/include/deerith/world/world.h @@ -0,0 +1,9 @@ +#pragma once +#include + +namespace deerith +{ + using world_tick_function = std::function; + + void set_world_tick_callback(world_tick_function *tick_function); +} \ No newline at end of file diff --git a/deerith_engine_server/CMakeLists.txt b/deerith_engine_server/CMakeLists.txt new file mode 100644 index 0000000..4764c38 --- /dev/null +++ b/deerith_engine_server/CMakeLists.txt @@ -0,0 +1,21 @@ +add_library(DeerithServer) + +file(GLOB_RECURSE deerith_server_SOURCES + CONFIGURE_DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp +) + +target_sources(DeerithServer + PRIVATE + ${deerith_server_SOURCES} +) + +target_include_directories(DeerithServer + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/include +) + +target_link_libraries(DeerithServer + PUBLIC + DeerithCore +) diff --git a/deerith_engine_server/src/core.cpp b/deerith_engine_server/src/core.cpp new file mode 100644 index 0000000..e69de29 diff --git a/sandbox/CMakeLists.txt b/sandbox/CMakeLists.txt index db18914..cddda04 100644 --- a/sandbox/CMakeLists.txt +++ b/sandbox/CMakeLists.txt @@ -1,8 +1,34 @@ -add_executable(Sandbox - src/main.cpp +file(GLOB_RECURSE SANDBOX_COMMON + CONFIGURE_DEPENDS + src/common/*.cpp ) -target_link_libraries(Sandbox +file(GLOB_RECURSE SANDBOX_CLIENT + CONFIGURE_DEPENDS + src/client/*.cpp +) + +file(GLOB_RECURSE SANDBOX_SERVER + CONFIGURE_DEPENDS + src/server/*.cpp +) + +add_executable(SandboxClient + ${SANDBOX_COMMON} + ${SANDBOX_CLIENT} +) + +target_link_libraries(SandboxClient PRIVATE DeerithClient +) + +add_executable(SandboxServer + ${SANDBOX_COMMON} + ${SANDBOX_SERVER} +) + +target_link_libraries(SandboxServer + PRIVATE + DeerithServer ) \ No newline at end of file diff --git a/sandbox/src/main.cpp b/sandbox/src/client/main.cpp similarity index 100% rename from sandbox/src/main.cpp rename to sandbox/src/client/main.cpp diff --git a/sandbox/src/server/main.cpp b/sandbox/src/server/main.cpp new file mode 100644 index 0000000..e39ac6a --- /dev/null +++ b/sandbox/src/server/main.cpp @@ -0,0 +1,13 @@ + +#include +#include + +int main(int args_count, const char **args) +{ + deerith::init_deerith_core(); + + deerith_core_trace("Running server\n{}", args[0]); + + deerith::shutdown_deerith_core(); + return 0; +} \ No newline at end of file