Properly link flecs library
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#ifndef ${id upper}_H
|
||||
#define ${id upper}_H
|
||||
|
||||
/* This generated file contains includes for project dependencies */
|
||||
#include "${id dash}/bake_config.h"
|
||||
|
||||
// Reflection system boilerplate
|
||||
#undef ECS_META_IMPL
|
||||
#ifndef ${id underscore}_EXPORTS
|
||||
#define ECS_META_IMPL EXTERN // Ensure meta symbols are only defined once
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
ECS_STRUCT(MyComponent) {
|
||||
float x;
|
||||
float y;
|
||||
});
|
||||
*/
|
||||
|
||||
void ${id pascalcase}Import(
|
||||
ecs_world_t *world);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
7
engine/libs/flecs/templates/c/flecs-module/project.json
Normal file
7
engine/libs/flecs/templates/c/flecs-module/project.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"id": "flecs.module",
|
||||
"type": "template",
|
||||
"value": {
|
||||
"use": ["flecs"]
|
||||
}
|
||||
}
|
||||
9
engine/libs/flecs/templates/c/flecs-module/src/main.c
Normal file
9
engine/libs/flecs/templates/c/flecs-module/src/main.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <${id underscore}.h>
|
||||
|
||||
void ${id pascalcase}Import(
|
||||
ecs_world_t *world)
|
||||
{
|
||||
ECS_MODULE(world, ${id pascalcase});
|
||||
|
||||
// ECS_COMPONENT_DEFINE(world, MyComponent);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef ${id upper}_H
|
||||
#define ${id upper}_H
|
||||
|
||||
/* This generated file contains includes for project dependencies */
|
||||
#include "${id dash}/bake_config.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
7
engine/libs/flecs/templates/c/flecs/project.json
Normal file
7
engine/libs/flecs/templates/c/flecs/project.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"id": "flecs",
|
||||
"type": "template",
|
||||
"value": {
|
||||
"use": ["flecs"]
|
||||
}
|
||||
}
|
||||
16
engine/libs/flecs/templates/c/flecs/src/main.c
Normal file
16
engine/libs/flecs/templates/c/flecs/src/main.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include <${id underscore}.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
ecs_world_t *world = ecs_init_w_args(argc, argv);
|
||||
|
||||
/* Set target FPS for main loop */
|
||||
ecs_set_target_fps(world, 60);
|
||||
|
||||
printf("Application ${id} is running, press CTRL-C to exit...\n");
|
||||
|
||||
/* Run systems */
|
||||
while ( ecs_progress(world, 0));
|
||||
|
||||
return ecs_fini(world);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef ${id upper}_H
|
||||
#define ${id upper}_H
|
||||
|
||||
/* This generated file contains includes for project dependencies */
|
||||
#include "${id dash}/bake_config.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
8
engine/libs/flecs/templates/cpp/flecs/project.json
Normal file
8
engine/libs/flecs/templates/cpp/flecs/project.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"id": "flecs",
|
||||
"type": "template",
|
||||
"value": {
|
||||
"use": ["flecs"],
|
||||
"language": "c++"
|
||||
}
|
||||
}
|
||||
13
engine/libs/flecs/templates/cpp/flecs/src/main.cpp
Normal file
13
engine/libs/flecs/templates/cpp/flecs/src/main.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <${id underscore}.h>
|
||||
#include <iostream>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
flecs::world world(argc, argv);
|
||||
|
||||
world.set_target_fps(1);
|
||||
|
||||
std::cout << "Application ${id} is running, press CTRL-C to exit..." << std::endl;
|
||||
|
||||
/* Run systems */
|
||||
while (world.progress()) { }
|
||||
}
|
||||
Reference in New Issue
Block a user