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
LuaPlatform.cpp
Go to the documentation of this file.
1
7
8#include <entt/locator/locator.hpp>
9#include <sol/sol.hpp>
10
13
14namespace galaxy
15{
16 namespace lua
17 {
19 {
20 auto& lua = entt::locator<sol::state>::value();
21
22 lua.set("GALAXY_ZLIB_COMPLETE_CHUNK", GALAXY_ZLIB_COMPLETE_CHUNK);
23 lua.set("GALAXY_DEBUG_BUILD", GALAXY_DEBUG_BUILD);
24
25#ifdef GALAXY_WIN_PLATFORM
26 lua.set("GALAXY_WIN_PLATFORM", true);
27 lua.set("GALAXY_UNIX_PLATFORM", false);
28#elif GALAXY_UNIX_PLATFORM
29 lua.set("GALAXY_WIN_PLATFORM", false);
30 lua.set("GALAXY_UNIX_PLATFORM", true);
31#endif
32
33 auto sub_type = lua.new_usertype<Subprocess>("Subprocess", sol::constructors<Subprocess(), Subprocess(std::string_view)>());
34 sub_type["create"] = &Subprocess::create;
35 sub_type["kill"] = &Subprocess::kill;
36 sub_type["wait"] = &Subprocess::wait;
37 }
38 } // namespace lua
39} // namespace galaxy
#define GALAXY_ZLIB_COMPLETE_CHUNK
Pragma.hpp galaxy.
Definition Pragma.hpp:14
Manages a subprocess launched by galaxy.
void kill() noexcept
Terminates process.
void create(std::string_view process, std::span< std::string > args={})
Launch a subprocess.
bool wait(const bool block) noexcept
Wait for a process to finish execution.
void inject_platform()
Inject platform stuff into Lua.
Timer.hpp galaxy.
Definition Timer.cpp:18