*
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
#ifndef IRasterizerState11_h__
|
||||
#define IRasterizerState11_h__
|
||||
|
||||
#include <d3d11.h>
|
||||
#include <dxgi.h>
|
||||
#include <d3dx11.h>
|
||||
#include "render/IRasterizerState.h"
|
||||
#include "Globals.h"
|
||||
|
||||
namespace LifeGraphics
|
||||
{
|
||||
class IRasterizerState11 : public IRasterizerState
|
||||
{
|
||||
public:
|
||||
ID3D11Device* device;
|
||||
ID3D11RasterizerState* state;
|
||||
|
||||
IRasterizerState11(FILL_MODE mode, ID3D11Device* _device)
|
||||
{
|
||||
device = _device;
|
||||
|
||||
D3D11_RASTERIZER_DESC rsDesc;
|
||||
rsDesc.AntialiasedLineEnable = false;
|
||||
rsDesc.CullMode = D3D11_CULL_BACK;
|
||||
rsDesc.DepthBias = 0;
|
||||
rsDesc.DepthBiasClamp = 0.0f;
|
||||
rsDesc.SlopeScaledDepthBias = 0.0f;
|
||||
rsDesc.DepthClipEnable = TRUE;
|
||||
rsDesc.FillMode = static_cast<D3D11_FILL_MODE>(mode);
|
||||
rsDesc.FrontCounterClockwise = FALSE;
|
||||
rsDesc.MultisampleEnable = FALSE;
|
||||
rsDesc.ScissorEnable = TRUE;
|
||||
|
||||
device->CreateRasterizerState(&rsDesc, &state);
|
||||
}
|
||||
IRasterizerState11(FILL_MODE mode, ID3D11Device* _device, CULL_MODE cmode)
|
||||
{
|
||||
device = _device;
|
||||
|
||||
D3D11_RASTERIZER_DESC rsDesc;
|
||||
rsDesc.AntialiasedLineEnable = false;
|
||||
rsDesc.CullMode = static_cast<D3D11_CULL_MODE>(cmode);
|
||||
rsDesc.DepthBias = 0;
|
||||
rsDesc.DepthBiasClamp = 0.0f;
|
||||
rsDesc.SlopeScaledDepthBias = 0.0f;
|
||||
rsDesc.DepthClipEnable = TRUE;
|
||||
rsDesc.FillMode = static_cast<D3D11_FILL_MODE>(mode);
|
||||
rsDesc.FrontCounterClockwise = FALSE;
|
||||
rsDesc.MultisampleEnable = FALSE;
|
||||
rsDesc.ScissorEnable = TRUE;
|
||||
|
||||
device->CreateRasterizerState(&rsDesc, &state);
|
||||
}
|
||||
~IRasterizerState11()
|
||||
{
|
||||
SAFE_RELEASE(state);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif // IRasterizerState11_h__
|
||||
Reference in New Issue
Block a user