![]() |
MAGE
v0.171.0
Matthias Advanced Game Engine
|
#include <state_manager.hpp>
Public Member Functions | |
StateManager (ID3D11Device &device) | |
StateManager (const StateManager &manager)=delete | |
StateManager (StateManager &&manager) noexcept | |
~StateManager () | |
StateManager & | operator= (const StateManager &manager)=delete |
StateManager & | operator= (StateManager &&manager) noexcept |
void | BindPersistentState (ID3D11DeviceContext &device_context) const noexcept |
void | Bind (ID3D11DeviceContext &device_context, BlendStateID id) const noexcept |
void | Bind (ID3D11DeviceContext &device_context, DepthStencilStateID id) const noexcept |
void | Bind (ID3D11DeviceContext &device_context, RasterizerStateID id) const noexcept |
template<typename PipelineStageT > | |
void | BindPointWrapSamplerStateID (ID3D11DeviceContext &device_context, U32 slot, SamplerStateID id) const noexcept |
Private Member Functions | |
void | SetupRenderingStates () |
void | SetupBlendStates () |
void | SetupDepthStencilStates () |
void | SetupRasterizerStates () |
void | SetupSamplerStates () |
ID3D11BlendState * | Get (BlendStateID id) const noexcept |
NotNull< ID3D11BlendState **> | ReleaseAndGetAddressOf (BlendStateID id) noexcept |
ID3D11DepthStencilState * | Get (DepthStencilStateID id) const noexcept |
NotNull< ID3D11DepthStencilState **> | ReleaseAndGetAddressOf (DepthStencilStateID id) noexcept |
ID3D11RasterizerState * | Get (RasterizerStateID id) const noexcept |
NotNull< ID3D11RasterizerState **> | ReleaseAndGetAddressOf (RasterizerStateID id) noexcept |
ID3D11SamplerState * | Get (SamplerStateID id) const noexcept |
NotNull< ID3D11SamplerState **> | ReleaseAndGetAddressOf (SamplerStateID id) noexcept |
Private Attributes | |
std::reference_wrapper< ID3D11Device > | m_device |
ComPtr< ID3D11BlendState > | m_blend_states [static_cast< std::size_t >(BlendStateID::Count)] |
ComPtr< ID3D11DepthStencilState > | m_depth_stencil_states [static_cast< std::size_t >(DepthStencilStateID::Count)] |
ComPtr< ID3D11RasterizerState > | m_rasterizer_states [static_cast< std::size_t >(RasterizerStateID::Count)] |
ComPtr< ID3D11SamplerState > | m_sampler_states [static_cast< std::size_t >(SamplerStateID::Count)] |
A class of state managers.
|
explicit |
Constructs a state manager.
[in,out] | device | A reference to the device. |
Exception | Failed to setup the rendering states of this state manager. |
|
delete |
Constructs a state manager from the given state manager.
[in] | manager | A reference to the state manager to copy. |
|
defaultnoexcept |
Constructs a state manager by moving the given state manager.
[in] | manager | A reference to the state manager to move. |
|
default |
Destructs this state manager.
|
noexcept |
Binds the given blend state of this state manager.
[in,out] | device_context | A reference to the device context. |
[in] | id | The blend state identifier. |
|
noexcept |
Binds the given depth-stencil state of this state manager.
[in,out] | device_context | A reference to the device context. |
[in] | id | The depth-stencil state identifier. |
|
noexcept |
Binds the given rasterizer state of this state manager.
[in,out] | device_context | A reference to the device context. |
[in] | id | The rasterizer state identifier. |
|
noexcept |
Binds the persistent state of this state manager.
[in,out] | device_context | A reference to the device context. |
|
noexcept |
Binds the point sampler state with wrapping of this state manager.
SLOT_SAMPLER_VARIABLE_START
<= slot. SLOT_SAMPLER_VARIABLE_END
. PipelineStageT | The pipeline stage type. |
[in,out] | device_context | A reference to the device context. |
[in] | slot | The index into the device's zero-based array to set the sampler to (ranges from SLOT_SAMPLER_VARIABLE_START to SLOT_SAMPLER_VARIABLE_END ). |
[in] | id | The sampler state identifier. |
|
privatenoexcept |
Returns the blend state of this state manager associated to the given identifier.
[in] | id | The blend state identifier. |
|
privatenoexcept |
Returns the depth stencil state of this state manager associated to the given identifier.
[in] | id | The depth stencil identifier. |
|
privatenoexcept |
Returns the rasterizer state of this state manager associated to the given identifier.
[in] | id | The rasterizer identifier. |
|
privatenoexcept |
Returns the sampler state of this state manager associated to the given identifier.
[in] | id | The sampler state identifier. |
|
delete |
Copies the given state manager to this state manager.
[in] | manager | A reference to the state manager to copy. |
|
defaultnoexcept |
Moves the given state manager to this state manager.
[in] | manager | A reference to the state manager to move. |
|
privatenoexcept |
Returns and releases the address of the blend state of this state manager associated to the given identifier.
[in] | id | The blend state identifier. |
|
privatenoexcept |
Returns and releases the address of the depth stencil state of this state manager associated to the given identifier.
[in] | id | The depth stencil identifier. |
|
privatenoexcept |
Returns and releases the address of the rasterizer state of this state manager associated to the given identifier.
[in] | id | The rasterizer state identifier. |
|
privatenoexcept |
Returns and releases the address of the sampler state of this state manager associated to the given identifier.
[in] | id | The sampler state identifier. |
|
private |
Setup the blend states of this state manager.
Exception | Failed to setup the blend states of this state manager. |
|
private |
Setup the depth stencil states of this state manager.
Exception | Failed to setup the depth stencil states of state manager. |
|
private |
Setup the rasterizer states of this state manager.
Exception | Failed to setup the rasterizer states of this state manager. |
|
private |
Setup the rendering states (blend, depth stencil, rasterizer, sampler) of this state manager.
Exception | Failed to setup the rendering states of this state manager. |
|
private |
Setup the samplers states of this state manager.
Exception | Failed to setup the samplers states of this state manager. |
|
private |
An array containing pointers to the blend states of this state manager.
|
private |
An array containing pointers to the depth stencil states of this state manager.
|
private |
A reference to the device of this state manager.
|
private |
An array containing pointers to the rasterizer states of this state manager.
|
private |
An array containing pointers to the sampler states of this state manager.