| 560 | } |
| 561 | |
| 562 | void EngineGL33::BackToFront() |
| 563 | { |
| 564 | // SSAA: the game frame (3D + HUD) is complete on the scaled target — |
| 565 | // resolve + downsample it into the default framebuffer first, so the |
| 566 | // overlay renders at native size and the screenshot reads the final |
| 567 | // pixels the user sees. |
| 568 | ResolveSSAAToDefault(); |
| 569 | |
| 570 | // ImGui composites on top of game + HUD. Render BEFORE the screenshot |
| 571 | // capture so trident captures include the overlay (same pixels the user |
| 572 | // sees after SwapWindow). Both calls are safe no-ops when disabled. |
| 573 | DebugOverlay::NewFrame(); |
| 574 | DebugOverlay::Render(); |
| 575 | // ImGui's GL backend binds its own VAO/textures — drop the bind cache |
| 576 | // so the next cached bind re-applies real state (B-007). |
| 577 | GL33Bind::Invalidate(); |
| 578 | InvalidatePipelineCache(); |
| 579 | |
| 580 | // Trident's `triScreenshot` enqueues a path; we capture here so the |
| 581 | // readback samples the same back buffer that's about to swap. |
| 582 | // Readback after SwapWindow on a double-buffered context is |
| 583 | // undefined, so the capture has to happen pre-swap. |
| 584 | CaptureScreenshotIfPending(); |
| 585 | |
| 586 | if (_glContext && _sdlWindow) |
| 587 | SDL_GL_SwapWindow(_sdlWindow); |
| 588 | |
| 589 | // Frame boundary: apply a pending render-scale change and (re)bind the |
| 590 | // frame render target for the next frame's draws. |
| 591 | ApplyPendingRenderScale(); |
| 592 | BindFrameRenderTarget(); |
| 593 | } |
| 594 | |
| 595 | int EngineGL33::SampleBackBufferNonBlack() |
| 596 | { |
nothing calls this directly
no test coverage detected