MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / SwapToScreen

Method SwapToScreen

Source/Graphics/graphics.cpp:474–494  ·  view source on GitHub ↗

End the scene drawing by drawing the backbuffer to the screen

Source from the content-addressed store, hash-verified

472
473// End the scene drawing by drawing the backbuffer to the screen
474void Graphics::SwapToScreen() {
475 LOG_ASSERT(viewport_dims_stack.empty());
476 PROFILER_GPU_ZONE(g_profiler_ctx, "Graphics::SwapToScreen()"); // glFlush(); Unnecessary on Mac OS X, as CGLFlushDrawable auto-flushes the command buffer
477 {
478 PROFILER_ZONE_STALL(g_profiler_ctx, "SDL_GL_SwapWindow");
479 SDL_GL_SwapWindow(sdl_window_);
480 }
481 GL_SWAP();
482
483 if (queued_screenshot == 2) {
484 TakeScreenshot();
485 queued_screenshot = 0;
486 SetMediaMode(pre_screenshot_media_mode_state);
487 }
488
489 if (queued_screenshot) {
490 ++queued_screenshot;
491 }
492
493 settings_changed = false;
494}
495
496// Set area of screen to draw to
497void Graphics::setViewport(const GLint startx, const GLint starty, const GLint endx, const GLint endy) {

Callers 3

DrawLoadScreenMethod · 0.80
GameMainFunction · 0.80
DebugLoopMethod · 0.80

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected