Displays: on-screen cockpit buttons + desktop plasma + the glass preset (steps 2d/2e)

NEW gated TUs: L4PADPANEL (GDI top-level window, all-W APIs: the pod button
banks -- upper/lower aux, 12 secondary, specials/hat/handle, 63 buttons --
clickable via PadRIO::SetScreenButton with lamp-lit faces from GetLampState,
10 Hz repaint; created by the PadRIO ctor on BT_PAD_PANEL=1) and L4PLASMAWIN
(PlasmaWindow : Video8BitBuffered -- the gauge renderer draws the 128x32
plasma into its pixelBuffer through the SAME code path as the serial device;
Update() blits orange-on-black at L4PLASMASCALE, default x4).  Gated seams:
L4GREND.cpp L4PLASMA=SCREEN branch; btl4main.cpp -platform glass preset
(PAD,KEYBOARD + BT_DEV_GAUGES + SCREEN plasma + panel; env always overrides;
non-glass builds log+fall back to DEV); run.cmd glass token.  MFD surfaces
need NO new code: the existing dock-bottom / BT_DEV_GAUGES_WINDOW=1 /
BT_DEV_GAUGES_DOCK=1 modes are the display story.

Verified live: -platform glass boots GLASS profile, panel + plasma windows
up, pad detected, dev gauges awake, mission loop clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-17 22:21:22 -05:00
co-authored by Claude Fable 5
parent 9f35a8034a
commit db9ac947f7
9 changed files with 629 additions and 8 deletions
+30
View File
@@ -234,9 +234,11 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
// primary adapter) -- selectable for bring-up, not fully validated off-pod.
// ---------------------------------------------------------------------------
int gBTPlatformPod = 0;
int gBTPlatformGlass = 0;
{
const char *pe = getenv("BT_PLATFORM");
if (pe && _stricmp(pe, "pod") == 0) gBTPlatformPod = 1;
if (pe && _stricmp(pe, "glass") == 0) gBTPlatformGlass = 1;
// Convenience: also accept a raw `-platform pod` on the command line,
// parsed off lpCmdLine independently of L4Application::ParseCommandLine.
const char *pf = lpCmdLine ? strstr(lpCmdLine, "-platform") : 0;
@@ -245,7 +247,18 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
char pv[16] = { 0 };
if (sscanf(pf + 9, " %15s", pv) == 1 && _stricmp(pv, "pod") == 0)
gBTPlatformPod = 1;
if (pv[0] && _stricmp(pv, "glass") == 0)
gBTPlatformGlass = 1;
}
#ifndef BT_GLASS
if (gBTPlatformGlass)
{
std::cout << "[boot] platform 'glass' ignored: not in this build "
"(configure with -DBT_GLASS=ON); falling back to DEV"
<< std::endl << std::flush;
gBTPlatformGlass = 0;
}
#endif
}
if (gBTPlatformPod)
@@ -269,6 +282,22 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
if (getenv("L4GAUGE") != NULL && getenv("L4PLASMA") == NULL)
putenv("L4PLASMA=com2"); // only when the pod env already asked for gauges
}
#ifdef BT_GLASS
else if (gBTPlatformGlass)
{
// GLASS profile (dev tooling, step 2e): the desktop cockpit --
// PadRIO input (XInput+keyboard, content\bindings.txt), the
// on-screen clickable button panel, the dev-composited MFD
// surfaces (dock-bottom default; BT_DEV_GAUGES_WINDOW=1 separate
// window / BT_DEV_GAUGES_DOCK=1 overlay inset), and the desktop
// plasma window. Each only when not already set, so a developer
// env overrides the preset.
if (getenv("L4CONTROLS") == NULL) putenv("L4CONTROLS=PAD,KEYBOARD");
if (getenv("BT_DEV_GAUGES") == NULL) putenv("BT_DEV_GAUGES=1");
if (getenv("L4PLASMA") == NULL) putenv("L4PLASMA=SCREEN");
if (getenv("BT_PAD_PANEL") == NULL) putenv("BT_PAD_PANEL=1");
}
#endif
else
{
// DEV profile (default): keyboard controls, single 800x600 window.
@@ -295,6 +324,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
std::cout << "[boot] platform profile: "
<< (gBTPlatformPod ? "POD (RIO cockpit input; multi-surface gauges/MFDs via pod hardware or explicit L4GAUGE)"
: gBTPlatformGlass ? "GLASS (PadRIO + on-screen panel + dev MFDs + plasma window)"
: "DEV (single window + keyboard)")
<< std::endl << std::flush;