#include <ShaderManager.h>
Definition at line 11 of file ShaderManager.h.
◆ ShaderManager()
| IncrementalEngine::ShaderManager::ShaderManager |
( |
| ) |
|
◆ ~ShaderManager()
| IncrementalEngine::ShaderManager::~ShaderManager |
( |
| ) |
|
|
virtual |
◆ ClearFrame()
| void IncrementalEngine::ShaderManager::ClearFrame |
( |
| ) |
|
◆ Init()
Definition at line 19 of file ShaderManager.cpp.
29 return CO_E_ERRORINAPP;
35 MessageBox(hWnd, L
"Could not initialize the Texture Shader Renderer.", L
"Error", MB_OK);
36 return CO_E_ERRORINAPP;
42 MessageBox(hWnd, L
"Could not initialize the Global Buffer.", L
"Error", MB_OK);
43 return CO_E_ERRORINAPP;
◆ InitGlobalBuffer()
| HRESULT IncrementalEngine::ShaderManager::InitGlobalBuffer |
( |
| ) |
|
|
private |
Definition at line 49 of file ShaderManager.cpp.
52 D3D11_BUFFER_DESC matrixBufferDesc;
54 matrixBufferDesc.Usage = D3D11_USAGE_DYNAMIC;
55 matrixBufferDesc.ByteWidth =
sizeof(MatrixBufferType);
56 matrixBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
57 matrixBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
58 matrixBufferDesc.MiscFlags = 0;
59 matrixBufferDesc.StructureByteStride = 0;
69 return CO_E_ERRORINAPP;
◆ RenderTextureShader()
| HRESULT IncrementalEngine::ShaderManager::RenderTextureShader |
( |
int |
indexCount, |
|
|
ID3D11ShaderResourceView * |
texture |
|
) |
| |
Definition at line 126 of file ShaderManager.cpp.
131 assert(
"SetupFrame() method has to be called before render a Shader." &&
_frameReady);
142 return CO_E_ERRORINAPP;
◆ SetupFrame()
| HRESULT IncrementalEngine::ShaderManager::SetupFrame |
( |
| ) |
|
Definition at line 75 of file ShaderManager.cpp.
80 D3DXMATRIX worldMatrix, viewMatrix, orthoProjectionMatrix;
81 D3D11_MAPPED_SUBRESOURCE mappedResource;
82 MatrixBufferType* dataPtr;
88 D3DXMatrixTranspose(&worldMatrix, &worldMatrix);
89 D3DXMatrixTranspose(&viewMatrix, &viewMatrix);
90 D3DXMatrixTranspose(&orthoProjectionMatrix, &orthoProjectionMatrix);
93 result = deviceContext->Map(
96 D3D11_MAP_WRITE_DISCARD,
103 return CO_E_ERRORINAPP;
106 dataPtr = (MatrixBufferType*)mappedResource.pData;
108 dataPtr->world = worldMatrix;
109 dataPtr->view = viewMatrix;
110 dataPtr->projection = orthoProjectionMatrix;
◆ SetWorldMatrix()
| void IncrementalEngine::ShaderManager::SetWorldMatrix |
( |
D3DXMATRIX & |
worldMatrix | ) |
|
◆ _camera
◆ _direct3D
◆ _frameReady
| bool IncrementalEngine::ShaderManager::_frameReady |
|
private |
◆ _matrixBuffer
| ID3D11Buffer* IncrementalEngine::ShaderManager::_matrixBuffer |
|
private |
◆ _textureShader