simvx.graphics.app

Vulkan Application layer — direct engine wrapper with node tree support.

Module Contents

Classes

App

Vulkan app wrapper. Supports both raw callbacks and node tree scenes.

Data

API

simvx.graphics.app.__all__

[‘App’]

class simvx.graphics.app.App(title: str = 'SimVX Vulkan', width: int = 1280, height: int = 720, backend: str = 'glfw', physics_fps: int = 60, visible: bool = True, vsync: bool = True, **_kwargs)

Vulkan app wrapper. Supports both raw callbacks and node tree scenes.

Usage with node tree (recommended): app = App(title=”My Game”, width=1280, height=720) app.run(MyGameScene()) # Node subclass with ready()/process()

Usage with raw callbacks: app = App(title=”My Game”) app.run(update=my_update, render=my_render)

Initialization

property engine: simvx.graphics.engine.Engine | None

Access the Vulkan engine (available after run() starts).

run(root_or_update: Any = None, *, update: collections.abc.Callable[[], None] | None = None, render: collections.abc.Callable[[object, tuple[int, int]], None] | None = None) None

Run the Vulkan engine.

Args: root_or_update: Either a Node (scene root) or a legacy update callback. When a Node is passed, SceneTree and input are set up automatically. update: Legacy per-frame callback (alternative to positional arg). render: Custom render callback (cmd, extent). Only used in callback mode.

run_headless(root_node: Any, *, frames: int = 1, on_frame: collections.abc.Callable[[int, float], bool | None] | None = None, capture_frames: list[int] | None = None, capture_fn: collections.abc.Callable[[int], bool] | None = None) list

Run the engine headlessly for frames frames and return captured pixels.

Args: root_node: Scene root node. frames: Total number of frames to simulate. on_frame: Optional callback invoked with (frame_index, time) before each frame. Return False to stop early. capture_frames: Which frame indices to capture (None = capture all). capture_fn: Dynamic capture predicate — called with frame index, captures if True. Takes precedence over capture_frames when provided.

Returns: List of (H, W, 4) uint8 RGBA numpy arrays.