10301ee5ddd7fa501c53e9caba0ce1bf464a9198
1
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
22495d7245 |
Docs: research notes on making -window work for all display modes
Research only. Nothing implemented, nothing scheduled. Captured now so the
investigation does not have to be repeated when we come back to it.
New file: WINDOWED-MODE.md (repo root), indexed from README.md and the
CLAUDE.md next-steps list.
Goal being assessed
-------------------
Make -window work for every pod configuration, so a full pod (main + radar
+ MFDs, or a cameraship pair) can be tested on a single monitor as a set
of moveable windows. Target order: console (already works), cameraship,
-tmfds 1, -tmfds 4. -tmfds 3 deliberately out of scope.
Headline finding
----------------
-window does NOT fail for the MFD and cameraship modes - it silently
DISABLES them, and the reason is a single line:
MW4Application.cpp:1373
use_shgui = Environment.fullScreen ? 1 : 0;
use_shgui is the master switch for the entire secondary-panel subsystem
and is derived from fullscreen, so with -window it is 0 and
DXRasterizer.cpp:1131 never calls HSH_EnterFullScreen2(). No panel is ever
created. Console mode only appears to work windowed because it has no
panels to lose.
What the document covers
------------------------
* Why it behaves the way it does today, with the exact gating code.
* What already exists in our favour: the main display is a working
windowed reference implementation (primary + clipper + offscreen
backbuffer, presented with Blt); the clipper wrappers are already in
use; and none of the panel DRAWING code would change, because panels
render to an offscreen target and composite - they are indifferent to
whether the present is a Flip or a Blt.
* The six things that must change, with quoted code: decouple use_shgui;
windowed variants of CHSH_Device::InitFirst (DDSCL_NORMAL, no
SetDisplayMode, per-panel HWND) and InitSecond (plain primary + clipper
+ offscreen backbuffer, D3D device on the offscreen); one window per
panel; 8 Flip->Blt sites in WinMain.cpp; and explicit frame pacing.
* Frame pacing is called out as the item that will actually bite: sh_step
advances once per frame and drives MFD channel cycling, so an uncapped
windowed rig would not faithfully represent pod behaviour. Same root
cause as the known mechlab fast-spin bug.
* Reference tables: every panel class with its InitFirst location, device
slot and resolution; the SwapRightState member-swap mechanism that any
windowed work must keep intact; and the full lifecycle/gating map.
* Suggested phasing, with radar-only as the decisive Phase 1 experiment.
The risk that decides it
------------------------
Windowed D3D7 device creation is per-GPU, and this would need four
windowed devices in one process. Precedent runs both ways: the mission
editor hit DDERR_INVALIDOBJECT creating a windowed D3D device on Win11 and
needed DDrawCompat (STEP 8), while the game's own windowed main display
succeeds on the W4100. Nothing has proven four. If it fails, the fallback
means rewriting the panel RENDER path, not just its present - a
substantially bigger job.
Why this may be worth more than a test convenience
--------------------------------------------------
Windowed mode removes exclusive-mode contention entirely, which is the
whole reason dgVoodoo2 is currently mandatory for every multi-display
configuration on Windows 10/11 (STEP 10). If windowed panels work
natively, that is a route to dropping the dgVoodoo2 prerequisite WITHOUT
breaking the XP pods, since it needs no external DLL on either OS. Same
groundwork as the borderless-windowed migration already parked in STEP 10.
Note on citations
-----------------
All 22 file:line references were derived directly and verified to resolve
to the expected symbol. An exploratory pass had produced line numbers that
were substantially wrong (CHSH_Device::InitFirst reported at 717, actually
627; IsMultimonitorAvaliable at 2178, actually 2961), and a claim that the
radar renders at 480x640 rotated - the code passes 640,480 like the
others. Worth knowing before trusting generated citations in a document
intended to outlive the session.
Co-authored-by: Claude Opus 5 (Anthropic) <noreply@anthropic.com>
Co-authored-by: GitHub Copilot <copilot@github.com>
|