Assemble the whole cockpit in a single window

The main game window becomes the cockpit shell (enlarged, clipping
children); every display folds in as a chrome-less child pane in the
pod interior arrangement:

  [ MFD UL ] [ MFD UC ] [ MFD UR ]
  [ plasma (reduced) ][ viewscreen (centered) ]
  [ MFD LL ] [   Map  ] [ MFD LR ]

The 3D scene presents into a black STATIC viewscreen child via
Present's hDestWindowOverride (new gMainPresentWindow global) - no
swap-chain changes, and STATIC's transparent hit-testing keeps mouse
input over the 3D view flowing to the game window. MFDSplitView gains a
parent/child mode; PlasmaScreen::Position reparents the glass into the
shell. Main window class background goes black for the cockpit gaps.

Verified by screenshot: live green gauges (LIFT CUT / BOOST / CHUTE /
trigger-program screens) with their red button strips, the 3D canyon in
the centered viewscreen, plasma score glass at its left, map with lit
amber preset lamps - one window, 976x1132 client at 50% scale.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-12 14:52:26 -05:00
co-authored by Claude Fable 5
parent 775ee130a7
commit aa24968c3d
12 changed files with 222 additions and 96 deletions
+35 -12
View File
@@ -61,6 +61,7 @@ namespace
view->Paint();
return 0;
}
// no instance (e.g. the plain viewscreen child): default paint
break;
case WM_LBUTTONDOWN:
@@ -86,7 +87,11 @@ namespace
return 0;
case WM_ERASEBKGND:
return 1;
if (view != NULL)
{
return 1;
}
break; // viewscreen child: erase with the class black brush
}
return DefWindowProcA(hwnd, message, wParam, lParam);
}
@@ -106,7 +111,8 @@ MFDSplitView::MFDSplitView(
int y,
ButtonStyle button_style,
int anchorA,
int anchorB
int anchorB,
void *parent
)
{
Check_Pointer(this);
@@ -133,6 +139,8 @@ MFDSplitView::MFDSplitView(
int client_height = display_height;
LayoutButtons(button_style, anchorA, anchorB,
display_width, display_height, &client_width, &client_height);
clientWidth = client_width;
clientHeight = client_height;
HINSTANCE instance = GetModuleHandleA(NULL);
@@ -152,13 +160,28 @@ MFDSplitView::MFDSplitView(
RegisterClassA(&window_class);
}
DWORD style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
RECT bounds;
bounds.left = 0;
bounds.top = 0;
bounds.right = client_width;
bounds.bottom = client_height;
AdjustWindowRect(&bounds, style, FALSE);
DWORD style;
int window_w, window_h;
if (parent != NULL)
{
// chrome-less pane inside the cockpit window
style = WS_CHILD | WS_VISIBLE;
window_w = client_width;
window_h = client_height;
}
else
{
style = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
RECT bounds;
bounds.left = 0;
bounds.top = 0;
bounds.right = client_width;
bounds.bottom = client_height;
AdjustWindowRect(&bounds, style, FALSE);
window_w = bounds.right - bounds.left;
window_h = bounds.bottom - bounds.top;
}
window = CreateWindowExA(
0,
@@ -166,9 +189,9 @@ MFDSplitView::MFDSplitView(
title,
style,
x, y,
bounds.right - bounds.left,
bounds.bottom - bounds.top,
NULL, NULL, instance, NULL
window_w,
window_h,
(HWND) parent, NULL, instance, NULL
);
if (window != NULL)