Backend

spec.Backend (Interface) → backend.Backend

Main backend interface that provides access to all platform-specific functionality.

This is the central contract that all backend implementations (Clay, Unity, Headless, Web) must fulfill to run Ceramic applications. Each backend provides concrete implementations of the various subsystem interfaces (audio, graphics, input, etc.).

The backend is initialized early in the application lifecycle and provides the bridge between Ceramic's platform-agnostic code and the underlying platform APIs.

Instance Members

File system and asset loading operations. Handles reading/writing files and loading assets from various sources.


System and platform information. Provides details about the runtime environment, platform capabilities, and system state.


Audio playback and processing system. Manages sound loading, playback, effects, and bus routing.


Graphics rendering system. Handles all drawing operations, shader management, and GPU communication.


Text rendering and font management. Provides text measurement, rendering, and font handling capabilities.


Binary data loading and management. Handles loading raw binary files and data buffers.


Texture loading and management. Handles image loading, texture creation, and GPU texture operations.


Screen and window management. Controls display properties, window state, and screen-related events.


Text input and IME (Input Method Editor) support. Handles keyboard text entry, virtual keyboards, and international input methods.


System clipboard operations. Provides copy/paste functionality for text and data.


init(app: ceramic.App): Void

Initializes the backend with the main application instance. This is called once during application startup, before any other backend methods. The backend should set up platform-specific systems and prepare for operation.

Name Type Description
app ceramic.App The main Ceramic application instance

setTargetFps(fps: Int): Void

Sets the target frame rate for the application. The backend should attempt to maintain this frame rate, though actual FPS may vary based on system performance and vsync settings.

Name Type Description
fps Int The target frames per second (typically 30, 60, or 120)