End the scene drawing by drawing the backbuffer to the screen
| 472 | |
| 473 | // End the scene drawing by drawing the backbuffer to the screen |
| 474 | void 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 |
| 497 | void Graphics::setViewport(const GLint startx, const GLint starty, const GLint endx, const GLint endy) { |
no test coverage detected