MCPcopy Create free account
hub / github.com/dhewm/dhewm3 / BeginFrame

Method BeginFrame

neo/renderer/RenderSystem.cpp:577–656  ·  view source on GitHub ↗

==================== BeginFrame ==================== */

Source from the content-addressed store, hash-verified

575====================
576*/
577void 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;

Callers 9

drawMethod · 0.80
Cam_RenderMethod · 0.80
drawMethod · 0.80
RenderMethod · 0.80
RenderMethod · 0.80
UpdateScreenMethod · 0.80
PrintLoadingMessageMethod · 0.80
R_RenderingFPSFunction · 0.80
R_ReadTiledPixelsFunction · 0.80

Calls 8

R_GetCommandBufferFunction · 0.85
ClearModifiedMethod · 0.80
GetIntegerMethod · 0.80
IsModifiedMethod · 0.45
GetBoolMethod · 0.45
SetBoolMethod · 0.45
ClearMethod · 0.45
MillisecondsMethod · 0.45

Tested by

no test coverage detected