M2(OpenGL): GL mock backend (no loader) + mock-backed capture coverage

Add render_gl.cpp (selectable as `gl`): renders the animated pattern with
scissored clears (glClear + glScissor -- GL 1.1, exported straight from
opengl32) and presents with SwapBuffers. No glad/submodule needed: a legacy
wglCreateContext + <GL/gl.h> suffices, so the planned loader dependency was
dropped. GL is bottom-left origin and the capture flips top-down, so the
frame-counter block is drawn at the GL top to land top-left in the captured
image. Window class gains CS_OWNDC for a stable GL DC; best-effort vsync via a
runtime wglSwapIntervalEXT lookup.

The GL SwapBuffers/wglSwapBuffers hook now bumps the shared present counter
(it's the GL present), so present_calls works for GL games too. mock_game_test
decodes GL frames through the existing glReadPixels capture path; 15/15 ctest.
Roadmap: OpenGL milestone done and removed (Vulkan renumbered to M2);
architecture/lessons/test docs updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 12:03:43 +02:00
parent 67c1940d52
commit e996188aec
8 changed files with 154 additions and 17 deletions

View File

@@ -6,12 +6,13 @@ add_executable(coop_mock_game
render_dx11.cpp
render_dx12.cpp
render_dx10.cpp
render_dx09.cpp)
render_dx09.cpp
render_gl.cpp)
# Reuses the shared ToneSource (also used by coop_tone + the audio hook self-test).
target_include_directories(coop_mock_game PRIVATE ${CMAKE_SOURCE_DIR}/tools/audio_tone)
target_link_libraries(coop_mock_game PRIVATE d3d11 d3d12 d3d10 d3d9 dxgi ole32)
target_link_libraries(coop_mock_game PRIVATE d3d11 d3d12 d3d10 d3d9 dxgi ole32 opengl32 gdi32)
set_target_properties(coop_mock_game PROPERTIES OUTPUT_NAME "coop_mock_game")
# Test fixture -> stage next to the tests (alongside coop_tone), not in the deployable root.