C++ API
Start here when integrating Fx2D into another CMake project. The public API has two layers:
- The integration reference on this site explains which header and library target to use.
- The generated symbol reference documents every public class, struct, enum, and member from
include/Fx2D/.
Headers and entry pointsChoose `Core.h`, `Scene.h`, or a focused public header.Link Fx2DlibAdd Fx2D to a parent CMake project, headless or renderer-enabled.Headless simulationCreate and step scenes with no raylib, ImGui, or window.Visual applicationsLoad YAML scenes and run the raylib renderer.
Choose an integration path
| You are building… | Include | Link target | Next |
|---|---|---|---|
| A visual app backed by a YAML scene | Fx2D/Core.h | Fx2Dlib | Renderer integration |
| A headless YAML simulation | Fx2D/Scene.h + Fx2D/YamlUtils.h | Fx2Dlib built with FX2D_HEADLESS=ON | Headless integration |
| A programmatic physics world | Fx2D/Scene.h, Fx2D/Entity.h | Fx2Dlib built with FX2D_HEADLESS=ON | Headers and entry points |
| A specific engine feature | Its focused public header | Fx2Dlib | Header map |
Generated symbol reference
Use the generated reference when you need signatures, fields, inheritance, or every member of a type. It is built from the repository headers during each Pages deployment.
All public symbols →Browse classes, structs, files, and include relationships.FxScene →Stepping, entities, contacts, queries, groups, and reset.FxEntity →Body state, mass, geometry, forces, impulses, and sleep.FxShape →Circles, capsules, polygons, chains, and geometry queries.
Fx2Dlibis the repository’s CMake target. Fx2D does not currently ship an installedfind_package(Fx2D)package, so consume it withadd_subdirectoryor CMakeFetchContentas shown in linking Fx2D.