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

Method onRender

Engine/source/gui/utility/guiRenderTargetVizCtrl.cpp:90–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88//-----------------------------------------------------------------------------
89
90void GuiRenderTargetVizCtrl::onRender(Point2I offset,
91 const RectI& updateRect)
92{
93 GFXDrawUtil* drawer = GFX->getDrawUtil();
94
95 RectI boundsRect(offset, getExtent());
96
97 //Draw backdrop
98 GFX->getDrawUtil()->drawRectFill(boundsRect, ColorI::BLACK);
99
100 if (mCameraObject != nullptr)
101 {
102 Camera* camObject = dynamic_cast<Camera*>(mCameraObject);
103
104 camObject = dynamic_cast<Camera*>(camObject->getClientObject());
105
106 if (camObject)
107 {
108 GFXTexHandle targ = camObject->getCameraRenderTarget();
109
110 if (targ)
111 {
112 Point2I size = Point2I(targ->getWidth(), targ->getHeight());
113 drawer->drawBitmapStretchSR(targ, boundsRect, RectI(Point2I::Zero, size));
114 }
115 return;
116 }
117 }
118 else if (mTargetName == StringTable->EmptyString())
119 return;
120
121 NamedTexTarget* namedTarget = NamedTexTarget::find(mTargetName);
122 if (namedTarget)
123 {
124 GFXTextureObject* theTex = namedTarget->getTexture(0);
125 RectI viewport = namedTarget->getViewport();
126
127 drawer->drawBitmapStretchSR(theTex, boundsRect, viewport);
128 }
129}

Callers

nothing calls this directly

Calls 11

getDrawUtilMethod · 0.80
drawRectFillMethod · 0.80
getClientObjectMethod · 0.80
drawBitmapStretchSRMethod · 0.80
EmptyStringMethod · 0.80
Point2IClass · 0.50
RectIClass · 0.50
findFunction · 0.50
getWidthMethod · 0.45
getHeightMethod · 0.45
getTextureMethod · 0.45

Tested by

no test coverage detected