Add flecs ECS

This commit is contained in:
2025-05-24 14:04:08 +02:00
parent 9228c9544a
commit d0f91fec37
3 changed files with 14 additions and 3 deletions

View File

@@ -5,10 +5,11 @@ project(HansTheGatherer)
# Option to switch real platform vs. SDL implementation... # Option to switch real platform vs. SDL implementation...
find_package(SDL3 REQUIRED) find_package(SDL3 REQUIRED)
find_package(flecs REQUIRED)
find_package(spdlog REQUIRED) find_package(spdlog REQUIRED)
add_executable(HansTheGatherer main.cpp) 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) set_property(TARGET HansTheGatherer PROPERTY CXX_STANDARD 20)

View File

@@ -1,10 +1,10 @@
#include <SDL3/SDL.h> #include <SDL3/SDL.h>
#include <SDL3/SDL_error.h> #include <SDL3/SDL_error.h>
#include <SDL3/SDL_render.h> #include <SDL3/SDL_render.h>
#include <flecs.h>
#include <spdlog/spdlog.h> #include <spdlog/spdlog.h>
const uint8_t image_data[] = const uint8_t image_data[] = {
{
#embed "main.cpp" #embed "main.cpp"
}; };
@@ -27,6 +27,8 @@ auto main() -> int {
SDL_GetError()); SDL_GetError());
} }
flecs::world world;
bool exit_gameloop = false; bool exit_gameloop = false;
while (!exit_gameloop) { while (!exit_gameloop) {
SDL_Event event; SDL_Event event;

8
vcpkg.json Normal file
View File

@@ -0,0 +1,8 @@
{
"dependencies": [
"spdlog",
"sdl3",
"spdlog",
"flecs"
]
}