Files

62 lines
1.8 KiB
C++
Raw Permalink Normal View History

2025-05-13 02:46:21 +03:00
#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__