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
LuaServices.cpp
Go to the documentation of this file.
1
7
8#include <entt/locator/locator.hpp>
9#include <sol/sol.hpp>
10
14
15#include "../Lua.hpp"
16
17namespace galaxy
18{
19 void Lua::inject_services() noexcept
20 {
21 auto& lua = entt::locator<sol::state>::value();
22
23 // logging -> already added.
24 // thread_pool -> not compatible.
25 lua["galaxy_config"] = std::ref(entt::locator<Config>::value());
26 lua["galaxy_fs"] = std::ref(entt::locator<VirtualFileSystem>::value());
27 lua["galaxy_window"] = std::ref(entt::locator<Window>::value());
28 // lua["galaxy_dispatcher"] = std::ref(entt::locator<entt::dispatcher>::value()); // TODO FIX
29 // lua state -> not needed.
30
31 /*
32 lua["galaxy_nui"] = std::ref(entt::locator<ui::NuklearUI>::value());
33 lua["galaxy_scenes"] = std::ref(entt::locator<scene::SceneManager>::value());
34 lua["galaxy_entitymeta"] = std::ref(entt::locator<meta::EntityMeta>::value());
35 lua["galaxy_soundengine"] = std::ref(entt::locator<media::SoundEngine>::value());
36 lua["galaxy_voiceengine"] = std::ref(entt::locator<media::VoiceEngine>::value());
37 lua["galaxy_musicengine"] = std::ref(entt::locator<media::MusicEngine>::value());
38 lua["galaxy_animations"] = std::ref(entt::locator<resource::Animations>::value());
39 lua["galaxy_sounds"] = std::ref(entt::locator<resource::SoundCache>::value());
40 lua["galaxy_music"] = std::ref(entt::locator<resource::MusicCache>::value());
41 lua["galaxy_voice"] = std::ref(entt::locator<resource::VoiceCache>::value());
42 lua["galaxy_videos"] = std::ref(entt::locator<resource::VideoCache>::value());
43 lua["galaxy_shaders"] = std::ref(entt::locator<resource::Shaders>::value());
44 lua["galaxy_fonts"] = std::ref(entt::locator<resource::Fonts>::value());
45 lua["galaxy_textures"] = std::ref(entt::locator<resource::Textures>::value());
46 lua["galaxy_prefabs"] = std::ref(entt::locator<resource::Prefabs>::value());
47 lua["galaxy_scripts"] = std::ref(entt::locator<resource::Scripts>::value());
48 lua["galaxy_fontcontext"] = std::ref(entt::locator<graphics::FontContext>::value());
49 */
50 }
51} // namespace galaxy
static void inject_services() noexcept
Regsiter static engine services in Lua.
Animated.cpp galaxy.
Definition Animated.cpp:16