Squashed 'external/entt/entt/' content from commit fef92113

git-subtree-dir: external/entt/entt
git-subtree-split: fef921132cae7588213d0f9bcd2fb9c8ffd8b7fc
This commit is contained in:
2023-07-25 11:29:51 +02:00
commit 5c7231b7a3
242 changed files with 146004 additions and 0 deletions

38
test/lib/meta/lib.cpp Normal file
View File

@@ -0,0 +1,38 @@
#include <entt/core/attribute.h>
#include <entt/core/hashed_string.hpp>
#include <entt/meta/factory.hpp>
#include <entt/meta/meta.hpp>
#include "types.h"
position create_position(int x, int y) {
return position{x, y};
}
ENTT_API void share(entt::locator<entt::meta_ctx>::node_type handle) {
entt::locator<entt::meta_ctx>::reset(handle);
}
ENTT_API void set_up() {
using namespace entt::literals;
entt::meta<position>()
.type("position"_hs)
.ctor<&create_position>()
.data<&position::x>("x"_hs)
.data<&position::y>("y"_hs);
entt::meta<velocity>()
.type("velocity"_hs)
.ctor<>()
.data<&velocity::dx>("dx"_hs)
.data<&velocity::dy>("dy"_hs);
}
ENTT_API void tear_down() {
entt::meta_reset<position>();
entt::meta_reset<velocity>();
}
ENTT_API entt::meta_any wrap_int(int value) {
return value;
}