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
11
#include "
galaxy/platform/Pragma.hpp
"
12
#include "
galaxy/platform/Subprocess.hpp
"
13
14
namespace
galaxy
15
{
16
namespace
lua
17
{
18
void
inject_platform
()
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
Pragma.hpp
GALAXY_ZLIB_COMPLETE_CHUNK
#define GALAXY_ZLIB_COMPLETE_CHUNK
Pragma.hpp galaxy.
Definition
Pragma.hpp:14
Subprocess.hpp
galaxy::Subprocess
Manages a subprocess launched by galaxy.
Definition
Subprocess.hpp:22
galaxy::Subprocess::kill
void kill() noexcept
Terminates process.
Definition
Subprocess.cpp:56
galaxy::Subprocess::create
void create(std::string_view process, std::span< std::string > args={})
Launch a subprocess.
Definition
Subprocess.cpp:30
galaxy::Subprocess::wait
bool wait(const bool block) noexcept
Wait for a process to finish execution.
Definition
Subprocess.cpp:51
galaxy::lua::inject_platform
void inject_platform()
Inject platform stuff into Lua.
Definition
LuaPlatform.cpp:18
galaxy
Timer.hpp galaxy.
Definition
Timer.cpp:18
galaxy
src
galaxy
lua
injects
LuaPlatform.cpp
Generated on Wed Aug 20 2025 08:06:51 for galaxy by
1.12.0