MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / BackToFront

Method BackToFront

engine/PoseidonGL33/EngineGL33_VertexBuffer.cpp:562–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560}
561
562void 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
595int EngineGL33::SampleBackBufferNonBlack()
596{

Callers

nothing calls this directly

Calls 3

NewFrameFunction · 0.85
RenderFunction · 0.85
InvalidateFunction · 0.85

Tested by

no test coverage detected