![]() |
MAGE
v0.171.0
Matthias Advanced Game Engine
|
#include <constant_buffer.hpp>
Public Member Functions | |
ConstantBuffer (ID3D11Device &device) | |
ConstantBuffer (const ConstantBuffer &buffer)=delete | |
ConstantBuffer (ConstantBuffer &&buffer) noexcept=default | |
~ConstantBuffer ()=default | |
ConstantBuffer & | operator= (const ConstantBuffer &buffer)=delete |
ConstantBuffer & | operator= (ConstantBuffer &&buffer) noexcept=default |
void | UpdateData (ID3D11DeviceContext &device_context, const T &data) |
ID3D11Buffer & | Get () const noexcept |
template<typename PipelineStageT > | |
void | Bind (ID3D11DeviceContext &device_context, U32 slot) const noexcept |
Private Member Functions | |
void | SetupConstantBuffer (ID3D11Device &device) |
Private Attributes | |
ComPtr< ID3D11Buffer > | m_buffer |
A class of constant buffers.
T | The data type. |
|
explicit |
Constructs a constant buffer.
[in] | device | A reference to the device. |
Exception | Failed to setup this constant buffer. |
|
delete |
Constructs a constant buffer from the given constant buffer.
[in] | buffer | A reference to the constant buffer to copy. |
|
defaultnoexcept |
Constructs a constant buffer by moving the given constant buffer.
[in] | buffer | A reference to the constant buffer to move. |
|
default |
Destructs this constant buffer.
|
noexcept |
Binds this constant buffer.
D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT
. 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 constant buffer to (ranges from 0 to D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT
|
|
noexcept |
Returns the buffer resource of this constant buffer.
|
delete |
Copies the given constant buffer to this constant buffer.
[in] | buffer | A reference to the constant buffer to copy. |
|
defaultnoexcept |
Moves the given constant buffer to this constant buffer.
[in] | buffer | A reference to the constant buffer to move. |
|
private |
Sets up the resource buffer of this constant buffer.
[in] | device | A reference to the device. |
Exception | Failed to setup this constant buffer. |
void mage::rendering::ConstantBuffer< T >::UpdateData | ( | ID3D11DeviceContext & | device_context, |
const T & | data | ||
) |
Updates the data of this constant buffer with the given data.
[in,out] | device_context | A reference to the device context. |
[in] | data | A reference to the data. |
Exception | Failed to update the data. |
|
private |
A pointer to the buffer resource of this constant buffer.