MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / renderFrame

Function renderFrame

Engine/source/T3D/gameFunctions.cpp:440–624  ·  view source on GitHub ↗

================================================================================================ Render a full frame from a given transform and frustum, and render out to a target ================================================================================================

Source from the content-addressed store, hash-verified

438//Render a full frame from a given transform and frustum, and render out to a target
439//================================================================================================
440void renderFrame(GFXTextureTargetRef* target, MatrixF transform, Frustum frustum, U32 typeMask, ColorI canvasClearColor)
441{
442 if (!GFX->allowRender() || GFX->canCurrentlyRender())
443 return;
444
445 PROFILE_START(GameFunctions_RenderFrame);
446
447 GFX->setActiveRenderTarget(*target);
448 if (!GFX->getActiveRenderTarget())
449 return;
450
451 GFXTarget* renderTarget = GFX->getActiveRenderTarget();
452 if (renderTarget == NULL)
453 return;
454
455 // Make sure the root control is the size of the canvas.
456 Point2I size = renderTarget->getSize();
457 if (size.x == 0 || size.y == 0)
458 return;
459
460 //Now, getting to the meat of it!
461#ifdef TORQUE_GFX_STATE_DEBUG
462 GFX->getDebugStateManager()->startFrame();
463#endif
464 RectI targetRect(0, 0, size.x, size.y);
465
466 // Signal the interested parties.
467 GuiCanvas::getGuiCanvasFrameSignal().trigger(true);
468
469 GFXTransformSaver saver;
470
471 // Gross hack to make sure we don't end up with advanced lighting and msaa
472 // at the same time, which causes artifacts. At the same time we don't
473 // want to just throw the settings the user has chosen if the light manager
474 // changes at a later time.
475 /*GFXVideoMode mode = mPlatformWindow->getVideoMode();
476 if (dStricmp(LIGHTMGR->getId(), "ADVLM") == 0 && mode.antialiasLevel > 0)
477 {
478 const char *pref = Con::getVariable("$pref::Video::mode");
479 mode.parseFromString(pref);
480 mode.antialiasLevel = 0;
481 mPlatformWindow->setVideoMode(mode);
482
483 Con::printf("AntiAliasing has been disabled; it is not compatible with AdvancedLighting.");
484 }
485 else if (dStricmp(LIGHTMGR->getId(), "BLM") == 0)
486 {
487 const char *pref = Con::getVariable("$pref::Video::mode");
488
489 U32 prefAA = dAtoi(StringUnit::getUnit(pref, 5, " "));
490 if (prefAA != mode.antialiasLevel)
491 {
492 mode.parseFromString(pref);
493 mPlatformWindow->setVideoMode(mode);
494
495 Con::printf("AntiAliasing has been enabled while running BasicLighting.");
496 }
497 }*/

Callers 3

resetOverlayMethod · 0.85
showOverlayMethod · 0.85
handlePaintEventMethod · 0.85

Calls 15

GameProcessCameraQueryFunction · 0.85
allowRenderMethod · 0.80
canCurrentlyRenderMethod · 0.80
setActiveRenderTargetMethod · 0.80
getActiveRenderTargetMethod · 0.80
beginSceneMethod · 0.80
updateStatesMethod · 0.80
setViewMatrixMethod · 0.80
setProjectionMatrixMethod · 0.80
createStateBlockMethod · 0.80
setFrustumMethod · 0.80
getProjectionMatrixMethod · 0.80

Tested by

no test coverage detected