Minor: Ajout du Multitexturing dans le shader manager
Actuellement envie de DCD, JPP des Lights 😠
This commit is contained in:
parent
38242fc60b
commit
d61a5b7f5f
@ -4,7 +4,6 @@ ApplicationClass::ApplicationClass()
|
||||
{
|
||||
m_Direct3D = 0;
|
||||
m_Camera = 0;
|
||||
m_MultiTextureShader = 0;
|
||||
m_AlphaMapShader = 0;
|
||||
m_Model = 0;
|
||||
m_LightShader = 0;
|
||||
@ -48,7 +47,7 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
|
||||
{
|
||||
char mouseString1[32], mouseString2[32], mouseString3[32];
|
||||
char testString1[32], testString2[32], testString3[32];
|
||||
char modelFilename[128], textureFilename1[128], textureFilename2[128], textureFilename3[128], renderString[32];
|
||||
char modelFilename[128], textureFilename1[128], textureFilename2[128], textureFilename3[128], textureFilename4[128], textureFilename5[128], textureFilename6[128], renderString[32];
|
||||
char bitmapFilename[128];
|
||||
char spriteFilename[128];
|
||||
char fpsString[32];
|
||||
@ -235,15 +234,6 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create and initialize the multitexture shader object.
|
||||
m_MultiTextureShader = new MultiTextureShaderClass;
|
||||
|
||||
result = m_MultiTextureShader->Initialize(m_Direct3D->GetDevice(), hwnd);
|
||||
if (!result)
|
||||
{
|
||||
MessageBox(hwnd, L"Could not initialize the multitexture shader object.", L"Error", MB_OK);
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the file name of the model.
|
||||
strcpy_s(modelFilename, "cube.txt");
|
||||
@ -251,13 +241,17 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
|
||||
// Set the file name of the textures.
|
||||
strcpy_s(textureFilename1, "stone01.tga");
|
||||
strcpy_s(textureFilename2, "normal01.tga");
|
||||
strcpy_s(textureFilename3, "alpha01.tga");
|
||||
strcpy_s(textureFilename3, "spec02.tga");
|
||||
strcpy_s(textureFilename4, "alpha01.tga");
|
||||
strcpy_s(textureFilename5, "light01.tga");
|
||||
strcpy_s(textureFilename6, "moss01.tga");
|
||||
// A FAIRE: Ajouter une nouvelle texture pour le multitexturing
|
||||
|
||||
// Create and initialize the model object.
|
||||
m_Model = new ModelClass;
|
||||
|
||||
result = m_Model->Initialize(m_Direct3D->GetDevice(), m_Direct3D->GetDeviceContext(), modelFilename, textureFilename1, textureFilename2, textureFilename3);
|
||||
result = m_Model->Initialize(m_Direct3D->GetDevice(), m_Direct3D->GetDeviceContext(), modelFilename, textureFilename1, textureFilename2, textureFilename3, textureFilename4,
|
||||
textureFilename5, textureFilename6);
|
||||
if (!result)
|
||||
{
|
||||
MessageBox(hwnd, L"Could not initialize the model object.", L"Error", MB_OK);
|
||||
@ -321,6 +315,7 @@ bool ApplicationClass::Initialize(int screenWidth, int screenHeight, HWND hwnd)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create and initialize the light map shader object.
|
||||
m_LightMapShader = new LightMapShaderClass;
|
||||
|
||||
@ -546,7 +541,7 @@ void ApplicationClass::Shutdown()
|
||||
m_Sprite = 0;
|
||||
}
|
||||
|
||||
// Release the light objects.
|
||||
// Release the lights objects.
|
||||
if (m_Lights)
|
||||
{
|
||||
delete[] m_Lights;
|
||||
@ -592,46 +587,6 @@ void ApplicationClass::Shutdown()
|
||||
m_Model = 0;
|
||||
}
|
||||
|
||||
// Release the multitexture shader object.
|
||||
if (m_MultiTextureShader)
|
||||
{
|
||||
m_MultiTextureShader->Shutdown();
|
||||
delete m_MultiTextureShader;
|
||||
m_MultiTextureShader = 0;
|
||||
// Release the bitmap object.
|
||||
if (m_Bitmap)
|
||||
{
|
||||
m_Bitmap->Shutdown();
|
||||
delete m_Bitmap;
|
||||
m_Bitmap = 0;
|
||||
}
|
||||
|
||||
// Release the texture shader object.
|
||||
if (m_TextureShader)
|
||||
{
|
||||
m_TextureShader->Shutdown();
|
||||
delete m_TextureShader;
|
||||
m_TextureShader = 0;
|
||||
}
|
||||
|
||||
// Release the camera object.
|
||||
if (m_Camera)
|
||||
{
|
||||
delete m_Camera;
|
||||
m_Camera = 0;
|
||||
}
|
||||
|
||||
// Release the D3D object.
|
||||
if (m_Direct3D)
|
||||
{
|
||||
m_Direct3D->Shutdown();
|
||||
delete m_Direct3D;
|
||||
m_Direct3D = 0;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// Release the alpha map shader object.
|
||||
if (m_AlphaMapShader)
|
||||
{
|
||||
@ -1054,6 +1009,14 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
//// Render the model using the multitexture shader.
|
||||
//m_Model->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
// Setup matrices.
|
||||
rotateMatrix = XMMatrixRotationY(rotation);
|
||||
translateMatrix = XMMatrixTranslation(0.0f, 4.0f, 0.0f);
|
||||
worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
|
||||
|
||||
// Render the model using the texture shader.
|
||||
m_Model->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
result = m_ShaderManager->RenderTextureShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
|
||||
m_Model->GetTexture(0));
|
||||
if (!result)
|
||||
@ -1063,7 +1026,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
|
||||
// Setup matrices.
|
||||
rotateMatrix = XMMatrixRotationY(rotation);
|
||||
translateMatrix = XMMatrixTranslation(-1.5f, -1.0f, 0.0f);
|
||||
translateMatrix = XMMatrixTranslation(0.0f, 1.0f, 0.0f);
|
||||
worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
|
||||
|
||||
// Render the model using the light shader.
|
||||
@ -1078,7 +1041,7 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
|
||||
// Setup matrices.
|
||||
rotateMatrix = XMMatrixRotationY(rotation);
|
||||
translateMatrix = XMMatrixTranslation(1.5f, -1.0f, 0.0f);
|
||||
translateMatrix = XMMatrixTranslation(0.0f, -2.0f, 0.0f);
|
||||
worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
|
||||
|
||||
// Render the model using the normal map shader.
|
||||
@ -1091,6 +1054,21 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
return false;
|
||||
}
|
||||
|
||||
// Setup matrices.
|
||||
rotateMatrix = XMMatrixRotationY(rotation);
|
||||
translateMatrix = XMMatrixTranslation(0.0f, -5.0f, 0.0f);
|
||||
worldMatrix = XMMatrixMultiply(rotateMatrix, translateMatrix);
|
||||
|
||||
// Render the model using the Multitexture shader.
|
||||
m_Model->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
result = m_ShaderManager->RenderMultitextureShader(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
|
||||
m_Model->GetTexture(0), m_Model->GetTexture(5));
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Lighting, utilise plusieurs lights donc Multiple Points Lighting
|
||||
//result = m_LightShader->Render(m_Direct3D->GetDeviceContext(), m_Model->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, m_Model->GetTexture(0),
|
||||
// diffuseColor, lightPosition);
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "lightshaderclass.h"
|
||||
#include "lightclass.h"
|
||||
#include "lightmapshaderclass.h"
|
||||
#include "multitextureshaderclass.h"
|
||||
#include "alphamapshaderclass.h"
|
||||
#include "bitmapclass.h"
|
||||
#include "spriteclass.h"
|
||||
@ -70,7 +69,6 @@ private:
|
||||
LightClass* m_Light;
|
||||
LightClass* m_Lights;
|
||||
LightMapShaderClass* m_LightMapShader;
|
||||
MultiTextureShaderClass* m_MultiTextureShader;
|
||||
AlphaMapShaderClass* m_AlphaMapShader;
|
||||
ModelClass* m_Model;
|
||||
TextureShaderClass* m_TextureShader;
|
||||
|
@ -125,6 +125,7 @@
|
||||
<Image Include="moss01.tga" />
|
||||
<Image Include="normal01.tga" />
|
||||
<Image Include="papier.tga" />
|
||||
<Image Include="spec02.tga" />
|
||||
<Image Include="stone01.tga" />
|
||||
<Image Include="wall.tga" />
|
||||
</ItemGroup>
|
||||
|
@ -1,323 +1,109 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Fichiers sources">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Fichiers d%27en-tête">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Fichiers de ressources">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="shader">
|
||||
<UniqueIdentifier>{b016e481-576e-4d99-bdde-34cc10c55b1d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="texture">
|
||||
<UniqueIdentifier>{f76f9761-bbbe-42a8-935d-01f1b9172c38}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="assets">
|
||||
<UniqueIdentifier>{741e1efe-db9b-48a7-9ecb-4c34a696f40e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="fonts">
|
||||
<UniqueIdentifier>{51e14ebb-4f58-488f-8d0f-04935f51efda}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<ClCompile Include="alphamapshaderclass.cpp" />
|
||||
<ClCompile Include="applicationclass.cpp" />
|
||||
<ClCompile Include="bitmapclass.cpp" />
|
||||
<ClCompile Include="Cameraclass.cpp" />
|
||||
<ClCompile Include="Colorshaderclass.cpp" />
|
||||
<ClCompile Include="d3dclass.cpp" />
|
||||
<ClCompile Include="displayplaneclass.cpp" />
|
||||
<ClCompile Include="fontclass.cpp" />
|
||||
<ClCompile Include="fontshaderclass.cpp" />
|
||||
<ClCompile Include="fpsclass.cpp" />
|
||||
<ClCompile Include="frustumclass.cpp" />
|
||||
<ClCompile Include="inputclass.cpp" />
|
||||
<ClCompile Include="Lightclass.cpp" />
|
||||
<ClCompile Include="lightmapshaderclass.cpp" />
|
||||
<ClCompile Include="Lightshaderclass.cpp" />
|
||||
<ClCompile Include="Main.cpp" />
|
||||
<ClCompile Include="modelclass.cpp" />
|
||||
<ClCompile Include="modellistclass.cpp" />
|
||||
<ClCompile Include="Multitextureshaderclass.cpp" />
|
||||
<ClCompile Include="normalmapshaderclass.cpp" />
|
||||
<ClCompile Include="shadermanagerclass.cpp" />
|
||||
<ClCompile Include="positionclass.cpp" />
|
||||
<ClCompile Include="rendertextureclass.cpp" />
|
||||
<ClCompile Include="specmapshaderclass.cpp" />
|
||||
<ClCompile Include="Spriteclass.cpp" />
|
||||
<ClCompile Include="Systemclass.cpp" />
|
||||
<ClCompile Include="textclass.cpp" />
|
||||
<ClCompile Include="textureclass.cpp" />
|
||||
<ClCompile Include="textureshaderclass.cpp" />
|
||||
<ClCompile Include="Timerclass.cpp" />
|
||||
<ClCompile Include="translateshaderclass.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="applicationclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="bitmapclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Cameraclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Colorshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="d3dclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="fontclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="fontshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="inputclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Lightclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Lightshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Main.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="modelclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Multitextureshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Spriteclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Systemclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="textclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="textureclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="textureshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Timerclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="fpsclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="lightmapshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="alphamapshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="normalmapshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="specmapshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="shadermanagerclass.cpp">
|
||||
<ClCompile Include="frustumclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="modellistclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="positionclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="displayplaneclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="rendertextureclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="translateshaderclass.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="alphamapshaderclass.h" />
|
||||
<ClInclude Include="applicationclass.h" />
|
||||
<ClInclude Include="bitmapclass.h" />
|
||||
<ClInclude Include="Cameraclass.h" />
|
||||
<ClInclude Include="Colorshaderclass.h" />
|
||||
<ClInclude Include="d3dclass.h" />
|
||||
<ClInclude Include="displayplaneclass.h" />
|
||||
<ClInclude Include="fontclass.h" />
|
||||
<ClInclude Include="fontshaderclass.h" />
|
||||
<ClInclude Include="fpsclass.h" />
|
||||
<ClInclude Include="frustumclass.h" />
|
||||
<ClInclude Include="inputclass.h" />
|
||||
<ClInclude Include="lightclass.h" />
|
||||
<ClInclude Include="lightmapshaderclass.h" />
|
||||
<ClInclude Include="lightshaderclass.h" />
|
||||
<ClInclude Include="modelclass.h" />
|
||||
<ClInclude Include="modellistclass.h" />
|
||||
<ClInclude Include="Multitextureshaderclass.h" />
|
||||
<ClInclude Include="normalmapshaderclass.h" />
|
||||
<ClInclude Include="shadermanagerclass.h" />
|
||||
<ClInclude Include="positionclass.h" />
|
||||
<ClInclude Include="rendertextureclass.h" />
|
||||
<ClInclude Include="specmapshaderclass.h" />
|
||||
<ClInclude Include="Spriteclass.h" />
|
||||
<ClInclude Include="systemclass.h" />
|
||||
<ClInclude Include="textclass.h" />
|
||||
<ClInclude Include="textureclass.h" />
|
||||
<ClInclude Include="textureshaderclass.h" />
|
||||
<ClInclude Include="Timerclass.h" />
|
||||
<ClInclude Include="translateshaderclass.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="applicationclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="bitmapclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Cameraclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Colorshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d3dclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="fontclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="fontshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="inputclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="lightclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="lightshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="modelclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Multitextureshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Spriteclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="systemclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="textclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="textureclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="textureshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Timerclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="fpsclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="lightmapshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="alphamapshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="normalmapshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="specmapshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="shadermanagerclass.h">
|
||||
<ClInclude Include="frustumclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="modellistclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="positionclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="displayplaneclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="rendertextureclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="translateshaderclass.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<Image Include="alpha01.tga" />
|
||||
<Image Include="dirt01.tga" />
|
||||
<Image Include="font01.tga" />
|
||||
<Image Include="light01.tga" />
|
||||
<Image Include="moss01.tga" />
|
||||
<Image Include="normal01.tga" />
|
||||
<Image Include="papier.tga" />
|
||||
<Image Include="stone01.tga" />
|
||||
<Image Include="wall.tga" />
|
||||
<Image Include="spec02.tga" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="font01.tga">
|
||||
<Filter>fonts</Filter>
|
||||
</Image>
|
||||
<Image Include="wall.tga">
|
||||
<Filter>assets</Filter>
|
||||
</Image>
|
||||
<Image Include="papier.tga">
|
||||
<Filter>assets</Filter>
|
||||
</Image>
|
||||
<Image Include="moss01.tga">
|
||||
<Filter>assets</Filter>
|
||||
</Image>
|
||||
<Image Include="stone01.tga">
|
||||
<Filter>assets</Filter>
|
||||
</Image>
|
||||
<Image Include="light01.tga">
|
||||
<Filter>assets</Filter>
|
||||
</Image>
|
||||
<Image Include="dirt01.tga">
|
||||
<Filter>assets</Filter>
|
||||
</Image>
|
||||
<Image Include="alpha01.tga">
|
||||
<Filter>assets</Filter>
|
||||
</Image>
|
||||
<Image Include="normal01.tga">
|
||||
<Filter>assets</Filter>
|
||||
</Image>
|
||||
<None Include="alphamap.ps" />
|
||||
<None Include="alphamap.vs" />
|
||||
<None Include="font.ps" />
|
||||
<None Include="font.vs" />
|
||||
<None Include="light.ps" />
|
||||
<None Include="light.vs" />
|
||||
<None Include="lightmap.ps" />
|
||||
<None Include="lightmap.vs" />
|
||||
<None Include="Multitexture.ps" />
|
||||
<None Include="Multitexture.vs" />
|
||||
<None Include="normalmap.ps" />
|
||||
<None Include="normalmap.vs" />
|
||||
<None Include="specmap.ps" />
|
||||
<None Include="specmap.vs" />
|
||||
<None Include="texture.ps" />
|
||||
<None Include="texture.vs" />
|
||||
<None Include="Color.ps" />
|
||||
<None Include="Color.vs" />
|
||||
<None Include="translate.ps" />
|
||||
<None Include="translate.vs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="font.vs">
|
||||
<Filter>fonts</Filter>
|
||||
</None>
|
||||
<None Include="font.ps">
|
||||
<Filter>fonts</Filter>
|
||||
</None>
|
||||
<None Include="Color.ps">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="Color.vs">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="light.ps">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="Multitexture.ps">
|
||||
<Filter>texture</Filter>
|
||||
</None>
|
||||
<None Include="Multitexture.vs">
|
||||
<Filter>texture</Filter>
|
||||
</None>
|
||||
<None Include="texture.ps">
|
||||
<Filter>texture</Filter>
|
||||
</None>
|
||||
<None Include="texture.vs">
|
||||
<Filter>texture</Filter>
|
||||
</None>
|
||||
<None Include="light.vs">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="lightmap.vs">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="lightmap.ps">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="alphamap.vs">
|
||||
<Filter>texture</Filter>
|
||||
</None>
|
||||
<None Include="alphamap.ps">
|
||||
<Filter>texture</Filter>
|
||||
</None>
|
||||
<None Include="normalmap.vs">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="normalmap.ps">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="specmap.vs">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
<None Include="specmap.ps">
|
||||
<Filter>shader</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="font01.txt">
|
||||
<Filter>fonts</Filter>
|
||||
</Text>
|
||||
<Text Include="plane.txt">
|
||||
<Filter>assets</Filter>
|
||||
</Text>
|
||||
<Text Include="sphere.txt">
|
||||
<Filter>assets</Filter>
|
||||
</Text>
|
||||
<Text Include="cube.txt">
|
||||
<Filter>assets</Filter>
|
||||
</Text>
|
||||
<Text Include="square.txt">
|
||||
<Filter>assets</Filter>
|
||||
</Text>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Midl Include="translate.ps">
|
||||
<Filter>shader</Filter>
|
||||
</Midl>
|
||||
<Midl Include="translate.vs">
|
||||
<Filter>shader</Filter>
|
||||
</Midl>
|
||||
<Text Include="cube.txt" />
|
||||
<Text Include="font01.txt" />
|
||||
<Text Include="plane.txt" />
|
||||
<Text Include="sphere.txt" />
|
||||
<Text Include="square.txt" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -19,7 +19,8 @@ ModelClass::~ModelClass()
|
||||
{
|
||||
}
|
||||
|
||||
bool ModelClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceContext, char* modelFilename, char* textureFilename1, char* textureFilename2, char* textureFilename3)
|
||||
bool ModelClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceContext, char* modelFilename, char* textureFilename1, char* textureFilename2, char* textureFilename3,
|
||||
char* textureFilename4, char* textureFilename5, char* textureFilename6)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@ -40,7 +41,7 @@ bool ModelClass::Initialize(ID3D11Device* device, ID3D11DeviceContext* deviceCon
|
||||
return false;
|
||||
}
|
||||
// Load the textures for this model.
|
||||
result = LoadTextures(device, deviceContext, textureFilename1, textureFilename2, textureFilename3);
|
||||
result = LoadTextures(device, deviceContext, textureFilename1, textureFilename2, textureFilename3, textureFilename4, textureFilename5, textureFilename6);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
@ -206,13 +207,14 @@ void ModelClass::RenderBuffers(ID3D11DeviceContext* deviceContext)
|
||||
}
|
||||
|
||||
|
||||
bool ModelClass::LoadTextures(ID3D11Device* device, ID3D11DeviceContext* deviceContext, char* filename1, char* filename2, char* filename3)
|
||||
bool ModelClass::LoadTextures(ID3D11Device* device, ID3D11DeviceContext* deviceContext, char* filename1, char* filename2, char* filename3, char* filename4, char* filename5,
|
||||
char* filename6)
|
||||
{
|
||||
bool result;
|
||||
|
||||
|
||||
// Create and initialize the texture object array.
|
||||
m_Textures = new TextureClass[3];
|
||||
m_Textures = new TextureClass[6];
|
||||
|
||||
result = m_Textures[0].Initialize(device, deviceContext, filename1);
|
||||
if (!result)
|
||||
@ -232,6 +234,24 @@ bool ModelClass::LoadTextures(ID3D11Device* device, ID3D11DeviceContext* deviceC
|
||||
return false;
|
||||
}
|
||||
|
||||
result = m_Textures[3].Initialize(device, deviceContext, filename4);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
result = m_Textures[4].Initialize(device, deviceContext, filename5);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
result = m_Textures[5].Initialize(device, deviceContext, filename6);
|
||||
if (!result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -244,6 +264,9 @@ void ModelClass::ReleaseTextures()
|
||||
m_Textures[0].Shutdown();
|
||||
m_Textures[1].Shutdown();
|
||||
m_Textures[2].Shutdown();
|
||||
m_Textures[3].Shutdown();
|
||||
m_Textures[4].Shutdown();
|
||||
m_Textures[5].Shutdown();
|
||||
|
||||
delete[] m_Textures;
|
||||
m_Textures = 0;
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
ModelClass(const ModelClass&);
|
||||
~ModelClass();
|
||||
|
||||
bool Initialize(ID3D11Device*, ID3D11DeviceContext*, char*, char*, char*, char*);
|
||||
bool Initialize(ID3D11Device*, ID3D11DeviceContext*, char*, char*, char*, char*, char*, char*, char*);
|
||||
void Shutdown();
|
||||
void Render(ID3D11DeviceContext*);
|
||||
|
||||
@ -91,7 +91,7 @@ private:
|
||||
bool InitializeBuffers(ID3D11Device*);
|
||||
void ShutdownBuffers();
|
||||
void RenderBuffers(ID3D11DeviceContext*);
|
||||
bool LoadTextures(ID3D11Device*, ID3D11DeviceContext*, char*, char*, char*);
|
||||
bool LoadTextures(ID3D11Device*, ID3D11DeviceContext*, char*, char*, char*, char*, char*, char*);
|
||||
void ReleaseTextures();
|
||||
|
||||
bool LoadModel(char*);
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1020 KiB |
BIN
enginecustom/spec02.tga
Normal file
BIN
enginecustom/spec02.tga
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.0 MiB |
Loading…
x
Reference in New Issue
Block a user