MCPcopy Create free account
hub / github.com/beefytech/Beef / PhysSetAsTarget

Method PhysSetAsTarget

BeefySysLib/platform/win/DXRenderDevice.cpp:634–663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632}
633
634void DXTexture::PhysSetAsTarget()
635{
636 {
637 D3D11_VIEWPORT viewPort;
638 viewPort.Width = (float)mWidth;
639 viewPort.Height = (float)mHeight;
640 viewPort.MinDepth = 0.0f;
641 viewPort.MaxDepth = 1.0f;
642 viewPort.TopLeftX = 0;
643 viewPort.TopLeftY = 0;
644
645 mRenderDevice->mD3DDeviceContext->OMSetRenderTargets(1, &mD3DRenderTargetView, mD3DDepthStencilView);
646 //mRenderDevice->mD3DDeviceContext->OMSetRenderTargets(1, &mD3DRenderTargetView, ((rand() % 2) != 0) ? NULL : mD3DDepthStencilView);
647 //mRenderDevice->mD3DDeviceContext->OMSetRenderTargets(1, &mD3DRenderTargetView, NULL);
648 mRenderDevice->mD3DDeviceContext->RSSetViewports(1, &viewPort);
649 }
650
651 if (mWantsClear)
652 {
653 float bgColor[4] = {1, (rand() % 256) / 256.0f, 0.5, 1};
654 mRenderDevice->mD3DDeviceContext->ClearRenderTargetView(mD3DRenderTargetView, bgColor);
655 if (mD3DDepthStencilView != NULL)
656 mRenderDevice->mD3DDeviceContext->ClearDepthStencilView(mD3DDepthStencilView, D3D11_CLEAR_DEPTH/*|D3D11_CLEAR_STENCIL*/, 1.0f, 0);
657
658 //mRenderDevice->mD3DDevice->ClearRenderTargetView(mD3DRenderTargetView, D3DXVECTOR4(1, 0.5, 0.5, 1));
659 mHasBeenDrawnTo = true;
660 if (mResetClear)
661 mWantsClear = false;
662 }
663}
664
665void DXTexture::Blt(ImageData* imageData, int x, int y)
666{

Callers 2

PhysSetRenderWindowMethod · 0.45
PhysSetRenderTargetMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected