New Hugo site in website/ with prosperon.dev theme (blue/gold/castle aesthetic), docs sidebar navigation, and content pages. Rewrote all doc files to align with the actual codebase: compositor+film2d rendering, use() modules (no global prosperon object), Pit language, script+JSON entity model. Added entities.md, front matter to all 70+ API docs, and updated API index for current module architecture. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
107 lines
2.7 KiB
Markdown
107 lines
2.7 KiB
Markdown
---
|
|
title: "os"
|
|
type: docs
|
|
---
|
|
|
|
# os
|
|
|
|
### make_transform() <sub>function</sub>
|
|
|
|
Create a new transform object that can be used for 2D/3D positioning, scaling, and rotation.
|
|
|
|
### clean_transforms() <sub>function</sub>
|
|
|
|
Force an update on all transforms to remove dangling references or perform house-keeping.
|
|
|
|
### platform() <sub>function</sub>
|
|
|
|
Return a string with the underlying platform name, like 'Windows', 'Linux', or 'macOS'.
|
|
|
|
### arch() <sub>function</sub>
|
|
|
|
Return the CPU architecture string for this system (e.g. 'x64', 'arm64').
|
|
|
|
### totalmem() <sub>function</sub>
|
|
|
|
Return the total system RAM in bytes.
|
|
|
|
### freemem() <sub>function</sub>
|
|
|
|
Return the amount of free system RAM in bytes, if known.
|
|
|
|
### hostname() <sub>function</sub>
|
|
|
|
Return the system's hostname, or an empty string if not available.
|
|
|
|
### version() <sub>function</sub>
|
|
|
|
Return the OS or kernel version string, if the platform provides it.
|
|
|
|
### kill() <sub>function</sub>
|
|
|
|
Send a signal (e.g., 'SIGINT', 'SIGTERM', etc.) to the current process.
|
|
|
|
### exit() <sub>function</sub>
|
|
|
|
Exit the application with the specified exit code.
|
|
|
|
### now() <sub>function</sub>
|
|
|
|
Return current time (in seconds as a float) with high resolution.
|
|
|
|
### openurl() <sub>function</sub>
|
|
|
|
Open the provided URL in the default web browser, if possible.
|
|
|
|
### make_timer() <sub>function</sub>
|
|
|
|
Create a new timer object that will call a specified function after a certain delay.
|
|
|
|
### update_timers() <sub>function</sub>
|
|
|
|
Advance all timers by the provided time delta (in seconds).
|
|
|
|
### sleep() <sub>function</sub>
|
|
|
|
Block execution for the specified number of seconds.
|
|
|
|
### battery_pct() <sub>function</sub>
|
|
|
|
Return the battery level (percentage) or negative if unknown.
|
|
|
|
### battery_voltage() <sub>function</sub>
|
|
|
|
Return the current battery voltage in volts, if available.
|
|
|
|
### battery_seconds() <sub>function</sub>
|
|
|
|
Return the estimated remaining battery time in seconds, or negative if unknown.
|
|
|
|
### power_state() <sub>function</sub>
|
|
|
|
Return a string describing power status: 'on battery', 'charging', 'charged', etc.
|
|
|
|
### on() <sub>function</sub>
|
|
|
|
Register a global callback for certain engine-wide or system-level events.
|
|
|
|
### rt_info() <sub>function</sub>
|
|
|
|
Return internal QuickJS runtime info, such as object counts.
|
|
|
|
### rusage() <sub>function</sub>
|
|
|
|
Return resource usage stats for this process, if the platform supports it.
|
|
|
|
### mallinfo() <sub>function</sub>
|
|
|
|
Return detailed memory allocation info (arena size, free blocks, etc.) on some platforms.
|
|
|
|
### env() <sub>function</sub>
|
|
|
|
Fetch the value of a given environment variable, or undefined if it doesn't exist.
|
|
|
|
### system() <sub>function</sub>
|
|
|
|
Execute a shell command using the system() call. Returns the command's exit code.
|