Skip to main content

Module prelude

Module prelude 

Source
Expand description

Common imports for game development.

Glob-import this module to bring the everyday game-dev types into scope: input (InputEvent, KeyCode, MouseButton), timing (Time, SharedTime), assets (AssetHandle, AssetUUID), and the ecs, materials, and math sub-modules. The window config types WindowConfig and WindowIcon come along too.

§Examples

use khora_sdk::prelude::*;
use khora_sdk::prelude::math::Vec3;

// ECS components, math, and materials are all reachable through the prelude.
let _transform = ecs::Transform::from_translation(Vec3::new(0.0, 1.0, 0.0));
let _material = materials::StandardMaterial::default();
let _red = math::LinearRgba::RED;

Re-exports§

pub use crate::WindowConfig;
pub use crate::WindowIcon;
pub use crate::PRIMARY_VIEWPORT;

Modules§

ecs
Core ECS types for game logic.
materials
Built-in material types.
math
Math types and utilities.

Structs§

AssetHandle
A thread-safe, reference-counted handle to a loaded asset’s data.
AssetUUID
A globally unique, persistent identifier for a logical asset.
SaaTrackingAllocator
A wrapper around a GlobalAlloc implementation (like std::alloc::System) that intercepts allocation calls to update the global memory counters defined in khora_core::memory.
Time
Per-frame timing state shared between the simulation and the render path.

Enums§

InputEvent
An engine-internal representation of a user input event.
KeyCode
Type-safe physical key codes — a 1-to-1 mirror of winit::keyboard::KeyCode but living in khora-core so app code never has to depend on winit.
MouseButton
An engine-internal representation of a mouse button.

Type Aliases§

SharedTime
Shared, interior-mutable handle to the engine’s Time resource.