galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
LuaEntt.cpp
Go to the documentation of this file.
1
7
8#define AUTO_ARG(x) decltype(x), x
9
10#include <entt_sol/dispatcher.hpp>
11#include <entt_sol/registry.hpp>
12#include <entt_sol/script_process.hpp>
13#include <entt/locator/locator.hpp>
14
15namespace galaxy
16{
17 namespace lua
18 {
20 {
21 // https://github.com/skaarj1989/entt-meets-sol2/blob/main/examples/registry/main.cpp
22 // https://github.com/skaarj1989/entt-meets-sol2/blob/main/examples/dispatcher/main.cpp
23 // https://github.com/skaarj1989/entt-meets-sol2/blob/main/examples/scheduler/main.cpp
24 // https://github.com/skaarj1989/entt-meets-sol2/blob/main/examples/system/main.cpp
25 // https://github.com/skaarj1989/entt-meets-sol2/tree/main/scripts
26
27 auto& lua = entt::locator<sol::state>::value();
28
29 lua.require("registry", sol::c_call<AUTO_ARG(&entt_sol::open_registry)>);
30 lua.require("dispatcher", sol::c_call<AUTO_ARG(&entt_sol::open_dispatcher)>);
31 lua.require("scheduler", sol::c_call<AUTO_ARG(&entt_sol::open_scheduler)>);
32
33 auto entt_anytype = lua.new_usertype<entt::any>("EnttAny", sol::no_constructor);
34 entt_anytype["reset"] = &entt::any::reset;
35 entt_anytype["type"] = &entt::any::type;
36 }
37 } // namespace lua
38} // namespace galaxy
#define AUTO_ARG(x)
LuaEntt.cpp galaxy.
Definition LuaEntt.cpp:8
void inject_entt()
Injects EnTT into Lua.
Definition LuaEntt.cpp:19
Timer.hpp galaxy.
Definition Async.hpp:17