From d0f91fec37dda9f257ab9ec1ccc8435b6691abfa Mon Sep 17 00:00:00 2001 From: Derek Christ Date: Sat, 24 May 2025 14:04:08 +0200 Subject: [PATCH] Add flecs ECS --- CMakeLists.txt | 3 ++- main.cpp | 6 ++++-- vcpkg.json | 8 ++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 vcpkg.json diff --git a/CMakeLists.txt b/CMakeLists.txt index a76a08b..b21a875 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,10 +5,11 @@ project(HansTheGatherer) # Option to switch real platform vs. SDL implementation... find_package(SDL3 REQUIRED) +find_package(flecs REQUIRED) find_package(spdlog REQUIRED) add_executable(HansTheGatherer main.cpp) -target_link_libraries(HansTheGatherer SDL3::SDL3 spdlog::spdlog) +target_link_libraries(HansTheGatherer SDL3::SDL3 flecs::flecs spdlog::spdlog) set_property(TARGET HansTheGatherer PROPERTY CXX_STANDARD 20) diff --git a/main.cpp b/main.cpp index 46ec4f4..72deb3b 100644 --- a/main.cpp +++ b/main.cpp @@ -1,10 +1,10 @@ #include #include #include +#include #include -const uint8_t image_data[] = -{ +const uint8_t image_data[] = { #embed "main.cpp" }; @@ -27,6 +27,8 @@ auto main() -> int { SDL_GetError()); } + flecs::world world; + bool exit_gameloop = false; while (!exit_gameloop) { SDL_Event event; diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..2bfa665 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,8 @@ +{ + "dependencies": [ + "spdlog", + "sdl3", + "spdlog", + "flecs" + ] +}