Skip to content

Public API wiki

API

Conjure is a data-oriented 2D/3D game engine written in C++20 with a C# scripting layer, an editor that AI agents can drive and a standalone runtime for shipping. This wiki is for the people who build games with it: designers, gameplay programmers, C# scripters and agents driving the editor. It explains what the engine offers and how to use it; it does not explain how the engine is built inside (that is the 🛠 Engineering handbook, which every page links to where a sibling exists).

What Conjure offers

Layer What you get Where it is documented
Core numbers, errors, logging, math, containers, strings, memory, time, jobs, JSON, files, reflection Core pages
Entities and components archetype-based ECS with change detection, command buffers and system scheduling ECS pages
Platform the game window, per-frame events and the input snapshot Platform pages
Graphics device the device, swapchain and compiled shaders the renderer builds on RHI pages
Assets stable asset references, loading, importers, hot reload, cooking and packs Assets pages
Audio clips, voices, mix groups, 3D listener, backends Audio pages
Modules writing a plugin or game module and loading modules into a host Modules pages
Scene the entity hierarchy, transforms, names and guids, scene files, prefabs, snapshots and scene loading Scene pages
Rendering the renderer with 2D and 3D pipelines, render targets, the renderer's asset types and the glTF importer Renderer pages
Physics rigid bodies and colliders, the character controller, layers, contacts and queries over Jolt Physics pages
Scripting the .NET host, the script runtime and components, hot reload and the managed build Scripting pages
Engine the application that owns every module, configuration and project.json, the frame, layers, export Engine pages
C# API the API as you see it from a script (Entity, Transform, Physics, Input,...) and the native table behind it Bindings pages
Editor and AI protocol the editor, headless mode, and the command protocol agents use to drive it Editor pages
Runtime the standalone conjure_runtime executable that runs an exported game Runtime page

How the pages are organised

Pages are organised by what you want to do, not by header. One page covers one user-facing topic and may span several headers; small things are grouped (the Data types page covers u8 through f64, flag enumerations and uuid together). Every page follows the same shape, so you can skim:

  1. a title, API breadcrumb, and short purpose,
  2. metadata naming the module, include path, and handbook counterpart,
  3. Syntax with a complete example,
  4. an At a glance table, followed by Variables and Properties and Functions,
  5. relevant coloured callouts and API See also links.

Existing topic pages may retain their Quick example and API summary headings; the four reusable templates provide the structure for new pages.

The coloured callouts mean the same thing on every page: the legend is on the landing page. In short, a TIP points at the better function, a WARNING at a gotcha and a CAUTION at undefined behaviour or data loss.

Signatures in the API summaries are shortened by hand; the header is always the source of truth and every page names the headers it covers by include path, for example conjure/core/result.h.

Reading order

If you are new to the engine, read the core pages in this order; each builds on the one before:

  1. Data types: the number aliases and flag enumerations every signature uses.
  2. Errors and results: how every fallible call reports failure (the engine never throws).
  3. Logging and assertions: how to print, filter and catch programmer errors.
  4. Strings and identifiers: hashed names (string_id) and the string helpers.
  5. Containers: handles that detect stale use, inline vectors, flat maps.
  6. Memory: only when you allocate yourself; arenas, pools and per-frame scratch memory.

Everything else can be read on demand.

Core pages

Page Covers
Data types u8..u64, f32, usize, byte, KIB/MIB/GIB, flag enumerations, deleting copies, uuid, platform and build macros
Errors and results result<T>, status, error, error_code, make_error, CONJURE_TRY, CONJURE_TRY_ASSIGN, error categories
Logging and assertions log categories and levels, sinks, CONJURE_LOG_*, CONJURE_ASSERT, CONJURE_VERIFY, the assert handler
Math vectors, matrices, quaternions, transforms, bounding volumes, rays, rectangles
Containers slot_map, small_vector, stable_vector, flat_hash_map, flat_hash_set, flat_map
Strings and identifiers string_id, FNV-1a hashing, str:: helpers, bit_vector, radix sort
Memory allocation counters, tracked_allocate, arena, pool_allocator, frame_allocator
Time, events and random clocks and stopwatches, seeded random numbers, events, delegates, the event bus
Jobs and threading the job system, parallel_for, the main thread, dedicated threads
JSON parsing, reading and writing JSON documents
Files and the virtual file system mounting file systems, reading and writing files, path helpers
Processes, libraries and images spawning processes, loading shared libraries, decoding images
Reflection describing your types so the editor, serialiser and scripts can see them

