Expand description
Original immediate/retained renderer and platform ABI. Game code, input, geometry and scheduling live in Rust; hosts only bind OS events and GPU submission.
Modules§
- ao
- Offline, deterministic triangle-scene vertex occlusion. No per-frame ray work.
- audio
- Shared runtime audio. Rust owns clips, voices and mixing; hosts consume PCM.
- canvas
- Aspect-preserving 2D canvas with one coordinate transform for drawing and input.
- content
- Optional authoring bridge. A Source polls only explicit local files or queued browser edits; ordinary frames do no filesystem work or source allocation.
- demo
- Shared native smoke-run support for small interactive examples. Each game supplies its own autoplay inputs and uses the same simulation as a human.
- effects
- Batched low-poly particle billboards and ribbons over the shared color stream. No per-particle mesh, material, texture, GPU buffer or shader allocation.
- icons
- Procedural vector icons: a shared visual vocabulary that replaces words.
- input
- Runtime input uses logical display pixels. Legacy polling remains available; PlayerInput consumes the same ordered, bounded event journal.
- juice
- Presentation “juice”: bursts, sparkles, confetti, shockwave rings, floating popups, toasts, screen shake and flashes that make accepted events felt instead of described.
- lighting
- Bounded frame lighting, explicit quality tiers and a directional shadow volume.
- material
- Reusable shader handles. GPU compilation is host-owned and replacements are transactional.
- mesh
- Reusable geometry with face normals for lit 3D scenes.
- native
- Original system window/input/context bindings and shared native GL submission. Linux uses X11/GLX, Windows uses Win32/WGL, macOS uses AppKit/NSOpenGL, and iOS uses UIKit scenes/CADisplayLink/EAGL. No third-party Rust crates.
- performance
- Shared runtime adapter for optional presentation adaptation and local reports.
- post
- Opt-in full-screen post-processing: bloom, tonemapping, grading, vignette and optional film grain, chromatic aberration and scanlines.
- preferences
- Validated live presentation settings, separate from persistence and simulation.
- prelude
- retained
- Retained low-poly geometry and ordered instanced draw recording.
- shaders
- Original built-in faceted lighting and distance fog.
- shapes
- Anti-aliased immediate 2D shapes: rounded rectangles, circles, rings, arcs, capsules, polylines, gradients, soft shadows and additive glows.
- skinning
- Four-influence linear blend skinning for retained low-poly meshes. Immutable geometry/weights upload once; only bounded pose palettes change each frame.
- status
- Opt-in, read-only status. Games own facts, IDs, availability and accepted events.
- storage
- Typed local saves. Filesystem/browser I/O occurs only on explicit load/commit.
- telemetry
- Opt-in local recordings. GPU durations come only from tagged driver queries.
- text
- Styled bitmap text: a modern mixed-case face, drop shadows, outlines, letter spacing, alignment, measurement and allocation-free word wrapping.
- ui
- Quiet, readable overlay helpers shared by the examples.
- visibility
- Conservative transformed-bound visibility and per-object hysteretic LOD.
Macros§
Structs§
- Batch
- Bitmap
Font Metrics - Validated, reusable font geometry. No atlas, text buffer or allocation is needed.
- Bitmap
Text Metrics - Logical size and tight visible bounds of a measured label.
- Camera2D
- Camera3D
- Color
- Unpremultiplied RGBA floating-point channels. No implicit gamma conversion.
- Conf
- Font
- Mat4
- Column-major 4x4 matrix acting on column vectors:
translation * rotation * scale. - Mesh
- Quat
- Quaternion stored as vector part
(x,y,z)followed by scalar partw. - Rect
- Axis-aligned 2D rectangle. Width and height should be nonnegative.
- Screen
Image - Text
Dimensions - Text
Params - Touch
- Vec2
- Vec3
- Vec4
- Vertex
Enums§
- Font
Measure Error - A font size, scale or resulting coordinate cannot be measured safely.
- KeyCode
- Look
- Authored keeps original colors. Presets preserve alpha and need no extra pass.
- Mouse
Button - Touch
Phase
Constants§
Traits§
Functions§
- autoplay_
enabled - clear_
background - draw_
circle - draw_
circle_ lines - draw_
cube - Draws an axis-aligned resident cuboid.
- draw_
ellipse - Filled ellipse of radii
rx/ryrotated byrotationdegrees, as a 32-segment fan (96 vertices). The rim directions come from a shared table. - draw_
ellipse_ adaptive draw_ellipsewith its segment count chosen from the on-screen size: from 8 segments for a few-pixel blob shadow to 64 for a large ellipse, the same curve density asshapes(2–16 segments per quarter turn). Emits at most 192 vertices; non-finite input draws nothing.- draw_
line - draw_
line_ 3d - draw_
lod - draw_
mesh - draw_
mesh_ transformed - draw_
poly - draw_
rectangle - draw_
rectangle_ lines - draw_
resident - draw_
shadow - Submit a hidden opaque caster, for example a first-person character body.
- draw_
skinned - Record a GPU-skinned mesh using conservative deformed bounds. Position and inverse-transpose normal palettes are copied into this frame; later palette edits cannot change already recorded draws or their matching shadow pass.
- draw_
skinned_ shadow - draw_
skinned_ viewmodel - Draw an animated first-person prop over world geometry, without casting or receiving world shadows. Uses the current perspective and lighting; call after world draws. It never changes the camera or following draw state.
- draw_
text - draw_
text_ ex - Draws classic 5×7 bitmap text with its baseline at
y: one quad per horizontal run of lit font pixels in each glyph row, each exactly one font pixel tall. Coverage is identical to one quad per lit pixel with fewer vertices. Usetext::draw_text_styledwithtext::FontFace::Classicfor the same letters with vertically merged geometry, shadows and outlines. - draw_
triangle - get_
default_ font - get_
frame_ time - get_
screen_ data - get_
time - is_
key_ down - is_
key_ pressed - is_
mouse_ button_ down - is_
mouse_ button_ pressed - look
- measure_
text - mouse_
delta_ position - mouse_
position - mouse_
wheel - next_
frame - quality
- request_
graphics_ reset - Rebuild GPU caches on the next host frame without restarting game state.
- run
- screen_
dpi_ scale - screen_
height - screen_
width - set_
camera - set_
cursor_ grab - set_
default_ camera - Restore the screen-space HUD camera. After a world camera this is also the
post-processing HUD boundary; see
post. - set_
display_ scale - Hosts supply framebuffer pixels per logical input/UI pixel.
- set_
fidelity - Independent presentation detail overrides. Zero follows device/preset defaults.
- set_
lighting - set_
look - Select a palette for world draws. Default-camera HUD drawing stays authored.
- set_
point_ lights - set_
quality - set_
quality_ preference - User preference overrides authored quality; explicit env/URL overrides win.
- set_
sun_ shadow - set_
visibility - set_
world_ colors - Explicit world/HUD boundary for games drawing in screen coordinates.
Turning world colors off is also the post-processing HUD boundary; see
post. - shadow_
quality - Effective shadow tier, including the independent player detail override.
- show_
mouse - simulate_
mouse_ with_ touch - start
- touches
- vec2
- vec3
- vec4
- visibility_
stats - window_
conf