Starting point
This commit is contained in:
1
src/CMakeLists.txt
Normal file
1
src/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
add_subdirectory(core)
|
||||
21
src/core/CMakeLists.txt
Normal file
21
src/core/CMakeLists.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
# Factory Core library
|
||||
add_library(factory_core STATIC
|
||||
factory_core.cpp
|
||||
)
|
||||
|
||||
# Add alias for consistent usage
|
||||
add_library(factory::core ALIAS factory_core)
|
||||
|
||||
target_include_directories(factory_core
|
||||
PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
|
||||
target_link_libraries(factory_core
|
||||
PUBLIC
|
||||
flecs::flecs_static
|
||||
)
|
||||
|
||||
# Set compile features
|
||||
target_compile_features(factory_core PUBLIC cxx_std_17)
|
||||
5
src/core/factory_core.cpp
Normal file
5
src/core/factory_core.cpp
Normal file
@@ -0,0 +1,5 @@
|
||||
#include "factory_core.hpp"
|
||||
|
||||
// Implementation file for factory_core
|
||||
// Currently empty as Core is header-only, but needed for static library target
|
||||
// Future implementations will go here
|
||||
25
src/core/factory_core.hpp
Normal file
25
src/core/factory_core.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <flecs.h>
|
||||
|
||||
namespace factory {
|
||||
|
||||
// Core engine class wrapping flecs world
|
||||
class Core {
|
||||
public:
|
||||
Core() : world_() {}
|
||||
|
||||
// Access the underlying flecs world
|
||||
flecs::world& world() { return world_; }
|
||||
const flecs::world& world() const { return world_; }
|
||||
|
||||
// Progress the simulation by one tick
|
||||
bool progress(float delta_time = 0.0f) {
|
||||
return world_.progress(delta_time);
|
||||
}
|
||||
|
||||
private:
|
||||
flecs::world world_;
|
||||
};
|
||||
|
||||
} // namespace factory
|
||||
Reference in New Issue
Block a user