Update example with some platform specific defines for ease of use
This commit is contained in:
parent
ce3c986ad2
commit
afed0aa319
|
|
@ -128,7 +128,11 @@ int main(void) {
|
||||||
// Initialize ECS
|
// Initialize ECS
|
||||||
size_t componentSizes[4] = {sizeof(Position), sizeof(Velocity), sizeof(Acceleration), sizeof(ParticleData)};
|
size_t componentSizes[4] = {sizeof(Position), sizeof(Velocity), sizeof(Acceleration), sizeof(ParticleData)};
|
||||||
size_t memSize = BECS_GetMinMemoryArenaSize(componentSizes, 4);
|
size_t memSize = BECS_GetMinMemoryArenaSize(componentSizes, 4);
|
||||||
printf("%llu\n", memSize);
|
#ifdef _WIN32
|
||||||
|
printf("%lu\n", memSize);
|
||||||
|
#elif __unix__
|
||||||
|
printf("%lu\n", memSize);
|
||||||
|
#endif
|
||||||
char *memory = (char *)malloc(memSize);
|
char *memory = (char *)malloc(memSize);
|
||||||
BECS_ECS ecs = BECS_InitECS(memory, memSize);
|
BECS_ECS ecs = BECS_InitECS(memory, memSize);
|
||||||
|
|
||||||
|
|
@ -183,7 +187,7 @@ int main(void) {
|
||||||
RenderSystemBatched(&ecs, dt, posData, dataData, posArray, radArray, colArray);
|
RenderSystemBatched(&ecs, dt, posData, dataData, posArray, radArray, colArray);
|
||||||
|
|
||||||
DrawText(TextFormat("Particles: %u", ecs.entityCount), 10, 10, 20, WHITE);
|
DrawText(TextFormat("Particles: %u", ecs.entityCount), 10, 10, 20, WHITE);
|
||||||
DrawText(TextFormat("Time: %f", dt * 1000), 10, 30, 20, WHITE);
|
DrawText(TextFormat("Time(ms): %f", dt * 1000), 10, 30, 20, WHITE);
|
||||||
DrawText(TextFormat("FPS: %f", 1/dt), 10, 50, 20, WHITE);
|
DrawText(TextFormat("FPS: %f", 1/dt), 10, 50, 20, WHITE);
|
||||||
DrawText(TextFormat("Screen Res: %d x %d", GetScreenWidth(), GetScreenHeight()), 10, 70, 20, WHITE);
|
DrawText(TextFormat("Screen Res: %d x %d", GetScreenWidth(), GetScreenHeight()), 10, 70, 20, WHITE);
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue