blob: 17a79a36dd921e5ad8cb4a406944b8af11451361 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include "example.hpp"
#include "components.hpp"
#include "vendor/pk.h"
void OnEntityTypeCollision(const void *lhs, const void *rhs) {
fprintf(stdout, "[Example::OnEntityTypeCollision] Called\n");
}
void OnEntityCollision(const void *lhs, const void *rhs) {
fprintf(stdout, "[Example::OnEntityCollision] Called\n");
}
void OnInit() {
// create/register entity types
pkePluginInterface.PkeEntityInterfaceCount = 1;
pkePluginInterface.PkeEntityInterface = pk_new<PkeEntityTypeInterface>(1);
// set up entity types
auto *typeIntfs = reinterpret_cast<PkeEntityTypeInterface *>(pkePluginInterface.PkeEntityInterface);
typeIntfs[0].OnEntityTypeCollision = reinterpret_cast<CollisionDelegate>(OnEntityTypeCollision);
typeIntfs[0].OnEntityInstanceCollision = reinterpret_cast<CollisionDelegate>(OnEntityCollision);
}
PKEPluginInterface pkePluginInterface {
.OnInit = OnInit,
};
|