| 767 | //----------------------------------------------------------------------------- |
| 768 | |
| 769 | void GuiTSCtrl::renderDisplayPreview(const RectI &updateRect, GFXTexHandle &previewTexture) |
| 770 | { |
| 771 | GFX->setWorldMatrix(MatrixF(1)); |
| 772 | GFX->setViewMatrix(MatrixF::Identity); |
| 773 | GFX->setClipRect(updateRect); |
| 774 | |
| 775 | GFX->getDrawUtil()->drawRectFill(RectI(Point2I(0, 0), Point2I(1024, 768)), ColorI::BLACK); |
| 776 | GFX->getDrawUtil()->drawRect(RectI(Point2I(0, 0), Point2I(1024, 768)), ColorI::RED); |
| 777 | |
| 778 | if (!mStereoPreviewVB.getPointer()) |
| 779 | { |
| 780 | mStereoPreviewVB.set(GFX, 4, GFXBufferTypeStatic); |
| 781 | GFXVertexPCT *verts = mStereoPreviewVB.lock(0, 4); |
| 782 | |
| 783 | F32 texLeft = 0.0f; |
| 784 | F32 texRight = 1.0f; |
| 785 | F32 texTop = 0.0f; |
| 786 | F32 texBottom = 1.0f; |
| 787 | |
| 788 | F32 rectWidth = updateRect.extent.x; |
| 789 | F32 rectHeight = updateRect.extent.y; |
| 790 | |
| 791 | F32 screenLeft = 0; |
| 792 | F32 screenRight = rectWidth; |
| 793 | F32 screenTop = 0; |
| 794 | F32 screenBottom = rectHeight; |
| 795 | |
| 796 | const F32 fillConv = 0.0f; |
| 797 | verts[0].point.set(screenLeft - fillConv, screenTop - fillConv, 0.f); |
| 798 | verts[1].point.set(screenRight - fillConv, screenTop - fillConv, 0.f); |
| 799 | verts[2].point.set(screenLeft - fillConv, screenBottom - fillConv, 0.f); |
| 800 | verts[3].point.set(screenRight - fillConv, screenBottom - fillConv, 0.f); |
| 801 | |
| 802 | verts[0].color = verts[1].color = verts[2].color = verts[3].color = ColorI(255, 255, 255, 255); |
| 803 | |
| 804 | verts[0].texCoord.set(texLeft, texTop); |
| 805 | verts[1].texCoord.set(texRight, texTop); |
| 806 | verts[2].texCoord.set(texLeft, texBottom); |
| 807 | verts[3].texCoord.set(texRight, texBottom); |
| 808 | |
| 809 | mStereoPreviewVB.unlock(); |
| 810 | } |
| 811 | |
| 812 | if (!mStereoPreviewSB.getPointer()) |
| 813 | { |
| 814 | // DrawBitmapStretchSR |
| 815 | GFXStateBlockDesc bitmapStretchSR; |
| 816 | bitmapStretchSR.setCullMode(GFXCullNone); |
| 817 | bitmapStretchSR.setZReadWrite(false, false); |
| 818 | bitmapStretchSR.setBlend(false, GFXBlendSrcAlpha, GFXBlendInvSrcAlpha); |
| 819 | bitmapStretchSR.samplersDefined = true; |
| 820 | |
| 821 | bitmapStretchSR.samplers[0] = GFXSamplerStateDesc::getClampLinear(); |
| 822 | bitmapStretchSR.samplers[0].minFilter = GFXTextureFilterPoint; |
| 823 | bitmapStretchSR.samplers[0].mipFilter = GFXTextureFilterPoint; |
| 824 | bitmapStretchSR.samplers[0].magFilter = GFXTextureFilterPoint; |
| 825 | |
| 826 | mStereoPreviewSB = GFX->createStateBlock(bitmapStretchSR); |
nothing calls this directly
no test coverage detected