==================== BeginFrame ==================== */
| 575 | ==================== |
| 576 | */ |
| 577 | void idRenderSystemLocal::BeginFrame( int windowWidth, int windowHeight ) { |
| 578 | setBufferCommand_t *cmd; |
| 579 | |
| 580 | if ( !glConfig.isInitialized ) { |
| 581 | return; |
| 582 | } |
| 583 | |
| 584 | // DG: r_lockSurfaces only works properly if r_useScissor is disabled |
| 585 | if ( r_lockSurfaces.IsModified() ) { |
| 586 | static bool origUseScissor = true; |
| 587 | r_lockSurfaces.ClearModified(); |
| 588 | if ( r_lockSurfaces.GetBool() ) { |
| 589 | origUseScissor = r_useScissor.GetBool(); |
| 590 | r_useScissor.SetBool( false ); |
| 591 | } else { |
| 592 | r_useScissor.SetBool( origUseScissor ); |
| 593 | } |
| 594 | } // DG end |
| 595 | |
| 596 | // determine which back end we will use |
| 597 | SetBackEndRenderer(); |
| 598 | |
| 599 | guiModel->Clear(); |
| 600 | |
| 601 | // for the larger-than-window tiled rendering screenshots |
| 602 | if ( tiledViewport[0] ) { |
| 603 | windowWidth = tiledViewport[0]; |
| 604 | windowHeight = tiledViewport[1]; |
| 605 | } |
| 606 | |
| 607 | // DG: save the original size, so editors don't mess up the game viewport |
| 608 | // with their tiny (texture-preview etc) viewports. |
| 609 | origWidth = glConfig.vidWidth; |
| 610 | origHeight = glConfig.vidHeight; |
| 611 | |
| 612 | glConfig.vidWidth = windowWidth; |
| 613 | glConfig.vidHeight = windowHeight; |
| 614 | |
| 615 | renderCrops[0].x = 0; |
| 616 | renderCrops[0].y = 0; |
| 617 | renderCrops[0].width = windowWidth; |
| 618 | renderCrops[0].height = windowHeight; |
| 619 | currentRenderCrop = 0; |
| 620 | |
| 621 | // screenFraction is just for quickly testing fill rate limitations |
| 622 | if ( r_screenFraction.GetInteger() != 100 ) { |
| 623 | int w = SCREEN_WIDTH * r_screenFraction.GetInteger() / 100.0f; |
| 624 | int h = SCREEN_HEIGHT * r_screenFraction.GetInteger() / 100.0f; |
| 625 | CropRenderSize( w, h ); |
| 626 | } |
| 627 | |
| 628 | |
| 629 | // this is the ONLY place this is modified |
| 630 | frameCount++; |
| 631 | |
| 632 | // just in case we did a common->Error while this |
| 633 | // was set |
| 634 | guiRecursionLevel = 0; |
no test coverage detected