ECS pages

Start with the overview; it gives the mental model in five sentences and a table of the terms the other pages use.

Page Covers
Entities, components and systems the mental model (entities, components, archetypes, systems, phases), which page to read for what, local terms table
Entities and components CONJURE_COMPONENT, the component registry, world create / destroy / add / get / remove, entity_handle, component_type_desc for module authors
Queries, views and systems typed view<...> iteration, query and chunk_view, changed<T>, system_desc and make_system, phases and the scheduler
Command buffers and observers deferred structural changes from systems and jobs, flush, observers for added and removed components, the iteration lock, world_hash
Archives and serialisation entity_archive for prefabs, copy and paste and undo, JSON in and out, what archetypes and chunks are when you meet them in tools

Platform pages

Page Covers
Platform: windows, input and events what the module gives you, who owns the window and the input in a game, backends (GLFW and null), the error codes
Windows and events window_desc, create_window(), pumping events, the event types, monitors, high-DPI sizes, fullscreen, cursor modes, the null backend's push_event / simulate_*
Input the input accumulator and the input_state snapshot, pressed / released versus down / held, modifiers, mouse and gamepads, injecting input in tests

RHI pages

Page Covers
Graphics device layer (RHI) what the RHI is, who needs it and when to wait for the renderer instead, the render-thread rule
Devices and swapchains device_desc and device::create(), backends, the null device and null_device_stats, swapchain, headless mode, device loss, texture formats
Shaders conjure_add_shaders() at build time, index.json, shader_library and shader keys, permutations and define axes, DXIL and SPIR-V blobs

Assets pages

Page Covers
Assets how assets work from the outside: uuids and .meta sidecars, asset paths, sub-assets, the editor and runtime halves of the pipeline
Referencing and loading assets asset_ref<T> and asset_handle, asset_manager load / flush / collect, batches, states, priorities, fallbacks, publish and retire
Database, importers and hot reload asset_database, .meta records, writing an importer and a loader, asset_type_registry, side files, the file watcher and hot reload
Cooking, caches and packs the cooked blob format, the cache, asset_source, the cooker, content.cpak and its manifest, extension records for plugin modules

Audio pages

Page Covers
Audio the pieces and how they fit, the audio_source and audio_listener components and how the engine will sync them
Playing sounds audio_engine, play_params and voice_id, one-shot versus retained voices, mix groups, the listener and 3D attenuation, priorities and stealing, devices and device loss
Clips and decoding audio_clip (PCM and streamed), the conjure.audio.clip asset type and its import settings, decoders, the backend interface and the null backend

Modules pages

