| 88 | //----------------------------------------------------------------------------- |
| 89 | |
| 90 | void 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 | } |
nothing calls this directly
no test coverage detected