8#include <entt/locator/locator.hpp>
22 auto& lua = entt::locator<sol::state>::value();
24 lua.set(
"GALAXY_DEBUG_BUILD", GALAXY_DEBUG_BUILD);
26#ifdef GALAXY_WIN_PLATFORM
27 lua.set(
"GALAXY_WIN_PLATFORM",
true);
28 lua.set(
"GALAXY_UNIX_PLATFORM",
false);
29#elif GALAXY_UNIX_PLATFORM
30 lua.set(
"GALAXY_WIN_PLATFORM",
false);
31 lua.set(
"GALAXY_UNIX_PLATFORM",
true);
34 auto sub_type = lua.new_usertype<
Subprocess>(
"Subprocess", sol::constructors<Subprocess(), Subprocess(std::string_view)>());
45 lua.new_enum<SDL_PowerState>(
"SDL_PowerState",
47 {
"SDL_POWERSTATE_ERROR", SDL_PowerState::SDL_POWERSTATE_ERROR},
48 {
"SDL_POWERSTATE_UNKNOWN", SDL_PowerState::SDL_POWERSTATE_UNKNOWN},
49 {
"SDL_POWERSTATE_ON_BATTERY", SDL_PowerState::SDL_POWERSTATE_ON_BATTERY},
50 {
"SDL_POWERSTATE_NO_BATTERY", SDL_PowerState::SDL_POWERSTATE_NO_BATTERY},
51 {
"SDL_POWERSTATE_CHARGING", SDL_PowerState::SDL_POWERSTATE_CHARGING},
52 {
"SDL_POWERSTATE_CHARGED", SDL_PowerState::SDL_POWERSTATE_CHARGED}
59 auto cpu_type = lua.new_usertype<
CPUInfo>(
"CPUInfo", sol::constructors<CPUInfo()>());
static void inject_platform() noexcept
Inject platform stuff into Lua.
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.
SDL_PowerState get_battery_status() noexcept
Get battery status.
int get_battery_remaining(const bool percent) noexcept
Get remaining battery charge of a laptop.
Data structure containing info about the cpu, such as RAM, cache, SIMD, etc.
bool has_mmx
Determine whether the CPU has MMX features.
bool has_sse
Determine whether the CPU has SSE features.
bool has_avx
Determine whether the CPU has AVX features.
bool has_sse2
Determine whether the CPU has SSE2 features.
int system_ram
Returns the amount of RAM configured in the system in MiB.
std::size_t simd_alignment
This will return the minimum number of bytes to which a pointer must be aligned to be compatible with...
bool has_avx512f
Determine whether the CPU has AVX-512F (foundation) features.
bool has_sse41
Determine whether the CPU has SSE41 features.
bool has_sse3
Determine whether the CPU has SSE3 features.
bool has_avx2
Determine whether the CPU has AVX2 features.
int logical_core_count
Get the number of logical CPU cores available.
bool has_arm_simd
Determine whether the CPU has ARM SIMD (ARMv6) features.
int system_page_size
Report the size of a page of memory.
bool has_altivec
Returns true if the CPU has AltiVec features or false if not.
bool has_neon
Determine whether the CPU has NEON (ARM SIMD) features.
bool has_sse42
Determine whether the CPU has SSE42 features.
bool has_lasx
Determine whether the CPU has LASX (LOONGARCH SIMD) features.
int cpu_cache_line_size
Determine the L1 cache line size of the CPU.
bool has_lsx
Determine whether the CPU has LSX (LOONGARCH SIMD) features.
bool has_sve2
Determine whether the CPU has SVE2 (Scalable Vector Extension 2).