Danbias/Code/OysterGraphics/Render/Preparations/BasicPreparations.cpp

74 lines
1.7 KiB
C++
Raw Normal View History

#include "Preparations.h"
namespace Oyster
{
namespace Graphics
{
namespace Render
{
namespace Preparations
{
2013-11-21 09:43:53 +01:00
void Basic::BindBackBufferRTV()
{
2013-11-21 09:43:53 +01:00
BindBackBufferRTV(Core::depthStencil);
}
2013-11-21 09:43:53 +01:00
void Basic::BindBackBufferRTV(ID3D11DepthStencilView* depthStencil)
{
2013-11-21 09:43:53 +01:00
Core::deviceContext->OMSetRenderTargets(1,&Core::backBufferRTV,depthStencil);
}
void Basic::BindBackBufferUAV()
{
Core::deviceContext->CSSetUnorderedAccessViews(0,1,&Core::backBufferUAV,0);
}
void Basic::BindRTV(ID3D11RenderTargetView* RTVs[], int size, bool UseDepthStencil)
{
if(UseDepthStencil)
{
BindRTV(RTVs, size, Core::depthStencil);
}
else
{
2013-11-21 09:43:53 +01:00
BindRTV(RTVs, size, nullptr);
}
}
2013-11-21 09:43:53 +01:00
void Basic::BindRTV(ID3D11RenderTargetView* RTVs[], int size,ID3D11DepthStencilView* depthStencil)
{
2013-11-21 09:43:53 +01:00
Core::deviceContext->OMSetRenderTargets(size,RTVs,depthStencil);
}
void Basic::BindUAV(ID3D11UnorderedAccessView* UAVs[], int size)
{
Core::deviceContext->CSSetUnorderedAccessViews(0,size,UAVs,0);
}
2013-11-21 09:43:53 +01:00
void Basic::ClearBackBuffer(Oyster::Math::Float4 Color)
{
2013-11-21 09:43:53 +01:00
ClearRTV(&Core::backBufferRTV, 1,Color);
ClearDepthStencil(Core::depthStencil);
}
void Basic::ClearRTV(ID3D11RenderTargetView* RTVs[], int size,Oyster::Math::Float4 Color)
{
for(int i = 0; i < size; ++i)
{
Core::deviceContext->ClearRenderTargetView(RTVs[i],Color);
}
}
2013-11-21 09:43:53 +01:00
void Basic::ClearDepthStencil(ID3D11DepthStencilView* depthStencil)
{
2013-11-21 09:43:53 +01:00
Core::deviceContext->ClearDepthStencilView(depthStencil,1,1,0);
}
void Basic::SetViewPort()
{
Core::deviceContext->RSSetViewports(1,Core::viewPort);
}
}
}
}
}