================================================================================================ Render a full frame from a given transform and frustum, and render out to a target ================================================================================================
| 438 | //Render a full frame from a given transform and frustum, and render out to a target |
| 439 | //================================================================================================ |
| 440 | void 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 | }*/ |
no test coverage detected