| 508 | } |
| 509 | |
| 510 | void SystemWindow::BeginFrame() |
| 511 | { |
| 512 | UpdateBrightness(); |
| 513 | |
| 514 | const bool need_clear= settings_.GetOrSetBool( "r_clear", false ); |
| 515 | |
| 516 | if( IsOpenGLRenderer() ) |
| 517 | { |
| 518 | if( need_clear ) |
| 519 | glClear( GL_COLOR_BUFFER_BIT ); |
| 520 | } |
| 521 | else if( use_gl_context_for_software_renderer_ ) |
| 522 | { |
| 523 | if( need_clear ) |
| 524 | std::memset( |
| 525 | scaled_viewport_color_buffer_.data(), |
| 526 | 0, |
| 527 | scaled_viewport_color_buffer_.size() * sizeof(uint32_t) ); |
| 528 | } |
| 529 | else |
| 530 | { |
| 531 | if( pixel_size_ == 1u && SDL_MUSTLOCK( surface_ ) ) |
| 532 | SDL_LockSurface( surface_ ); |
| 533 | |
| 534 | if( need_clear ) |
| 535 | { |
| 536 | if( pixel_size_ == 1u ) |
| 537 | std::memset( |
| 538 | surface_->pixels, |
| 539 | 0, |
| 540 | surface_->pitch * surface_->h ); |
| 541 | else |
| 542 | std::memset( |
| 543 | scaled_viewport_color_buffer_.data(), |
| 544 | 0, |
| 545 | scaled_viewport_color_buffer_.size() * sizeof(uint32_t) ); |
| 546 | } |
| 547 | } |
| 548 | } |
| 549 | |
| 550 | void SystemWindow::EndFrame() |
| 551 | { |
no test coverage detected