Ajout multitexturing au Shader Manager

PS: La fenetre ne s'ouvre toujours pas
This commit is contained in:
GolfOcean334 2024-04-03 13:01:42 +02:00
parent cb1187b358
commit b52231c747
2 changed files with 35 additions and 4 deletions

View File

@ -49,6 +49,15 @@ bool ShaderManagerClass::Initialize(ID3D11Device* device, HWND hwnd)
return false;
}
// Create and initialize the multitexture shader object.
m_MultitextureShader = new MultiTextureShaderClass;
result = m_MultitextureShader->Initialize(device, hwnd);
if (!result)
{
return false;
}
return true;
}
@ -78,6 +87,14 @@ void ShaderManagerClass::Shutdown()
m_TextureShader = 0;
}
// Release the multitexture shader object.
if (m_MultitextureShader)
{
m_MultitextureShader->Shutdown();
delete m_MultitextureShader;
m_MultitextureShader = 0;
}
return;
}
@ -96,7 +113,6 @@ bool ShaderManagerClass::RenderTextureShader(ID3D11DeviceContext* deviceContext,
return true;
}
bool ShaderManagerClass::RenderLightShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
ID3D11ShaderResourceView* texture, XMFLOAT3 lightDirection, XMFLOAT4 diffuseColor)
{
@ -121,9 +137,6 @@ bool ShaderManagerClass::RenderLightShader(ID3D11DeviceContext* deviceContext, i
return true;
}
bool ShaderManagerClass::RenderNormalMapShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
ID3D11ShaderResourceView* colorTexture, ID3D11ShaderResourceView* normalTexture, XMFLOAT3 lightDirection, XMFLOAT4 diffuseColor)
{
@ -138,3 +151,18 @@ bool ShaderManagerClass::RenderNormalMapShader(ID3D11DeviceContext* deviceContex
return true;
}
bool ShaderManagerClass::RenderMultitextureShader(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix,
ID3D11ShaderResourceView* texture1, ID3D11ShaderResourceView* texture2)
{
bool result;
result = m_MultitextureShader->Render(deviceContext, indexCount, worldMatrix, viewMatrix, projectionMatrix, texture1, texture2);
if (!result)
{
return false;
}
return true;
}

View File

@ -7,6 +7,7 @@
#include "textureshaderclass.h"
#include "lightshaderclass.h"
#include "normalmapshaderclass.h"
#include "Multitextureshaderclass.h"
////////////////////////////////////////////////////////////////////////////////
@ -24,11 +25,13 @@ public:
bool RenderTextureShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*);
bool RenderLightShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4);
bool RenderNormalMapShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*, XMFLOAT3, XMFLOAT4);
bool RenderMultitextureShader(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, ID3D11ShaderResourceView*);
private:
TextureShaderClass* m_TextureShader;
LightShaderClass* m_LightShader;
NormalMapShaderClass* m_NormalMapShader;
MultiTextureShaderClass* m_MultitextureShader;
};
#endif