Page Covers
Modules and plugins what a module is (manifest, native library, C# assemblies, content), how the engine loads them, where to go next
Writing a module module.json, the entry point, module_registrar and extension points, module_context, services, static modules
Loading and managing modules module_manager discover / load / unload / reload, module_registry, consumers, the ABI check, shadow copies, reload scopes, the export layout

Scene pages

Page Covers
Scenes, hierarchy and prefabs the mental model (one world, roots, depth, guids, owners), the scene components, which page to read for what
Scenes and the hierarchy scene create / parent / move / destroy, names, tags, layers, finding entities, the tree queries, the transform system and the four scene systems
Scene files, prefabs and snapshots .scene.json save and load, scene_manager loads and unloads, prefabs (build, instantiate, diff, revert, apply, unpack, prefab_builder), snapshots

Renderer pages

Page Covers
Rendering what the renderer does, CPU assets versus GPU ids, the render_scene contract, headless rendering
Rendering a frame renderer::create, uploads and ids, views, instances, lights, sprites, debug lines, render targets and read-back, render_stats, the components, ImGui
Renderer assets meshes, textures, materials, models, environments, the glTF importer, the built-in shader programs
JPEG XL images .jxl textures and skies: colour profiles, bit depths, orientation, animation; encode_jpeg_xl

Physics pages

Page Covers
Physics bodies from components, the four-call fixed step, queued commands, contacts, queries, layers
Bodies, colliders and characters rigid_body, the colliders, materials, motion types and flags, layers from project.json, the character controller, collision mesh assets
The physics world and queries physics_world creation and stepping, forces and teleports, contact events, raycasts, overlaps and shape casts, physics_settings, debug drawing

Scripting pages

Page Covers
Scripting hosts, the runtime, the script component, modes and phases, the field blob
Scripts, components and the runtime add_script, fields, play and edit modes, the phases and the six systems, destruction, the class registry, DOD query scopes
Hosting, the native API and hot reload the CLR host and the null host, the managed directory, the two ABI tables and their hash, hot_reload_controller, managed_build_runner

Engine pages

Page Covers
Engine: the application and the frame the mental model (one application, subsystems, phases, layers), the startup order, which page to read for what
Running the engine engine_config and the settings structs, project.json, the command line, application_desc::from_command_line, application create / initialise / run / shutdown, engine_context, exit codes
The frame, layers and time the frame steps, the fixed step and interpolation, engine_time, frame_stats, frame_memory, layer and layer_stack, engine_subsystem, pause and single-step
Export and diagnostics export_pipeline, the exported folder, check_registry, render-failure handling, the engine's log category

Bindings pages

Page Covers
Scripting from C#: the bindings what the bindings add to the scripting module, the status protocol, what a script may call where
The C# API Entity, Transform, Scene, Prefab, Rigidbody, CharacterController, Physics, AudioSource, Audio, Input, AssetRef<T>, Diagnostics, the [NativeComponent] mirrors
The native table scripting_bindings_subsystem, fill_native_table, bindings_error, call counters, structural routing inside query scopes, adding an entry

Editor pages

Page Covers
The editor the three libraries (core, widget kit, UI) and the executable, the command line, headless and windowed modes, every editor header and its page, where to go next
The AI control protocol the NDJSON protocol over TCP, stdio and the loopback, requests, responses, events, error codes, the command groups, editor.schema, the prefab, theme, preference and layout commands, keeping values from play, --user-config, the two tokens (full control, inspect only) and the audit log
Headless mode and the command model editor_application and its startup order, editor_options, headless_runner and --exec, command_dispatcher, undo, play mode and play-mode persist, picking, screenshots, editor_context, the user's settings and the UI host, project trust
The workspace UI editor_layer, editor_workspace, the default layout, the menus and dialogs, the start screen, the panels (Scene, Game, Project settings, Persist), editor_panel, property_drawer, gizmos
The toolbar and the status bar toolbar_panel, status_bar: the fixed bars drawn with the widget kit, their controls, segments and keys
Themes theme, the .conjure-theme.json file, the readability rules, the built-in themes, theme_library, editor.theme.*
Fonts and code ligatures the editor's fonts, text sizes and the UI scale, the code font's ligatures, editor.preferences.*
The widget kit tokens, the painter, widgets, containers, popups, icons, kit_context, the kit records a module adds

Runtime page

Page Covers
The runtime conjure_runtime command line, exit codes, what an exported folder contains, Distribution builds

Cross-cutting

  • Glossary: every term the wiki uses, one line each, with a link to the page that explains it.

Note

Most core types live in namespace conjure::core. The number aliases (u32, usize,...), the size constants (KIB, MIB, GIB, CACHE_LINE_SIZE) and the flag helpers (has_flag, has_any_flag, with_flag, without_flag, to_underlying) live directly in namespace conjure so every module can use them unqualified; memory, hashing and string helpers live in conjure::core::memory, conjure::core::hash and conjure::core::str. Each page states the namespace it uses. Examples on these pages open with using namespace conjure; and using namespace conjure::core; for brevity; in your own headers, qualify.