Status: 🚧 In Progress (70% complete) Created: 2026-02-07 Last Updated: 2026-02-08
✅ DXVK loader integration complete
✅ SDL3 device layer implemented (~450 lines real code)
✅ OpenAL audio manager implemented (~550 lines real code)
✅ CMake presets and flags configured
✅ Source files added to build system
Port the graphics and windowing subsystem to Linux using DXVK for DirectX→Vulkan translation and SDL3 for windowing/input, while preserving Windows builds and minimizing core changes.
- Prepare build environment and presets (CMake + Docker)
- Integrate DXVK loader into
dx8wrapper(runtime loader switch) - Add SDL3-based entry point and device implementations
- Add platform selection macros and compile guards
- Build + smoke tests in Docker (no automated test here — manual later)
- Iterate fixes and prepare merge to integration branch
- Create branch
phase1/dxvk-sdl3from main - Update
docs/WORKDIR/phases/PHASE01_IMPLEMENTATION_PLAN.mdwith progress - Ensure dev diary updated before commits
- Add
linux64-deploytoCMakePresets.json(if missing) - Add
SAGE_USE_SDL3=ON,SAGE_USE_OPENAL=ONin linux preset cacheVariables - Add
Dockerfile.builder(seephase0-build-system.md) — do not run - Add VS Code tasks to
.vscode/tasks.jsonfor configure/build via Docker (no execution)
- Modify
GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/dx8wrapper.cpp:- Replace
LoadLibrary("D3D8.DLL")with runtime switch:#ifdef _WIN32 D3D8Lib = LoadLibrary("D3D8.DLL"); #else D3D8Lib = LoadLibrary("libdxvk_d3d8.so"); #endif
- Replace
- Add
#ifdefguards where appropriate; keep old code path for Windows unchanged - Add comment linking to fighter19 reference and rationale
- Add
GeneralsMD/Code/Main/SDL3Main.cpp(based on fighter19)- Set
setenv("DXVK_WSI_DRIVER","SDL3",1); - Call
SDL_Vulkan_LoadLibrary(nullptr)andSDL_CreateWindowwithSDL_WINDOW_VULKAN
- Set
- Add
GameEngineDevice/files (no subdirectory created):SDL3GameEngine.{h,cpp}(subclassGameEngine) — ~450 lines real implementation⚠️ SDL3Mouse.{h,cpp},SDL3Keyboard.{h,cpp}— Deferred, events wired directly in SDL3GameEngine⚠️ SDL3OSDisplay.{h,cpp}/SDL3IMEManager— Deferred to Phase 2+
- Wire factory in
SDL3GameEngine::createAudioManager()to choose OpenAL/Miles via CMake flags - Add
OpenALAudioManager.{h,cpp}— ~550 lines real implementation with device/context lifecycle
- Conditional source lists in
GameEngineDevice/CMakeLists.txt:- If
SAGE_USE_SDL3add SDL3 device sources — Session 6: Added SDL3GameEngine.{h,cpp} - If
SAGE_USE_OPENALadd OpenAL audio sources — Session 6: Added OpenALAudioManager.{h,cpp} - Ensure dxvk FetchContent in top-level CMake when
SAGE_USE_DX8is OFF —⚠️ TBD
- If
- Add install rules to package DXVK native libraries with Linux distribution target —
⚠️ Phase 1.5 - Added SDL3Main.cpp to
Main/CMakeLists.txt— Session 6
- Implement VFS helper to perform case-insensitive lookups on Linux when requested
- Add unit checks when loading assets (log missing due to case)
- Configure + build via Docker (developer runs later)
- Launch binary on Linux VM or host (developer) and verify:
- Main menu renders
- Load skirmish map
- 10-minute stability test (no crash)
- Verify Windows VC6 and Win32 builds still compile
- Capture DXVK logs and add helpful debug flags
- Profile performance for common scenes
- Iterate on render-state differences or shader fallbacks
linux64-deploypreset exists and compiles (developer to run)dx8wrapperloadslibdxvk_d3d8.soon non-Windows builds- SDL3 windowing is used on Linux builds and maps input correctly
- Game renders main menu and can load a skirmish map (silent audio OK)
- Windows builds unmodified and compile
- DXVK incompatibilities: use fighter19 DXVK artifacts and test on multiple drivers
- Asset case issues: add case-insensitive lookup
- Audio still stubbed: Phase 2 will integrate OpenAL
- Patch set for
dx8wrapper(runtime loader switch) - New
SDL3Main.cpp+SDL3Device/implementation - CMake presets and Dockerfile (configuration only)
- Documentation and dev-diary updates
- Week 1: Presets + minimal dx8wrapper change + Dockerfile config
- Week 2: SDL3 device implementation + CMake wiring
- Week 3: Integration testing, fixes, documentation
- Week 4: Merge to integration branch, prepare Phase 2
- Keep PRs small and focused: one PR for loader + build changes, one PR for SDL3 device, one PR for cleanup.
- Preserve Windows code paths at all times.