Skip to main content

EngineState reference

Every state event and every /status response includes an EngineState object. It's the single source of truth for what the engine knows about MSFS and itself.

interface EngineState {
isAdmin: boolean;
msfsDetected: boolean;
simConnect: SimConnectStatus;
dll: DllStatus;
isInFlight: boolean;
aircraft: string | null;
encoder: EncoderStatus;
cameraState: number | null;
msfsConnection: MsfsConnectionStatus;
directX: DirectXInfo | null;
markerInjection: MarkerInjectionInfo;
}

Fields

FieldTypeNotes
isAdminbooleanWhether the engine is running elevated. When false, panel capture is disabled.
msfsDetectedbooleanWhether Microsoft Flight Simulator 2024 or 2020 is currently running.
simConnect"connected" | "disconnected" | "error"Low-level link between the engine and the sim.
dllDllStatusInternal capture-link status — prefer msfsConnection for display.
isInFlightbooleanDerived from cameraState — true when the active camera is a cockpit view.
aircraftstring | nullRaw aircraft title from the sim (e.g. "Airbus A320neo FBW").
encoder"active" | "idle" | "error"Whether the capture loop is actively compressing (≥ 1 subscriber).
cameraStatenumber | nullRaw camera state enum — useful if you want to filter cockpit vs external views.
msfsConnectionsee belowDerived, UI-friendly. Use this for status display.
directX{ version: number, supported: boolean } | nullGraphics API version observed inside MSFS. null until the DLL injects and its Present hook fires once. supported is true only for DX12.
markerInjectionsee belowStatus of the engine's Coherent CDP marker-injection cycle (panel identification).

msfsConnection

A derived, single-value status so UIs don't have to combine the raw fields above manually. Prefer this for display.

ValueMeaning
"connected"Fully live — panels are streaming.
"connecting"Link is being established.
"waiting-for-flight"GlassOut is attached to the sim but you're still in the world map / menu. Normal pre-flight state.
"error"Connection to the sim failed.
"off"MSFS not detected.
tip

The capture link only comes up once you enter a flight. Before that it sits in an idle state — this is expected, not an error. Just use msfsConnection for your UI; it handles the transition cleanly.

directX

Only DirectX 12 is supported. The engine detects the API version once the DLL's Present hook fires and surfaces it here so UIs can warn the user to switch. Stays null before that — treat as "unknown", not "broken".

The desktop app's DirectX warning card and the panel viewer's inline "DirectX 11 not supported" error both read this field.

markerInjection

interface MarkerInjectionInfo {
status: "pending" | "ok" | "failed" | "no-msfs";
reason?: string; // populated when status === "failed"
injectedCount?: number; // panels successfully injected on the most recent cycle
lastAttemptAt?: number; // engine wall-clock (Date.now) of the most recent attempt
}

GlassOut identifies panels by content: the engine connects to MSFS's Coherent debugger (CDP) on the post-flight settle window and writes 3 dim marker pixels at (0,0), (0,1), (0,2) on every VCockpit* page. The DLL matches those pixels in every GPU readback to derive a stable panel identity. The cycle re-runs every 60 s.

This field surfaces the cycle's last result so apps can show a clear warning when injection fails — the most common cause is another tool holding the Coherent debugger socket.

encoder

The capture loop only runs while at least one client is subscribed to a panel. When the last subscriber leaves, encoder drops to "idle" and the engine stops all CPU work. This is why unused panels cost you nothing.

Per-client info

EngineState is the engine snapshot. Per-client info (the list of connected clients, their names, their connection types) lives in /status under the clients field but is not part of EngineState. It's not pushed over WebSocket — fetch it over HTTP if you need it.