diff --git a/becs.h b/becs.h index 503c355..5f59ecc 100644 --- a/becs.h +++ b/becs.h @@ -1,29 +1,37 @@ #ifndef BECS_H #define BECS_H - -#ifdef BECS_IMPLEMENTATION #include -typedef struct BECS_ComponentArray { +typedef struct BECS_ComponentArray BECS_ComponentArray; +typedef struct BECS_Properties BECS_Properties; +typedef struct BECS_ECS BECS_ECS; + +size_t BECS_GetMinMemorySize(BECS_Properties props); +BECS_ECS *BECS_Init(void *memory, size_t size, BECS_Properties *props); +int32_t BECS_AddComponent(BECS_ECS *ecs, uint32_t entityID, uint64_t componentBitMask, void *component); + +#ifdef BECS_IMPLEMENTATION + +struct BECS_ComponentArray { uint32_t lastEntityAdded; size_t unitSize; uint32_t length; uint32_t capacity; void *array; -} BECS_ComponentArray; +}; -typedef struct BECS_Properties { +struct BECS_Properties { uint32_t maxEntities; uint32_t numComponents; size_t *componentSizes; -} BECS_Properties; +}; -typedef struct BECS_ECS { +struct BECS_ECS { uint64_t *bitMasks; BECS_Properties props; BECS_ComponentArray *componentSets; -} BECS_ECS; +}; size_t BECS_GetMinMemorySize (BECS_Properties props) diff --git a/build.bat b/build.bat index 825ed05..cd1f219 100644 --- a/build.bat +++ b/build.bat @@ -1 +1,8 @@ +@echo off REM Build Script for BECS + +mkdir build + +pushd ".\build" +cl /GR- /Oi /EHa- /MTd /Zi "..\test\main.c" +popd diff --git a/build.sh b/build.sh index 72cbea7..c30c459 100644 --- a/build.sh +++ b/build.sh @@ -1 +1,3 @@ # Build script for BECS + +echo "Build Script not written" diff --git a/test/main.c b/test/main.c index d562a71..14f3010 100644 --- a/test/main.c +++ b/test/main.c @@ -2,7 +2,7 @@ #include #define BECS_IMPLEMENTATION -#include "becs.h" +#include "../becs.h" typedef struct compA { uint32_t thing;