From 0d5e26266b52f7f686f55f3f39cf735fe35be1f6 Mon Sep 17 00:00:00 2001 From: CatChow0 Date: Mon, 27 Jan 2025 22:46:27 +0100 Subject: [PATCH] Major update - Architecture Rework --- .idea/.idea.KhaoticEngineReborn/.idea/.name | 1 + .../.idea/git_toolbox_blame.xml | 6 + .../.idea/indexLayout.xml | 8 + .../.idea/material_theme_project_new.xml | 10 + .../.idea/projectSettingsUpdater.xml | 7 + .idea/.idea.KhaoticEngineReborn/.idea/vcs.xml | 6 + .../.idea/workspace.xml | 45 ++ enginecustom/Light.ps | 84 --- enginecustom/Light.vs | 85 --- enginecustom/Lightclass.cpp | 91 --- enginecustom/Lightclass.h | 53 -- enginecustom/Lightshaderclass.cpp | 544 ------------------ enginecustom/Lightshaderclass.h | 92 --- enginecustom/enginecustom.vcxproj | 289 +++++----- enginecustom/enginecustom.vcxproj.filters | 383 +++++------- enginecustom/imgui.ini | 4 +- enginecustom/{ => src/hlsl}/Color.ps | 0 enginecustom/{ => src/hlsl}/Color.vs | 0 enginecustom/{ => src/hlsl}/Multitexture.ps | 0 enginecustom/{ => src/hlsl}/Multitexture.vs | 0 enginecustom/{ => src/hlsl}/alphamap.ps | 0 enginecustom/{ => src/hlsl}/alphamap.vs | 0 enginecustom/{ => src/hlsl}/celshading.ps | 0 enginecustom/{ => src/hlsl}/celshading.vs | 0 enginecustom/{ => src/hlsl}/font.ps | 0 enginecustom/{ => src/hlsl}/font.vs | 0 enginecustom/{ => src/hlsl}/light.ps | 0 enginecustom/{ => src/hlsl}/light.vs | 0 enginecustom/{ => src/hlsl}/lightmap.ps | 0 enginecustom/{ => src/hlsl}/lightmap.vs | 0 enginecustom/{ => src/hlsl}/normalmap.ps | 0 enginecustom/{ => src/hlsl}/normalmap.vs | 0 enginecustom/{ => src/hlsl}/reflection.ps | 0 enginecustom/{ => src/hlsl}/reflection.vs | 0 enginecustom/{ => src/hlsl}/refraction.ps | 0 enginecustom/{ => src/hlsl}/refraction.vs | 0 enginecustom/{ => src/hlsl}/specmap.ps | 0 enginecustom/{ => src/hlsl}/specmap.vs | 0 enginecustom/{ => src/hlsl}/sunlight.ps | 0 enginecustom/{ => src/hlsl}/sunlight.vs | 0 enginecustom/{ => src/hlsl}/texture.ps | 0 enginecustom/{ => src/hlsl}/texture.vs | 0 enginecustom/{ => src/hlsl}/translate.ps | 0 enginecustom/{ => src/hlsl}/translate.vs | 0 enginecustom/{ => src/hlsl}/transparent.ps | 0 enginecustom/{ => src/hlsl}/transparent.vs | 0 enginecustom/{ => src/hlsl}/water.ps | 0 enginecustom/{ => src/hlsl}/water.vs | 0 .../{ => src/inc/shader}/CelShadingShader.h | 0 .../{ => src/inc/shader}/Colorshaderclass.h | 0 .../inc/shader}/Multitextureshaderclass.h | 0 .../inc/shader}/alphamapshaderclass.h | 0 .../{ => src/inc/shader}/fontshaderclass.h | 0 .../inc/shader}/lightmapshaderclass.h | 0 .../{ => src/inc/shader}/lightshaderclass.h | 0 .../inc/shader}/lightshaderwaterclass.h | 0 .../inc/shader}/normalmapshaderclass.h | 0 .../inc/shader}/reflectionshaderclass.h | 0 .../inc/shader}/refractionshaderclass.h | 0 .../{ => src/inc/shader}/shadermanagerclass.h | 0 .../{ => src/inc/shader}/specmapshaderclass.h | 0 .../inc/shader}/sunlightshaderclass.h | 0 .../{ => src/inc/shader}/textureshaderclass.h | 0 .../inc/shader}/translateshaderclass.h | 0 .../inc/shader}/transparentshaderclass.h | 0 .../{ => src/inc/shader}/watershaderclass.h | 0 .../{ => src/inc/system}/Cameraclass.h | 0 enginecustom/{ => src/inc/system}/Logger.h | 0 .../{ => src/inc/system}/Modellistclass.h | 0 .../{ => src/inc/system}/Positionclass.h | 0 .../{ => src/inc/system}/Spriteclass.h | 0 .../{ => src/inc/system}/Timerclass.h | 0 .../{ => src/inc/system}/applicationclass.h | 0 .../{ => src/inc/system}/bitmapclass.h | 0 enginecustom/{ => src/inc/system}/d3dclass.h | 0 .../{ => src/inc/system}/displayplaneclass.h | 0 enginecustom/{ => src/inc/system}/fontclass.h | 0 enginecustom/{ => src/inc/system}/fpsclass.h | 0 enginecustom/{ => src/inc/system}/frustum.h | 0 .../{ => src/inc/system}/frustumclass.h | 0 .../{ => src/inc/system}/imguiManager.h | 0 .../{ => src/inc/system}/inputclass.h | 0 .../{ => src/inc/system}/lightclass.h | 0 .../{ => src/inc/system}/modelclass.h | 0 enginecustom/{ => src/inc/system}/object.h | 0 enginecustom/{ => src/inc/system}/physics.h | 0 .../{ => src/inc/system}/rendertextureclass.h | 0 .../{ => src/inc/system}/systemclass.h | 2 +- enginecustom/{ => src/inc/system}/textclass.h | 0 .../{ => src/inc/system}/textureclass.h | 0 .../{ => src/src/shader}/CelShadingShader.cpp | 4 +- .../{ => src/src/shader}/Colorshaderclass.cpp | 4 +- .../src/shader}/Multitextureshaderclass.cpp | 4 +- .../src/shader}/alphamapshaderclass.cpp | 4 +- .../{ => src/src/shader}/fontshaderclass.cpp | 4 +- .../src/shader}/lightmapshaderclass.cpp | 4 +- .../{ => src/src/shader}/lightshaderclass.cpp | 4 +- .../src/shader}/normalmapshaderclass.cpp | 4 +- .../src/shader}/reflectionshaderclass.cpp | 4 +- .../src/shader}/refractionshaderclass.cpp | 4 +- .../src/shader}/shadermanagerclass.cpp | 0 .../src/shader}/specmapshaderclass.cpp | 4 +- .../src/shader}/sunlightshaderclass.cpp | 4 +- .../src/shader}/textureshaderclass.cpp | 4 +- .../src/shader}/translateshaderclass.cpp | 4 +- .../src/shader}/transparentshaderclass.cpp | 4 +- .../{ => src/src/shader}/watershaderclass.cpp | 4 +- .../{ => src/src/system}/Cameraclass.cpp | 0 enginecustom/{ => src/src/system}/Main.cpp | 0 .../{ => src/src/system}/Modellistclass.cpp | 0 .../{ => src/src/system}/Positionclass.cpp | 0 .../{ => src/src/system}/Spriteclass.cpp | 0 .../{ => src/src/system}/Systemclass.cpp | 0 .../{ => src/src/system}/Timerclass.cpp | 0 .../{ => src/src/system}/applicationclass.cpp | 0 .../{ => src/src/system}/bitmapclass.cpp | 0 .../{ => src/src/system}/d3dclass.cpp | 0 .../src/system}/displayplaneclass.cpp | 0 .../{ => src/src/system}/fontclass.cpp | 0 .../{ => src/src/system}/fpsclass.cpp | 0 enginecustom/{ => src/src/system}/frustum.cpp | 0 .../{ => src/src/system}/frustumclass.cpp | 0 .../{ => src/src/system}/imguiManager.cpp | 0 .../{ => src/src/system}/inputclass.cpp | 0 .../{ => src/src/system}/lightclass.cpp | 0 .../{ => src/src/system}/modelclass.cpp | 0 enginecustom/{ => src/src/system}/object.cpp | 0 enginecustom/{ => src/src/system}/physics.cpp | 0 .../src/system}/rendertextureclass.cpp | 0 .../{ => src/src/system}/textclass.cpp | 0 .../{ => src/src/system}/textureclass.cpp | 0 131 files changed, 426 insertions(+), 1348 deletions(-) create mode 100644 .idea/.idea.KhaoticEngineReborn/.idea/.name create mode 100644 .idea/.idea.KhaoticEngineReborn/.idea/git_toolbox_blame.xml create mode 100644 .idea/.idea.KhaoticEngineReborn/.idea/indexLayout.xml create mode 100644 .idea/.idea.KhaoticEngineReborn/.idea/material_theme_project_new.xml create mode 100644 .idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml create mode 100644 .idea/.idea.KhaoticEngineReborn/.idea/vcs.xml create mode 100644 .idea/.idea.KhaoticEngineReborn/.idea/workspace.xml delete mode 100644 enginecustom/Light.ps delete mode 100644 enginecustom/Light.vs delete mode 100644 enginecustom/Lightclass.cpp delete mode 100644 enginecustom/Lightclass.h delete mode 100644 enginecustom/Lightshaderclass.cpp delete mode 100644 enginecustom/Lightshaderclass.h rename enginecustom/{ => src/hlsl}/Color.ps (100%) rename enginecustom/{ => src/hlsl}/Color.vs (100%) rename enginecustom/{ => src/hlsl}/Multitexture.ps (100%) rename enginecustom/{ => src/hlsl}/Multitexture.vs (100%) rename enginecustom/{ => src/hlsl}/alphamap.ps (100%) rename enginecustom/{ => src/hlsl}/alphamap.vs (100%) rename enginecustom/{ => src/hlsl}/celshading.ps (100%) rename enginecustom/{ => src/hlsl}/celshading.vs (100%) rename enginecustom/{ => src/hlsl}/font.ps (100%) rename enginecustom/{ => src/hlsl}/font.vs (100%) rename enginecustom/{ => src/hlsl}/light.ps (100%) rename enginecustom/{ => src/hlsl}/light.vs (100%) rename enginecustom/{ => src/hlsl}/lightmap.ps (100%) rename enginecustom/{ => src/hlsl}/lightmap.vs (100%) rename enginecustom/{ => src/hlsl}/normalmap.ps (100%) rename enginecustom/{ => src/hlsl}/normalmap.vs (100%) rename enginecustom/{ => src/hlsl}/reflection.ps (100%) rename enginecustom/{ => src/hlsl}/reflection.vs (100%) rename enginecustom/{ => src/hlsl}/refraction.ps (100%) rename enginecustom/{ => src/hlsl}/refraction.vs (100%) rename enginecustom/{ => src/hlsl}/specmap.ps (100%) rename enginecustom/{ => src/hlsl}/specmap.vs (100%) rename enginecustom/{ => src/hlsl}/sunlight.ps (100%) rename enginecustom/{ => src/hlsl}/sunlight.vs (100%) rename enginecustom/{ => src/hlsl}/texture.ps (100%) rename enginecustom/{ => src/hlsl}/texture.vs (100%) rename enginecustom/{ => src/hlsl}/translate.ps (100%) rename enginecustom/{ => src/hlsl}/translate.vs (100%) rename enginecustom/{ => src/hlsl}/transparent.ps (100%) rename enginecustom/{ => src/hlsl}/transparent.vs (100%) rename enginecustom/{ => src/hlsl}/water.ps (100%) rename enginecustom/{ => src/hlsl}/water.vs (100%) rename enginecustom/{ => src/inc/shader}/CelShadingShader.h (100%) rename enginecustom/{ => src/inc/shader}/Colorshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/Multitextureshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/alphamapshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/fontshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/lightmapshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/lightshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/lightshaderwaterclass.h (100%) rename enginecustom/{ => src/inc/shader}/normalmapshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/reflectionshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/refractionshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/shadermanagerclass.h (100%) rename enginecustom/{ => src/inc/shader}/specmapshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/sunlightshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/textureshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/translateshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/transparentshaderclass.h (100%) rename enginecustom/{ => src/inc/shader}/watershaderclass.h (100%) rename enginecustom/{ => src/inc/system}/Cameraclass.h (100%) rename enginecustom/{ => src/inc/system}/Logger.h (100%) rename enginecustom/{ => src/inc/system}/Modellistclass.h (100%) rename enginecustom/{ => src/inc/system}/Positionclass.h (100%) rename enginecustom/{ => src/inc/system}/Spriteclass.h (100%) rename enginecustom/{ => src/inc/system}/Timerclass.h (100%) rename enginecustom/{ => src/inc/system}/applicationclass.h (100%) rename enginecustom/{ => src/inc/system}/bitmapclass.h (100%) rename enginecustom/{ => src/inc/system}/d3dclass.h (100%) rename enginecustom/{ => src/inc/system}/displayplaneclass.h (100%) rename enginecustom/{ => src/inc/system}/fontclass.h (100%) rename enginecustom/{ => src/inc/system}/fpsclass.h (100%) rename enginecustom/{ => src/inc/system}/frustum.h (100%) rename enginecustom/{ => src/inc/system}/frustumclass.h (100%) rename enginecustom/{ => src/inc/system}/imguiManager.h (100%) rename enginecustom/{ => src/inc/system}/inputclass.h (100%) rename enginecustom/{ => src/inc/system}/lightclass.h (100%) rename enginecustom/{ => src/inc/system}/modelclass.h (100%) rename enginecustom/{ => src/inc/system}/object.h (100%) rename enginecustom/{ => src/inc/system}/physics.h (100%) rename enginecustom/{ => src/inc/system}/rendertextureclass.h (100%) rename enginecustom/{ => src/inc/system}/systemclass.h (97%) rename enginecustom/{ => src/inc/system}/textclass.h (100%) rename enginecustom/{ => src/inc/system}/textureclass.h (100%) rename enginecustom/{ => src/src/shader}/CelShadingShader.cpp (99%) rename enginecustom/{ => src/src/shader}/Colorshaderclass.cpp (98%) rename enginecustom/{ => src/src/shader}/Multitextureshaderclass.cpp (98%) rename enginecustom/{ => src/src/shader}/alphamapshaderclass.cpp (99%) rename enginecustom/{ => src/src/shader}/fontshaderclass.cpp (99%) rename enginecustom/{ => src/src/shader}/lightmapshaderclass.cpp (99%) rename enginecustom/{ => src/src/shader}/lightshaderclass.cpp (99%) rename enginecustom/{ => src/src/shader}/normalmapshaderclass.cpp (99%) rename enginecustom/{ => src/src/shader}/reflectionshaderclass.cpp (99%) rename enginecustom/{ => src/src/shader}/refractionshaderclass.cpp (99%) rename enginecustom/{ => src/src/shader}/shadermanagerclass.cpp (100%) rename enginecustom/{ => src/src/shader}/specmapshaderclass.cpp (99%) rename enginecustom/{ => src/src/shader}/sunlightshaderclass.cpp (99%) rename enginecustom/{ => src/src/shader}/textureshaderclass.cpp (98%) rename enginecustom/{ => src/src/shader}/translateshaderclass.cpp (99%) rename enginecustom/{ => src/src/shader}/transparentshaderclass.cpp (99%) rename enginecustom/{ => src/src/shader}/watershaderclass.cpp (99%) rename enginecustom/{ => src/src/system}/Cameraclass.cpp (100%) rename enginecustom/{ => src/src/system}/Main.cpp (100%) rename enginecustom/{ => src/src/system}/Modellistclass.cpp (100%) rename enginecustom/{ => src/src/system}/Positionclass.cpp (100%) rename enginecustom/{ => src/src/system}/Spriteclass.cpp (100%) rename enginecustom/{ => src/src/system}/Systemclass.cpp (100%) rename enginecustom/{ => src/src/system}/Timerclass.cpp (100%) rename enginecustom/{ => src/src/system}/applicationclass.cpp (100%) rename enginecustom/{ => src/src/system}/bitmapclass.cpp (100%) rename enginecustom/{ => src/src/system}/d3dclass.cpp (100%) rename enginecustom/{ => src/src/system}/displayplaneclass.cpp (100%) rename enginecustom/{ => src/src/system}/fontclass.cpp (100%) rename enginecustom/{ => src/src/system}/fpsclass.cpp (100%) rename enginecustom/{ => src/src/system}/frustum.cpp (100%) rename enginecustom/{ => src/src/system}/frustumclass.cpp (100%) rename enginecustom/{ => src/src/system}/imguiManager.cpp (100%) rename enginecustom/{ => src/src/system}/inputclass.cpp (100%) rename enginecustom/{ => src/src/system}/lightclass.cpp (100%) rename enginecustom/{ => src/src/system}/modelclass.cpp (100%) rename enginecustom/{ => src/src/system}/object.cpp (100%) rename enginecustom/{ => src/src/system}/physics.cpp (100%) rename enginecustom/{ => src/src/system}/rendertextureclass.cpp (100%) rename enginecustom/{ => src/src/system}/textclass.cpp (100%) rename enginecustom/{ => src/src/system}/textureclass.cpp (100%) diff --git a/.idea/.idea.KhaoticEngineReborn/.idea/.name b/.idea/.idea.KhaoticEngineReborn/.idea/.name new file mode 100644 index 0000000..68a10b1 --- /dev/null +++ b/.idea/.idea.KhaoticEngineReborn/.idea/.name @@ -0,0 +1 @@ +KhaoticEngineReborn \ No newline at end of file diff --git a/.idea/.idea.KhaoticEngineReborn/.idea/git_toolbox_blame.xml b/.idea/.idea.KhaoticEngineReborn/.idea/git_toolbox_blame.xml new file mode 100644 index 0000000..7dc1249 --- /dev/null +++ b/.idea/.idea.KhaoticEngineReborn/.idea/git_toolbox_blame.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/.idea.KhaoticEngineReborn/.idea/indexLayout.xml b/.idea/.idea.KhaoticEngineReborn/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/.idea/.idea.KhaoticEngineReborn/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/.idea.KhaoticEngineReborn/.idea/material_theme_project_new.xml b/.idea/.idea.KhaoticEngineReborn/.idea/material_theme_project_new.xml new file mode 100644 index 0000000..b3ff0c7 --- /dev/null +++ b/.idea/.idea.KhaoticEngineReborn/.idea/material_theme_project_new.xml @@ -0,0 +1,10 @@ + + + + + + \ No newline at end of file diff --git a/.idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml b/.idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml new file mode 100644 index 0000000..64af657 --- /dev/null +++ b/.idea/.idea.KhaoticEngineReborn/.idea/projectSettingsUpdater.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/.idea/.idea.KhaoticEngineReborn/.idea/vcs.xml b/.idea/.idea.KhaoticEngineReborn/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/.idea.KhaoticEngineReborn/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml b/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml new file mode 100644 index 0000000..0eb482a --- /dev/null +++ b/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/enginecustom/Light.ps b/enginecustom/Light.ps deleted file mode 100644 index 7941e19..0000000 --- a/enginecustom/Light.ps +++ /dev/null @@ -1,84 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// Filename: light.ps -//////////////////////////////////////////////////////////////////////////////// - -///////////// -// DEFINES // -///////////// -#define NUM_LIGHTS 4 - -///////////// -// GLOBALS // -///////////// -Texture2D shaderTexture : register(t0); -SamplerState SampleType : register(s0); -cbuffer LightBuffer -{ - float4 ambientColor; - float3 lightDirection; - float padding; - float specularPower; - float4 specularColor; -}; - -cbuffer LightColorBuffer -{ - float4 diffuseColor[NUM_LIGHTS]; -}; - - -////////////// -// TYPEDEFS // -////////////// -struct PixelInputType -{ - float4 position : SV_POSITION; - float2 tex : TEXCOORD0; - float3 normal : NORMAL; - float3 lightPos[NUM_LIGHTS] : TEXCOORD1; -}; - - -//////////////////////////////////////////////////////////////////////////////// -// Pixel Shader -//////////////////////////////////////////////////////////////////////////////// -float4 LightPixelShader(PixelInputType input) : SV_TARGET -{ - float4 textureColor; - float3 lightDir; - float4 color; - float3 reflection; - float4 specular; - float lightIntensity[NUM_LIGHTS]; - float4 colorArray[NUM_LIGHTS]; - float4 colorSum; - int i; - - // Sample the pixel color from the texture using the sampler at this texture coordinate location. - textureColor = shaderTexture.Sample(SampleType, input.tex); - - for(i=0; i -using namespace DirectX; - - -//////////////////////////////////////////////////////////////////////////////// -// Class name: LightClass -//////////////////////////////////////////////////////////////////////////////// -class LightClass -{ -public: - LightClass(); - LightClass(const LightClass&); - ~LightClass(); - - void SetAmbientColor(float, float, float, float); - void SetDiffuseColor(float, float, float, float); - void SetDirection(float, float, float); - void SetSpecularColor(float, float, float, float); - void SetSpecularPower(float); - void SetPosition(float, float, float); - - XMFLOAT4 GetAmbientColor(); - XMFLOAT4 GetDiffuseColor(); - XMFLOAT3 GetDirection(); - XMFLOAT4 GetSpecularColor(); - float GetSpecularPower(); - XMFLOAT4 GetPosition(); - - void SetIntensity(float intensity) { m_intensity = intensity; } - float GetIntensity() const { return m_intensity; } - -private: - XMFLOAT4 m_ambientColor; - XMFLOAT4 m_diffuseColor; - XMFLOAT3 m_direction; - XMFLOAT4 m_specularColor; - float m_intensity; - float m_specularPower; - XMFLOAT4 m_position; -}; - -#endif \ No newline at end of file diff --git a/enginecustom/Lightshaderclass.cpp b/enginecustom/Lightshaderclass.cpp deleted file mode 100644 index 6f76143..0000000 --- a/enginecustom/Lightshaderclass.cpp +++ /dev/null @@ -1,544 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// Filename: lightshaderclass.cpp -//////////////////////////////////////////////////////////////////////////////// -#include "lightshaderclass.h" - - -LightShaderClass::LightShaderClass() -{ - m_vertexShader = 0; - m_pixelShader = 0; - m_layout = 0; - m_sampleState = 0; - m_matrixBuffer = 0; - m_cameraBuffer = 0; - m_lightBuffer = 0; - m_lightColorBuffer = 0; - m_lightPositionBuffer = 0; -} - - -LightShaderClass::LightShaderClass(const LightShaderClass& other) -{ -} - - -LightShaderClass::~LightShaderClass() -{ -} - - -bool LightShaderClass::Initialize(ID3D11Device* device, HWND hwnd) -{ - Logger::Get().Log("Initializing LightShaderClass", __FILE__, __LINE__, Logger::LogLevel::Initialize); - - wchar_t vsFilename[128]; - wchar_t psFilename[128]; - int error; - bool result; - - // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"light.vs"); - if (error != 0) - { - Logger::Get().Log("Failed to copy string", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"light.ps"); - if (error != 0) - { - Logger::Get().Log("Failed to copy string", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - // Initialize the vertex and pixel shaders. - result = InitializeShader(device, hwnd, vsFilename, psFilename); - if (!result) - { - Logger::Get().Log("Failed to initialize shader", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - Logger::Get().Log("LightShaderClass initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); - - return true; -} - - -void LightShaderClass::Shutdown() -{ - // Shutdown the vertex and pixel shaders as well as the related objects. - ShutdownShader(); - - return; -} - -bool LightShaderClass::Render(ID3D11DeviceContext* deviceContext, int indexCount, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix, - ID3D11ShaderResourceView* texture, XMFLOAT4 diffuseColor[], XMFLOAT4 lightPosition[], XMFLOAT4 ambientClor[]) -{ - bool result; - - - // Set the shader parameters that it will use for rendering. - result = SetShaderParameters(deviceContext, worldMatrix, viewMatrix, projectionMatrix, texture, diffuseColor, lightPosition, ambientClor); - if(!result) - { - Logger::Get().Log("Failed to set shader parameters", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - // Now render the prepared buffers with the shader. - RenderShader(deviceContext, indexCount); - - return true; -} - - -bool LightShaderClass::InitializeShader(ID3D11Device* device, HWND hwnd, WCHAR* vsFilename, WCHAR* psFilename) -{ - Logger::Get().Log("Initializing shader", __FILE__, __LINE__, Logger::LogLevel::Initialize); - - HRESULT result; - ID3D10Blob* errorMessage; - ID3D10Blob* vertexShaderBuffer; - ID3D10Blob* pixelShaderBuffer; - D3D11_INPUT_ELEMENT_DESC polygonLayout[3]; - unsigned int numElements; - D3D11_SAMPLER_DESC samplerDesc; - D3D11_BUFFER_DESC matrixBufferDesc; - D3D11_BUFFER_DESC cameraBufferDesc; - D3D11_BUFFER_DESC lightColorBufferDesc; - D3D11_BUFFER_DESC lightPositionBufferDesc; - - - // Initialize the pointers this function will use to null. - errorMessage = 0; - vertexShaderBuffer = 0; - pixelShaderBuffer = 0; - - // Compile the vertex shader code. - result = D3DCompileFromFile(vsFilename, NULL, NULL, "LightVertexShader", "vs_5_0", D3D10_SHADER_ENABLE_STRICTNESS, 0, &vertexShaderBuffer, &errorMessage); - if (FAILED(result)) - { - // If the shader failed to compile it should have writen something to the error message. - if (errorMessage) - { - OutputShaderErrorMessage(errorMessage, hwnd, vsFilename); - } - // If there was nothing in the error message then it simply could not find the shader file itself. - else - { - Logger::Get().Log("Failed to compile shader", __FILE__, __LINE__, Logger::LogLevel::Error); - } - - return false; - } - - // Compile the pixel shader code. - result = D3DCompileFromFile(psFilename, NULL, NULL, "LightPixelShader", "ps_5_0", D3D10_SHADER_ENABLE_STRICTNESS, 0, &pixelShaderBuffer, &errorMessage); - if (FAILED(result)) - { - // If the shader failed to compile it should have writen something to the error message. - if (errorMessage) - { - OutputShaderErrorMessage(errorMessage, hwnd, psFilename); - } - // If there was nothing in the error message then it simply could not find the file itself. - else - { - Logger::Get().Log("Failed to compile shader", __FILE__, __LINE__, Logger::LogLevel::Error); - } - - return false; - } - - // Create the vertex shader from the buffer. - result = device->CreateVertexShader(vertexShaderBuffer->GetBufferPointer(), vertexShaderBuffer->GetBufferSize(), NULL, &m_vertexShader); - if (FAILED(result)) - { - Logger::Get().Log("Failed to create vertex shader", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - // Create the pixel shader from the buffer. - result = device->CreatePixelShader(pixelShaderBuffer->GetBufferPointer(), pixelShaderBuffer->GetBufferSize(), NULL, &m_pixelShader); - if (FAILED(result)) - { - Logger::Get().Log("Failed to create pixel shader", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - // Create the vertex input layout description. - // This setup needs to match the VertexType stucture in the ModelClass and in the shader. - polygonLayout[0].SemanticName = "POSITION"; - polygonLayout[0].SemanticIndex = 0; - polygonLayout[0].Format = DXGI_FORMAT_R32G32B32_FLOAT; - polygonLayout[0].InputSlot = 0; - polygonLayout[0].AlignedByteOffset = 0; - polygonLayout[0].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA; - polygonLayout[0].InstanceDataStepRate = 0; - - polygonLayout[1].SemanticName = "TEXCOORD"; - polygonLayout[1].SemanticIndex = 0; - polygonLayout[1].Format = DXGI_FORMAT_R32G32_FLOAT; - polygonLayout[1].InputSlot = 0; - polygonLayout[1].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT; - polygonLayout[1].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA; - polygonLayout[1].InstanceDataStepRate = 0; - - polygonLayout[2].SemanticName = "NORMAL"; - polygonLayout[2].SemanticIndex = 0; - polygonLayout[2].Format = DXGI_FORMAT_R32G32B32_FLOAT; - polygonLayout[2].InputSlot = 0; - polygonLayout[2].AlignedByteOffset = D3D11_APPEND_ALIGNED_ELEMENT; - polygonLayout[2].InputSlotClass = D3D11_INPUT_PER_VERTEX_DATA; - polygonLayout[2].InstanceDataStepRate = 0; - - // Get a count of the elements in the layout. - numElements = sizeof(polygonLayout) / sizeof(polygonLayout[0]); - - // Create the vertex input layout. - result = device->CreateInputLayout(polygonLayout, numElements, vertexShaderBuffer->GetBufferPointer(), vertexShaderBuffer->GetBufferSize(), - &m_layout); - if (FAILED(result)) - { - Logger::Get().Log("Failed to create input layout", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - // Release the vertex shader buffer and pixel shader buffer since they are no longer needed. - vertexShaderBuffer->Release(); - vertexShaderBuffer = 0; - - pixelShaderBuffer->Release(); - pixelShaderBuffer = 0; - - // Create a texture sampler state description. - samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; - samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP; - samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP; - samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP; - samplerDesc.MipLODBias = 0.0f; - samplerDesc.MaxAnisotropy = 1; - samplerDesc.ComparisonFunc = D3D11_COMPARISON_ALWAYS; - samplerDesc.BorderColor[0] = 0; - samplerDesc.BorderColor[1] = 0; - samplerDesc.BorderColor[2] = 0; - samplerDesc.BorderColor[3] = 0; - samplerDesc.MinLOD = 0; - samplerDesc.MaxLOD = D3D11_FLOAT32_MAX; - - // Create the texture sampler state. - result = device->CreateSamplerState(&samplerDesc, &m_sampleState); - if (FAILED(result)) - { - Logger::Get().Log("Failed to create sampler state", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - // Setup the description of the dynamic matrix constant buffer that is in the vertex shader. - matrixBufferDesc.Usage = D3D11_USAGE_DYNAMIC; - matrixBufferDesc.ByteWidth = sizeof(MatrixBufferType); - matrixBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; - matrixBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - matrixBufferDesc.MiscFlags = 0; - matrixBufferDesc.StructureByteStride = 0; - - // Create the constant buffer pointer so we can access the vertex shader constant buffer from within this class. - result = device->CreateBuffer(&matrixBufferDesc, NULL, &m_matrixBuffer); - if (FAILED(result)) - { - Logger::Get().Log("Failed to create matrix buffer", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - - - // Setup the description of the camera dynamic constant buffer that is in the vertex shader. - cameraBufferDesc.Usage = D3D11_USAGE_DYNAMIC; - cameraBufferDesc.ByteWidth = sizeof(CameraBufferType); - cameraBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; - cameraBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - cameraBufferDesc.MiscFlags = 0; - cameraBufferDesc.StructureByteStride = 0; - - // Create the camera constant buffer pointer so we can access the vertex shader constant buffer from within this class. - result = device->CreateBuffer(&cameraBufferDesc, NULL, &m_cameraBuffer); - if (FAILED(result)) - { - Logger::Get().Log("Failed to create camera buffer", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - // Setup the description of the dynamic constant buffer that is in the pixel shader. - lightColorBufferDesc.Usage = D3D11_USAGE_DYNAMIC; - lightColorBufferDesc.ByteWidth = sizeof(LightColorBufferType); - lightColorBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; - lightColorBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - lightColorBufferDesc.MiscFlags = 0; - lightColorBufferDesc.StructureByteStride = 0; - - // Create the constant buffer pointer so we can access the pixel shader constant buffer from within this class. - result = device->CreateBuffer(&lightColorBufferDesc, NULL, &m_lightColorBuffer); - if (FAILED(result)) - { - Logger::Get().Log("Failed to create light color buffer", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - // Setup the description of the dynamic constant buffer that is in the vertex shader. - lightPositionBufferDesc.Usage = D3D11_USAGE_DYNAMIC; - lightPositionBufferDesc.ByteWidth = sizeof(LightPositionBufferType); - lightPositionBufferDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; - lightPositionBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - lightPositionBufferDesc.MiscFlags = 0; - lightPositionBufferDesc.StructureByteStride = 0; - - // Create the constant buffer pointer so we can access the vertex shader constant buffer from within this class. - result = device->CreateBuffer(&lightPositionBufferDesc, NULL, &m_lightPositionBuffer); - if (FAILED(result)) - { - Logger::Get().Log("Failed to create light position buffer", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - Logger::Get().Log("Shader initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize); - - return true; -} - - -void LightShaderClass::ShutdownShader() -{ - Logger::Get().Log("Shutting down LightShaderClass", __FILE__, __LINE__, Logger::LogLevel::Shutdown); - - // Release the light constant buffers. - if (m_lightColorBuffer) - { - m_lightColorBuffer->Release(); - m_lightColorBuffer = 0; - } - - if (m_lightPositionBuffer) - { - m_lightPositionBuffer->Release(); - m_lightPositionBuffer = 0; - } - - // Release the light constant buffer. - if (m_lightBuffer) - { - m_lightBuffer->Release(); - m_lightBuffer = 0; - } - - // Release the camera constant buffer. - if (m_cameraBuffer) - { - m_cameraBuffer->Release(); - m_cameraBuffer = 0; - } - - // Release the matrix constant buffer. - if (m_matrixBuffer) - { - m_matrixBuffer->Release(); - m_matrixBuffer = 0; - } - - // Release the sampler state. - if (m_sampleState) - { - m_sampleState->Release(); - m_sampleState = 0; - } - - // Release the layout. - if (m_layout) - { - m_layout->Release(); - m_layout = 0; - } - - // Release the pixel shader. - if (m_pixelShader) - { - m_pixelShader->Release(); - m_pixelShader = 0; - } - - // Release the vertex shader. - if (m_vertexShader) - { - m_vertexShader->Release(); - m_vertexShader = 0; - } - - Logger::Get().Log("LightShaderClass shut down", __FILE__, __LINE__, Logger::LogLevel::Shutdown); - - return; -} - - -void LightShaderClass::OutputShaderErrorMessage(ID3D10Blob* errorMessage, HWND hwnd, WCHAR* shaderFilename) -{ - char* compileErrors; - unsigned __int64 bufferSize, i; - ofstream fout; - - - // Get a pointer to the error message text buffer. - compileErrors = (char*)(errorMessage->GetBufferPointer()); - - // Get the length of the message. - bufferSize = errorMessage->GetBufferSize(); - - // Open a file to write the error message to. - fout.open("shader-error.txt"); - - // Write out the error message. - for (i = 0; i < bufferSize; i++) - { - fout << compileErrors[i]; - } - - // Close the file. - fout.close(); - - // Release the error message. - errorMessage->Release(); - errorMessage = 0; - - // Pop a message up on the screen to notify the user to check the text file for compile errors. - MessageBox(hwnd, L"Error compiling shader. Check shader-error.txt for message.", shaderFilename, MB_OK); - - return; -} - - -bool LightShaderClass::SetShaderParameters(ID3D11DeviceContext* deviceContext, XMMATRIX worldMatrix, XMMATRIX viewMatrix, XMMATRIX projectionMatrix, - ID3D11ShaderResourceView* texture, XMFLOAT4 diffuseColor[], XMFLOAT4 lightPosition[], XMFLOAT4 ambientColor[]) -{ - HRESULT result; - D3D11_MAPPED_SUBRESOURCE mappedResource; - unsigned int bufferNumber; - MatrixBufferType* dataPtr; - LightPositionBufferType* dataPtr2; - LightColorBufferType* dataPtr3; - - // Transpose the matrices to prepare them for the shader. - worldMatrix = XMMatrixTranspose(worldMatrix); - viewMatrix = XMMatrixTranspose(viewMatrix); - projectionMatrix = XMMatrixTranspose(projectionMatrix); - - // Lock the constant buffer so it can be written to. - result = deviceContext->Map(m_matrixBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource); - if (FAILED(result)) - { - Logger::Get().Log("Failed to map matrix buffer", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - // Get a pointer to the data in the constant buffer. - dataPtr = (MatrixBufferType*)mappedResource.pData; - - // Copy the matrices into the constant buffer. - dataPtr->world = worldMatrix; - dataPtr->view = viewMatrix; - dataPtr->projection = projectionMatrix; - - // Unlock the constant buffer. - deviceContext->Unmap(m_matrixBuffer, 0); - - // Set the position of the constant buffer in the vertex shader. - bufferNumber = 0; - - // Now set the constant buffer in the vertex shader with the updated values. - deviceContext->VSSetConstantBuffers(bufferNumber, 1, &m_matrixBuffer); - - // Lock the camera constant buffer so it can be written to. - result = deviceContext->Map(m_cameraBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource); - if (FAILED(result)) - { - Logger::Get().Log("Failed to map camera buffer", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - // Lock the light position constant buffer so it can be written to. - result = deviceContext->Map(m_lightPositionBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource); - if (FAILED(result)) - { - Logger::Get().Log("Failed to map light position buffer", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - // Get a pointer to the data in the constant buffer. - dataPtr2 = (LightPositionBufferType*)mappedResource.pData; - - // Copy the light position variables into the constant buffer. - for (int i = 0; i < NUM_LIGHTS; i++) - { - dataPtr2->lightPosition[i] = lightPosition[i]; - } - - // Unlock the constant buffer. - deviceContext->Unmap(m_lightPositionBuffer, 0); - - // Set the position of the constant buffer in the vertex shader. - bufferNumber = 1; - - // Finally set the constant buffer in the vertex shader with the updated values. - deviceContext->VSSetConstantBuffers(bufferNumber, 1, &m_lightPositionBuffer); - - // Set shader texture resource in the pixel shader. - deviceContext->PSSetShaderResources(0, 1, &texture); - - // Lock the light color constant buffer so it can be written to. - result = deviceContext->Map(m_lightColorBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource); - if (FAILED(result)) - { - Logger::Get().Log("Failed to map light color buffer", __FILE__, __LINE__, Logger::LogLevel::Error); - return false; - } - - // Get a pointer to the data in the constant buffer. - dataPtr3 = (LightColorBufferType*)mappedResource.pData; - - // Copy the light color variables into the constant buffer. - for (int i = 0; i < NUM_LIGHTS; i++) - { - dataPtr3->diffuseColor[i] = diffuseColor[i]; - } - - // Unlock the constant buffer. - deviceContext->Unmap(m_lightColorBuffer, 0); - - // Set the position of the constant buffer in the pixel shader. - bufferNumber = 0; - - // Finally set the constant buffer in the pixel shader with the updated values. - deviceContext->PSSetConstantBuffers(bufferNumber, 1, &m_lightColorBuffer); - - - return true; -} - - -void LightShaderClass::RenderShader(ID3D11DeviceContext* deviceContext, int indexCount) -{ - // Set the vertex input layout. - deviceContext->IASetInputLayout(m_layout); - - // Set the vertex and pixel shaders that will be used to render this triangle. - deviceContext->VSSetShader(m_vertexShader, NULL, 0); - deviceContext->PSSetShader(m_pixelShader, NULL, 0); - - // Set the sampler state in the pixel shader. - deviceContext->PSSetSamplers(0, 1, &m_sampleState); - - // Render the triangle. - deviceContext->DrawIndexed(indexCount, 0, 0); - - return; -} diff --git a/enginecustom/Lightshaderclass.h b/enginecustom/Lightshaderclass.h deleted file mode 100644 index bd072db..0000000 --- a/enginecustom/Lightshaderclass.h +++ /dev/null @@ -1,92 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// Filename: lightshaderclass.h -//////////////////////////////////////////////////////////////////////////////// -#ifndef _LIGHTSHADERCLASS_H_ -#define _LIGHTSHADERCLASS_H_ -#pragma once - -///////////// -// GLOBALS // -///////////// -const int NUM_LIGHTS = 4; -////////////// -// INCLUDES // -////////////// -#include "Logger.h" -#include -#include -#include -#include -using namespace DirectX; -using namespace std; - - -//////////////////////////////////////////////////////////////////////////////// -// Class name: LightShaderClass -//////////////////////////////////////////////////////////////////////////////// -class LightShaderClass -{ -private: - struct MatrixBufferType - { - XMMATRIX world; - XMMATRIX view; - XMMATRIX projection; - }; - - struct CameraBufferType - { - XMFLOAT3 cameraPosition; - float padding; - }; - - struct LightBufferType - { - XMFLOAT4 ambientColor; - XMFLOAT4 diffuseColor; - XMFLOAT3 lightDirection; - float padding; // Added extra padding so structure is a multiple of 16 for CreateBuffer function requirements. - float specularPower; - XMFLOAT4 specularColor; - }; - - struct LightColorBufferType - { - XMFLOAT4 diffuseColor[NUM_LIGHTS]; - }; - - struct LightPositionBufferType - { - XMFLOAT4 lightPosition[NUM_LIGHTS]; - }; - -public: - LightShaderClass(); - LightShaderClass(const LightShaderClass&); - ~LightShaderClass(); - - bool Initialize(ID3D11Device*, HWND); - void Shutdown(); - bool Render(ID3D11DeviceContext*, int, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[]); - -private: - bool InitializeShader(ID3D11Device*, HWND, WCHAR*, WCHAR*); - void ShutdownShader(); - void OutputShaderErrorMessage(ID3D10Blob*, HWND, WCHAR*); - - bool SetShaderParameters(ID3D11DeviceContext*, XMMATRIX, XMMATRIX, XMMATRIX, ID3D11ShaderResourceView*, XMFLOAT4[], XMFLOAT4[], XMFLOAT4[]); - void RenderShader(ID3D11DeviceContext*, int); - -private: - ID3D11VertexShader* m_vertexShader; - ID3D11PixelShader* m_pixelShader; - ID3D11InputLayout* m_layout; - ID3D11SamplerState* m_sampleState; - ID3D11Buffer* m_matrixBuffer; - ID3D11Buffer* m_cameraBuffer; - ID3D11Buffer* m_lightBuffer; - ID3D11Buffer* m_lightColorBuffer; - ID3D11Buffer* m_lightPositionBuffer; -}; - -#endif \ No newline at end of file diff --git a/enginecustom/enginecustom.vcxproj b/enginecustom/enginecustom.vcxproj index c805cfc..81071a5 100644 --- a/enginecustom/enginecustom.vcxproj +++ b/enginecustom/enginecustom.vcxproj @@ -19,69 +19,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - @@ -90,146 +81,182 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - + Document + $(OutDir)\src\hlsl - - - - Pixel - Pixel - Pixel - Pixel + Document + $(OutDir)\src\hlsl - - Vertex - Vertex - Vertex - Vertex + Document + $(OutDir)\src\hlsl + + + Document + $(OutDir)\src\hlsl + + + Document + $(OutDir)\src\hlsl @@ -349,16 +376,6 @@ - - - Designer - Document - - - Designer - Document - - @@ -524,7 +541,7 @@ true _DEBUG;_WINDOWS;%(PreprocessorDefinitions) true - $(SolutionDir)enginecustom\include\backends;$(SolutionDir)enginecustom\include\Inc;$(SolutionDir)enginecustom\include;%(AdditionalIncludeDirectories) + $(SolutionDir)enginecustom\include\backends;$(SolutionDir)enginecustom\include\Inc;$(SolutionDir)enginecustom\include;$(SolutionDir)enginecustom\src\inc\shader;$(SolutionDir)enginecustom\src\inc\system;%(AdditionalIncludeDirectories) stdcpp17 @@ -541,7 +558,7 @@ NDEBUG;_WINDOWS;%(PreprocessorDefinitions) true stdcpp17 - $(SolutionDir)enginecustom\include\backends;$(SolutionDir)enginecustom\include\Inc;$(SolutionDir)enginecustom\include;%(AdditionalIncludeDirectories) + $(SolutionDir)enginecustom\include\backends;$(SolutionDir)enginecustom\include\Inc;$(SolutionDir)enginecustom\include;$(SolutionDir)enginecustom\src\inc\shader;$(SolutionDir)enginecustom\src\inc\system;%(AdditionalIncludeDirectories) Windows diff --git a/enginecustom/enginecustom.vcxproj.filters b/enginecustom/enginecustom.vcxproj.filters index b2cde4c..31fe97e 100644 --- a/enginecustom/enginecustom.vcxproj.filters +++ b/enginecustom/enginecustom.vcxproj.filters @@ -52,9 +52,6 @@ {e087647e-a306-4246-9320-bab0830bb634} - - {14b07251-cf6d-4391-9fca-ec94e08d4427} - {3c669b93-a9fd-4b74-813f-f9780413f76b} @@ -64,11 +61,11 @@ {4bfa47c6-e23c-4cae-a7af-3fc870a448e4} + + {567548ae-97a4-413e-8d44-86d6e8252487} + - - Fichiers sources - Fichiers sources\ImGui @@ -87,33 +84,6 @@ Fichiers sources\ImGui - - Fichiers sources - - - Fichiers sources - - - Fichiers sources - - - Fichiers sources - - - Fichiers sources - - - Fichiers sources - - - Fichiers sources - - - Fichiers sources - - - Fichiers sources - Fichiers sources\DirectX Tool Kit @@ -129,107 +99,131 @@ Fichiers sources\DirectX Tool Kit - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\Shader - + Fichiers sources\System - + Fichiers sources\System - + Fichiers sources\System - + Fichiers sources\System - + Fichiers sources\System - + Fichiers sources\System - + Fichiers sources\System - + Fichiers sources\System - + Fichiers sources\System - + Fichiers sources\System - + Fichiers sources\System - + Fichiers sources\System - + Fichiers sources\System - + Fichiers sources\System - + Fichiers sources\System - + + Fichiers sources\System + + + Fichiers sources\System + + + Fichiers sources\System + + + Fichiers sources\System + + + Fichiers sources\System + + + Fichiers sources\System + + + Fichiers sources\System + + + Fichiers sources\System + + + Fichiers sources\System + + Fichiers sources\Shader - - Fichiers d%27en-tête - Fichiers d%27en-tête\ImGui @@ -254,33 +248,6 @@ Fichiers d%27en-tête\ImGui - - Fichiers d%27en-tête - - - Fichiers d%27en-tête - - - Fichiers d%27en-tête - - - Fichiers d%27en-tête - - - Fichiers d%27en-tête - - - Fichiers d%27en-tête - - - Fichiers d%27en-tête - - - Fichiers d%27en-tête - - - Fichiers d%27en-tête - Fichiers d%27en-tête\DirectX Tool Kit @@ -296,104 +263,131 @@ Fichiers d%27en-tête\DirectX Tool Kit - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + Fichiers d%27en-tête\Shader - + + Fichiers d%27en-tête\Shader + + + Fichiers d%27en-tête\Shader + + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - + Fichiers d%27en-tête\System - - Fichiers d%27en-tête\Shader + + Fichiers d%27en-tête\System + + + Fichiers d%27en-tête\System + + + Fichiers d%27en-tête\System + + + Fichiers d%27en-tête\System + + + Fichiers d%27en-tête\System + + + Fichiers d%27en-tête\System + + + Fichiers d%27en-tête\System + + + Fichiers d%27en-tête\System @@ -401,111 +395,18 @@ Assets - - - Fichiers de ressources - - Fonts - - - Fonts - - - shader - - - shader - Fonts fonts - - shader - - - shader - - - shader - - - shader - - - shader - - - shader - - - shader - - - shader - - - shader - - - shader - - - Texture - - - Texture - - - Texture - - - Texture - - - Texture - - - Texture - - - Texture - - - Texture - - - Texture - - - Texture - - - shader - - - shader - - - shader - - - shader - - - shader - - - shader - Assets\Model\TXT @@ -650,11 +551,37 @@ Assets\Skybox - - shader - - - shader - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/enginecustom/imgui.ini b/enginecustom/imgui.ini index cc9454d..3903abd 100644 --- a/enginecustom/imgui.ini +++ b/enginecustom/imgui.ini @@ -44,8 +44,8 @@ Size=1584,861 Collapsed=0 [Window][Render Window] -Pos=300,27 -Size=878,826 +Pos=8,27 +Size=1170,826 Collapsed=0 DockId=0x00000002,0 diff --git a/enginecustom/Color.ps b/enginecustom/src/hlsl/Color.ps similarity index 100% rename from enginecustom/Color.ps rename to enginecustom/src/hlsl/Color.ps diff --git a/enginecustom/Color.vs b/enginecustom/src/hlsl/Color.vs similarity index 100% rename from enginecustom/Color.vs rename to enginecustom/src/hlsl/Color.vs diff --git a/enginecustom/Multitexture.ps b/enginecustom/src/hlsl/Multitexture.ps similarity index 100% rename from enginecustom/Multitexture.ps rename to enginecustom/src/hlsl/Multitexture.ps diff --git a/enginecustom/Multitexture.vs b/enginecustom/src/hlsl/Multitexture.vs similarity index 100% rename from enginecustom/Multitexture.vs rename to enginecustom/src/hlsl/Multitexture.vs diff --git a/enginecustom/alphamap.ps b/enginecustom/src/hlsl/alphamap.ps similarity index 100% rename from enginecustom/alphamap.ps rename to enginecustom/src/hlsl/alphamap.ps diff --git a/enginecustom/alphamap.vs b/enginecustom/src/hlsl/alphamap.vs similarity index 100% rename from enginecustom/alphamap.vs rename to enginecustom/src/hlsl/alphamap.vs diff --git a/enginecustom/celshading.ps b/enginecustom/src/hlsl/celshading.ps similarity index 100% rename from enginecustom/celshading.ps rename to enginecustom/src/hlsl/celshading.ps diff --git a/enginecustom/celshading.vs b/enginecustom/src/hlsl/celshading.vs similarity index 100% rename from enginecustom/celshading.vs rename to enginecustom/src/hlsl/celshading.vs diff --git a/enginecustom/font.ps b/enginecustom/src/hlsl/font.ps similarity index 100% rename from enginecustom/font.ps rename to enginecustom/src/hlsl/font.ps diff --git a/enginecustom/font.vs b/enginecustom/src/hlsl/font.vs similarity index 100% rename from enginecustom/font.vs rename to enginecustom/src/hlsl/font.vs diff --git a/enginecustom/light.ps b/enginecustom/src/hlsl/light.ps similarity index 100% rename from enginecustom/light.ps rename to enginecustom/src/hlsl/light.ps diff --git a/enginecustom/light.vs b/enginecustom/src/hlsl/light.vs similarity index 100% rename from enginecustom/light.vs rename to enginecustom/src/hlsl/light.vs diff --git a/enginecustom/lightmap.ps b/enginecustom/src/hlsl/lightmap.ps similarity index 100% rename from enginecustom/lightmap.ps rename to enginecustom/src/hlsl/lightmap.ps diff --git a/enginecustom/lightmap.vs b/enginecustom/src/hlsl/lightmap.vs similarity index 100% rename from enginecustom/lightmap.vs rename to enginecustom/src/hlsl/lightmap.vs diff --git a/enginecustom/normalmap.ps b/enginecustom/src/hlsl/normalmap.ps similarity index 100% rename from enginecustom/normalmap.ps rename to enginecustom/src/hlsl/normalmap.ps diff --git a/enginecustom/normalmap.vs b/enginecustom/src/hlsl/normalmap.vs similarity index 100% rename from enginecustom/normalmap.vs rename to enginecustom/src/hlsl/normalmap.vs diff --git a/enginecustom/reflection.ps b/enginecustom/src/hlsl/reflection.ps similarity index 100% rename from enginecustom/reflection.ps rename to enginecustom/src/hlsl/reflection.ps diff --git a/enginecustom/reflection.vs b/enginecustom/src/hlsl/reflection.vs similarity index 100% rename from enginecustom/reflection.vs rename to enginecustom/src/hlsl/reflection.vs diff --git a/enginecustom/refraction.ps b/enginecustom/src/hlsl/refraction.ps similarity index 100% rename from enginecustom/refraction.ps rename to enginecustom/src/hlsl/refraction.ps diff --git a/enginecustom/refraction.vs b/enginecustom/src/hlsl/refraction.vs similarity index 100% rename from enginecustom/refraction.vs rename to enginecustom/src/hlsl/refraction.vs diff --git a/enginecustom/specmap.ps b/enginecustom/src/hlsl/specmap.ps similarity index 100% rename from enginecustom/specmap.ps rename to enginecustom/src/hlsl/specmap.ps diff --git a/enginecustom/specmap.vs b/enginecustom/src/hlsl/specmap.vs similarity index 100% rename from enginecustom/specmap.vs rename to enginecustom/src/hlsl/specmap.vs diff --git a/enginecustom/sunlight.ps b/enginecustom/src/hlsl/sunlight.ps similarity index 100% rename from enginecustom/sunlight.ps rename to enginecustom/src/hlsl/sunlight.ps diff --git a/enginecustom/sunlight.vs b/enginecustom/src/hlsl/sunlight.vs similarity index 100% rename from enginecustom/sunlight.vs rename to enginecustom/src/hlsl/sunlight.vs diff --git a/enginecustom/texture.ps b/enginecustom/src/hlsl/texture.ps similarity index 100% rename from enginecustom/texture.ps rename to enginecustom/src/hlsl/texture.ps diff --git a/enginecustom/texture.vs b/enginecustom/src/hlsl/texture.vs similarity index 100% rename from enginecustom/texture.vs rename to enginecustom/src/hlsl/texture.vs diff --git a/enginecustom/translate.ps b/enginecustom/src/hlsl/translate.ps similarity index 100% rename from enginecustom/translate.ps rename to enginecustom/src/hlsl/translate.ps diff --git a/enginecustom/translate.vs b/enginecustom/src/hlsl/translate.vs similarity index 100% rename from enginecustom/translate.vs rename to enginecustom/src/hlsl/translate.vs diff --git a/enginecustom/transparent.ps b/enginecustom/src/hlsl/transparent.ps similarity index 100% rename from enginecustom/transparent.ps rename to enginecustom/src/hlsl/transparent.ps diff --git a/enginecustom/transparent.vs b/enginecustom/src/hlsl/transparent.vs similarity index 100% rename from enginecustom/transparent.vs rename to enginecustom/src/hlsl/transparent.vs diff --git a/enginecustom/water.ps b/enginecustom/src/hlsl/water.ps similarity index 100% rename from enginecustom/water.ps rename to enginecustom/src/hlsl/water.ps diff --git a/enginecustom/water.vs b/enginecustom/src/hlsl/water.vs similarity index 100% rename from enginecustom/water.vs rename to enginecustom/src/hlsl/water.vs diff --git a/enginecustom/CelShadingShader.h b/enginecustom/src/inc/shader/CelShadingShader.h similarity index 100% rename from enginecustom/CelShadingShader.h rename to enginecustom/src/inc/shader/CelShadingShader.h diff --git a/enginecustom/Colorshaderclass.h b/enginecustom/src/inc/shader/Colorshaderclass.h similarity index 100% rename from enginecustom/Colorshaderclass.h rename to enginecustom/src/inc/shader/Colorshaderclass.h diff --git a/enginecustom/Multitextureshaderclass.h b/enginecustom/src/inc/shader/Multitextureshaderclass.h similarity index 100% rename from enginecustom/Multitextureshaderclass.h rename to enginecustom/src/inc/shader/Multitextureshaderclass.h diff --git a/enginecustom/alphamapshaderclass.h b/enginecustom/src/inc/shader/alphamapshaderclass.h similarity index 100% rename from enginecustom/alphamapshaderclass.h rename to enginecustom/src/inc/shader/alphamapshaderclass.h diff --git a/enginecustom/fontshaderclass.h b/enginecustom/src/inc/shader/fontshaderclass.h similarity index 100% rename from enginecustom/fontshaderclass.h rename to enginecustom/src/inc/shader/fontshaderclass.h diff --git a/enginecustom/lightmapshaderclass.h b/enginecustom/src/inc/shader/lightmapshaderclass.h similarity index 100% rename from enginecustom/lightmapshaderclass.h rename to enginecustom/src/inc/shader/lightmapshaderclass.h diff --git a/enginecustom/lightshaderclass.h b/enginecustom/src/inc/shader/lightshaderclass.h similarity index 100% rename from enginecustom/lightshaderclass.h rename to enginecustom/src/inc/shader/lightshaderclass.h diff --git a/enginecustom/lightshaderwaterclass.h b/enginecustom/src/inc/shader/lightshaderwaterclass.h similarity index 100% rename from enginecustom/lightshaderwaterclass.h rename to enginecustom/src/inc/shader/lightshaderwaterclass.h diff --git a/enginecustom/normalmapshaderclass.h b/enginecustom/src/inc/shader/normalmapshaderclass.h similarity index 100% rename from enginecustom/normalmapshaderclass.h rename to enginecustom/src/inc/shader/normalmapshaderclass.h diff --git a/enginecustom/reflectionshaderclass.h b/enginecustom/src/inc/shader/reflectionshaderclass.h similarity index 100% rename from enginecustom/reflectionshaderclass.h rename to enginecustom/src/inc/shader/reflectionshaderclass.h diff --git a/enginecustom/refractionshaderclass.h b/enginecustom/src/inc/shader/refractionshaderclass.h similarity index 100% rename from enginecustom/refractionshaderclass.h rename to enginecustom/src/inc/shader/refractionshaderclass.h diff --git a/enginecustom/shadermanagerclass.h b/enginecustom/src/inc/shader/shadermanagerclass.h similarity index 100% rename from enginecustom/shadermanagerclass.h rename to enginecustom/src/inc/shader/shadermanagerclass.h diff --git a/enginecustom/specmapshaderclass.h b/enginecustom/src/inc/shader/specmapshaderclass.h similarity index 100% rename from enginecustom/specmapshaderclass.h rename to enginecustom/src/inc/shader/specmapshaderclass.h diff --git a/enginecustom/sunlightshaderclass.h b/enginecustom/src/inc/shader/sunlightshaderclass.h similarity index 100% rename from enginecustom/sunlightshaderclass.h rename to enginecustom/src/inc/shader/sunlightshaderclass.h diff --git a/enginecustom/textureshaderclass.h b/enginecustom/src/inc/shader/textureshaderclass.h similarity index 100% rename from enginecustom/textureshaderclass.h rename to enginecustom/src/inc/shader/textureshaderclass.h diff --git a/enginecustom/translateshaderclass.h b/enginecustom/src/inc/shader/translateshaderclass.h similarity index 100% rename from enginecustom/translateshaderclass.h rename to enginecustom/src/inc/shader/translateshaderclass.h diff --git a/enginecustom/transparentshaderclass.h b/enginecustom/src/inc/shader/transparentshaderclass.h similarity index 100% rename from enginecustom/transparentshaderclass.h rename to enginecustom/src/inc/shader/transparentshaderclass.h diff --git a/enginecustom/watershaderclass.h b/enginecustom/src/inc/shader/watershaderclass.h similarity index 100% rename from enginecustom/watershaderclass.h rename to enginecustom/src/inc/shader/watershaderclass.h diff --git a/enginecustom/Cameraclass.h b/enginecustom/src/inc/system/Cameraclass.h similarity index 100% rename from enginecustom/Cameraclass.h rename to enginecustom/src/inc/system/Cameraclass.h diff --git a/enginecustom/Logger.h b/enginecustom/src/inc/system/Logger.h similarity index 100% rename from enginecustom/Logger.h rename to enginecustom/src/inc/system/Logger.h diff --git a/enginecustom/Modellistclass.h b/enginecustom/src/inc/system/Modellistclass.h similarity index 100% rename from enginecustom/Modellistclass.h rename to enginecustom/src/inc/system/Modellistclass.h diff --git a/enginecustom/Positionclass.h b/enginecustom/src/inc/system/Positionclass.h similarity index 100% rename from enginecustom/Positionclass.h rename to enginecustom/src/inc/system/Positionclass.h diff --git a/enginecustom/Spriteclass.h b/enginecustom/src/inc/system/Spriteclass.h similarity index 100% rename from enginecustom/Spriteclass.h rename to enginecustom/src/inc/system/Spriteclass.h diff --git a/enginecustom/Timerclass.h b/enginecustom/src/inc/system/Timerclass.h similarity index 100% rename from enginecustom/Timerclass.h rename to enginecustom/src/inc/system/Timerclass.h diff --git a/enginecustom/applicationclass.h b/enginecustom/src/inc/system/applicationclass.h similarity index 100% rename from enginecustom/applicationclass.h rename to enginecustom/src/inc/system/applicationclass.h diff --git a/enginecustom/bitmapclass.h b/enginecustom/src/inc/system/bitmapclass.h similarity index 100% rename from enginecustom/bitmapclass.h rename to enginecustom/src/inc/system/bitmapclass.h diff --git a/enginecustom/d3dclass.h b/enginecustom/src/inc/system/d3dclass.h similarity index 100% rename from enginecustom/d3dclass.h rename to enginecustom/src/inc/system/d3dclass.h diff --git a/enginecustom/displayplaneclass.h b/enginecustom/src/inc/system/displayplaneclass.h similarity index 100% rename from enginecustom/displayplaneclass.h rename to enginecustom/src/inc/system/displayplaneclass.h diff --git a/enginecustom/fontclass.h b/enginecustom/src/inc/system/fontclass.h similarity index 100% rename from enginecustom/fontclass.h rename to enginecustom/src/inc/system/fontclass.h diff --git a/enginecustom/fpsclass.h b/enginecustom/src/inc/system/fpsclass.h similarity index 100% rename from enginecustom/fpsclass.h rename to enginecustom/src/inc/system/fpsclass.h diff --git a/enginecustom/frustum.h b/enginecustom/src/inc/system/frustum.h similarity index 100% rename from enginecustom/frustum.h rename to enginecustom/src/inc/system/frustum.h diff --git a/enginecustom/frustumclass.h b/enginecustom/src/inc/system/frustumclass.h similarity index 100% rename from enginecustom/frustumclass.h rename to enginecustom/src/inc/system/frustumclass.h diff --git a/enginecustom/imguiManager.h b/enginecustom/src/inc/system/imguiManager.h similarity index 100% rename from enginecustom/imguiManager.h rename to enginecustom/src/inc/system/imguiManager.h diff --git a/enginecustom/inputclass.h b/enginecustom/src/inc/system/inputclass.h similarity index 100% rename from enginecustom/inputclass.h rename to enginecustom/src/inc/system/inputclass.h diff --git a/enginecustom/lightclass.h b/enginecustom/src/inc/system/lightclass.h similarity index 100% rename from enginecustom/lightclass.h rename to enginecustom/src/inc/system/lightclass.h diff --git a/enginecustom/modelclass.h b/enginecustom/src/inc/system/modelclass.h similarity index 100% rename from enginecustom/modelclass.h rename to enginecustom/src/inc/system/modelclass.h diff --git a/enginecustom/object.h b/enginecustom/src/inc/system/object.h similarity index 100% rename from enginecustom/object.h rename to enginecustom/src/inc/system/object.h diff --git a/enginecustom/physics.h b/enginecustom/src/inc/system/physics.h similarity index 100% rename from enginecustom/physics.h rename to enginecustom/src/inc/system/physics.h diff --git a/enginecustom/rendertextureclass.h b/enginecustom/src/inc/system/rendertextureclass.h similarity index 100% rename from enginecustom/rendertextureclass.h rename to enginecustom/src/inc/system/rendertextureclass.h diff --git a/enginecustom/systemclass.h b/enginecustom/src/inc/system/systemclass.h similarity index 97% rename from enginecustom/systemclass.h rename to enginecustom/src/inc/system/systemclass.h index c3c40e2..6ad1879 100644 --- a/enginecustom/systemclass.h +++ b/enginecustom/src/inc/system/systemclass.h @@ -9,7 +9,7 @@ #include "applicationclass.h" #include "imguiManager.h" #include -#include "resources.h" +#include "../resources.h" #include class SystemClass diff --git a/enginecustom/textclass.h b/enginecustom/src/inc/system/textclass.h similarity index 100% rename from enginecustom/textclass.h rename to enginecustom/src/inc/system/textclass.h diff --git a/enginecustom/textureclass.h b/enginecustom/src/inc/system/textureclass.h similarity index 100% rename from enginecustom/textureclass.h rename to enginecustom/src/inc/system/textureclass.h diff --git a/enginecustom/CelShadingShader.cpp b/enginecustom/src/src/shader/CelShadingShader.cpp similarity index 99% rename from enginecustom/CelShadingShader.cpp rename to enginecustom/src/src/shader/CelShadingShader.cpp index ddc15e0..25f238f 100644 --- a/enginecustom/CelShadingShader.cpp +++ b/enginecustom/src/src/shader/CelShadingShader.cpp @@ -29,7 +29,7 @@ bool CelShadingShader::Initialize(ID3D11Device* device, HWND hwnd) int error; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"celshading.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/celshading.vs"); if (error != 0) { Logger::Get().Log("Failed to set the filename of the vertex shader", __FILE__, __LINE__); @@ -37,7 +37,7 @@ bool CelShadingShader::Initialize(ID3D11Device* device, HWND hwnd) } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"celshading.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/celshading.ps"); if (error != 0) { Logger::Get().Log("Failed to set the filename of the pixel shader", __FILE__, __LINE__); diff --git a/enginecustom/Colorshaderclass.cpp b/enginecustom/src/src/shader/Colorshaderclass.cpp similarity index 98% rename from enginecustom/Colorshaderclass.cpp rename to enginecustom/src/src/shader/Colorshaderclass.cpp index e62c100..2d5cfc9 100644 --- a/enginecustom/Colorshaderclass.cpp +++ b/enginecustom/src/src/shader/Colorshaderclass.cpp @@ -32,7 +32,7 @@ bool ColorShaderClass::Initialize(ID3D11Device* device, HWND hwnd) // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"../enginecustom/Color.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/Color.vs"); if (error != 0) { Logger::Get().Log("Error copying string", __FILE__, __LINE__, Logger::LogLevel::Error); @@ -40,7 +40,7 @@ bool ColorShaderClass::Initialize(ID3D11Device* device, HWND hwnd) } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"../enginecustom/Color.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/Color.ps"); if (error != 0) { Logger::Get().Log("Error copying string", __FILE__, __LINE__, Logger::LogLevel::Error); diff --git a/enginecustom/Multitextureshaderclass.cpp b/enginecustom/src/src/shader/Multitextureshaderclass.cpp similarity index 98% rename from enginecustom/Multitextureshaderclass.cpp rename to enginecustom/src/src/shader/Multitextureshaderclass.cpp index d37c616..82873b2 100644 --- a/enginecustom/Multitextureshaderclass.cpp +++ b/enginecustom/src/src/shader/Multitextureshaderclass.cpp @@ -34,7 +34,7 @@ bool MultiTextureShaderClass::Initialize(ID3D11Device* device, HWND hwnd) int error; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"multitexture.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/multitexture.vs"); if (error != 0) { Logger::Get().Log("Failed to set the filename of the vertex shader", __FILE__, __LINE__, Logger::LogLevel::Error); @@ -42,7 +42,7 @@ bool MultiTextureShaderClass::Initialize(ID3D11Device* device, HWND hwnd) } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"multitexture.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/multitexture.ps"); if (error != 0) { Logger::Get().Log("Failed to set the filename of the pixel shader", __FILE__, __LINE__, Logger::LogLevel::Error); diff --git a/enginecustom/alphamapshaderclass.cpp b/enginecustom/src/src/shader/alphamapshaderclass.cpp similarity index 99% rename from enginecustom/alphamapshaderclass.cpp rename to enginecustom/src/src/shader/alphamapshaderclass.cpp index cbf697a..6267a09 100644 --- a/enginecustom/alphamapshaderclass.cpp +++ b/enginecustom/src/src/shader/alphamapshaderclass.cpp @@ -31,7 +31,7 @@ bool AlphaMapShaderClass::Initialize(ID3D11Device* device, HWND hwnd) int error; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"alphamap.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/alphamap.vs"); if (error != 0) { Logger::Get().Log("Error copying string ", __FILE__, __LINE__, Logger::LogLevel::Error); @@ -39,7 +39,7 @@ bool AlphaMapShaderClass::Initialize(ID3D11Device* device, HWND hwnd) } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"alphamap.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/alphamap.ps"); if (error != 0) { Logger::Get().Log("Error copying string", __FILE__, __LINE__, Logger::LogLevel::Error); diff --git a/enginecustom/fontshaderclass.cpp b/enginecustom/src/src/shader/fontshaderclass.cpp similarity index 99% rename from enginecustom/fontshaderclass.cpp rename to enginecustom/src/src/shader/fontshaderclass.cpp index ab90dd1..e0fa051 100644 --- a/enginecustom/fontshaderclass.cpp +++ b/enginecustom/src/src/shader/fontshaderclass.cpp @@ -32,7 +32,7 @@ bool FontShaderClass::Initialize(ID3D11Device* device, HWND hwnd) int error; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"font.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/font.vs"); if (error != 0) { Logger::Get().Log("Error copying string", __FILE__, __LINE__, Logger::LogLevel::Error); @@ -40,7 +40,7 @@ bool FontShaderClass::Initialize(ID3D11Device* device, HWND hwnd) } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"font.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/font.ps"); if (error != 0) { Logger::Get().Log("Error copying string", __FILE__, __LINE__, Logger::LogLevel::Error); diff --git a/enginecustom/lightmapshaderclass.cpp b/enginecustom/src/src/shader/lightmapshaderclass.cpp similarity index 99% rename from enginecustom/lightmapshaderclass.cpp rename to enginecustom/src/src/shader/lightmapshaderclass.cpp index ffa16ba..e716ab3 100644 --- a/enginecustom/lightmapshaderclass.cpp +++ b/enginecustom/src/src/shader/lightmapshaderclass.cpp @@ -31,7 +31,7 @@ bool LightMapShaderClass::Initialize(ID3D11Device* device, HWND hwnd) int error; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"lightmap.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/lightmap.vs"); if (error != 0) { Logger::Get().Log("Error copying string", __FILE__, __LINE__, Logger::LogLevel::Error); @@ -39,7 +39,7 @@ bool LightMapShaderClass::Initialize(ID3D11Device* device, HWND hwnd) } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"lightmap.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/lightmap.ps"); if (error != 0) { Logger::Get().Log("Error copying string", __FILE__, __LINE__, Logger::LogLevel::Error); diff --git a/enginecustom/lightshaderclass.cpp b/enginecustom/src/src/shader/lightshaderclass.cpp similarity index 99% rename from enginecustom/lightshaderclass.cpp rename to enginecustom/src/src/shader/lightshaderclass.cpp index 6f76143..fb1135a 100644 --- a/enginecustom/lightshaderclass.cpp +++ b/enginecustom/src/src/shader/lightshaderclass.cpp @@ -38,7 +38,7 @@ bool LightShaderClass::Initialize(ID3D11Device* device, HWND hwnd) bool result; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"light.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/light.vs"); if (error != 0) { Logger::Get().Log("Failed to copy string", __FILE__, __LINE__, Logger::LogLevel::Error); @@ -46,7 +46,7 @@ bool LightShaderClass::Initialize(ID3D11Device* device, HWND hwnd) } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"light.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/light.ps"); if (error != 0) { Logger::Get().Log("Failed to copy string", __FILE__, __LINE__, Logger::LogLevel::Error); diff --git a/enginecustom/normalmapshaderclass.cpp b/enginecustom/src/src/shader/normalmapshaderclass.cpp similarity index 99% rename from enginecustom/normalmapshaderclass.cpp rename to enginecustom/src/src/shader/normalmapshaderclass.cpp index 58d491b..e7ce385 100644 --- a/enginecustom/normalmapshaderclass.cpp +++ b/enginecustom/src/src/shader/normalmapshaderclass.cpp @@ -32,7 +32,7 @@ bool NormalMapShaderClass::Initialize(ID3D11Device* device, HWND hwnd) int error; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"normalmap.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/normalmap.vs"); if (error != 0) { Logger::Get().Log("Failed to set the filename of the vertex shader", __FILE__, __LINE__); @@ -40,7 +40,7 @@ bool NormalMapShaderClass::Initialize(ID3D11Device* device, HWND hwnd) } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"normalmap.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/normalmap.ps"); if (error != 0) { Logger::Get().Log("Failed to set the filename of the pixel shader", __FILE__, __LINE__); diff --git a/enginecustom/reflectionshaderclass.cpp b/enginecustom/src/src/shader/reflectionshaderclass.cpp similarity index 99% rename from enginecustom/reflectionshaderclass.cpp rename to enginecustom/src/src/shader/reflectionshaderclass.cpp index 02a505d..8f51e43 100644 --- a/enginecustom/reflectionshaderclass.cpp +++ b/enginecustom/src/src/shader/reflectionshaderclass.cpp @@ -29,7 +29,7 @@ bool ReflectionShaderClass::Initialize(ID3D11Device* device, HWND hwnd) int error; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"../Engine/reflection.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/reflection.vs"); if (error != 0) { Logger::Get().Log("Error copying string", __FILE__, __LINE__, Logger::LogLevel::Error); @@ -37,7 +37,7 @@ bool ReflectionShaderClass::Initialize(ID3D11Device* device, HWND hwnd) } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"../Engine/reflection.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/reflection.ps"); if (error != 0) { Logger::Get().Log("Error copying string", __FILE__, __LINE__, Logger::LogLevel::Error); diff --git a/enginecustom/refractionshaderclass.cpp b/enginecustom/src/src/shader/refractionshaderclass.cpp similarity index 99% rename from enginecustom/refractionshaderclass.cpp rename to enginecustom/src/src/shader/refractionshaderclass.cpp index feeef3a..66dff24 100644 --- a/enginecustom/refractionshaderclass.cpp +++ b/enginecustom/src/src/shader/refractionshaderclass.cpp @@ -31,14 +31,14 @@ bool RefractionShaderClass::Initialize(ID3D11Device* device, HWND hwnd) int error; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"refraction.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/refraction.vs"); if (error != 0) { return false; } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"refraction.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/refraction.ps"); if (error != 0) { return false; diff --git a/enginecustom/shadermanagerclass.cpp b/enginecustom/src/src/shader/shadermanagerclass.cpp similarity index 100% rename from enginecustom/shadermanagerclass.cpp rename to enginecustom/src/src/shader/shadermanagerclass.cpp diff --git a/enginecustom/specmapshaderclass.cpp b/enginecustom/src/src/shader/specmapshaderclass.cpp similarity index 99% rename from enginecustom/specmapshaderclass.cpp rename to enginecustom/src/src/shader/specmapshaderclass.cpp index 0d1ff07..79579de 100644 --- a/enginecustom/specmapshaderclass.cpp +++ b/enginecustom/src/src/shader/specmapshaderclass.cpp @@ -31,14 +31,14 @@ bool SpecMapShaderClass::Initialize(ID3D11Device* device, HWND hwnd) int error; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"specmap.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/specmap.vs"); if (error != 0) { return false; } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"specmap.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/specmap.ps"); if (error != 0) { return false; diff --git a/enginecustom/sunlightshaderclass.cpp b/enginecustom/src/src/shader/sunlightshaderclass.cpp similarity index 99% rename from enginecustom/sunlightshaderclass.cpp rename to enginecustom/src/src/shader/sunlightshaderclass.cpp index 6ca20d7..11d7e70 100644 --- a/enginecustom/sunlightshaderclass.cpp +++ b/enginecustom/src/src/shader/sunlightshaderclass.cpp @@ -38,7 +38,7 @@ bool SunlightShaderClass::Initialize(ID3D11Device* device, HWND hwnd) bool result; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"sunlight.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/sunlight.vs"); if (error != 0) { Logger::Get().Log("Failed to copy string", __FILE__, __LINE__, Logger::LogLevel::Error); @@ -46,7 +46,7 @@ bool SunlightShaderClass::Initialize(ID3D11Device* device, HWND hwnd) } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"sunlight.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/sunlight.ps"); if (error != 0) { Logger::Get().Log("Failed to copy string", __FILE__, __LINE__, Logger::LogLevel::Error); diff --git a/enginecustom/textureshaderclass.cpp b/enginecustom/src/src/shader/textureshaderclass.cpp similarity index 98% rename from enginecustom/textureshaderclass.cpp rename to enginecustom/src/src/shader/textureshaderclass.cpp index a011ef9..dadc983 100644 --- a/enginecustom/textureshaderclass.cpp +++ b/enginecustom/src/src/shader/textureshaderclass.cpp @@ -30,7 +30,7 @@ bool TextureShaderClass::Initialize(ID3D11Device* device, HWND hwnd) wchar_t psFilename[128]; int error; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"texture.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/texture.vs"); if (error != 0) { Logger::Get().Log("Error copying stirng", __FILE__, __LINE__, Logger::LogLevel::Error); @@ -38,7 +38,7 @@ bool TextureShaderClass::Initialize(ID3D11Device* device, HWND hwnd) } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"texture.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/texture.ps"); if (error != 0) { Logger::Get().Log("Error copying stirng", __FILE__, __LINE__, Logger::LogLevel::Error); diff --git a/enginecustom/translateshaderclass.cpp b/enginecustom/src/src/shader/translateshaderclass.cpp similarity index 99% rename from enginecustom/translateshaderclass.cpp rename to enginecustom/src/src/shader/translateshaderclass.cpp index e427d55..9f2ea8b 100644 --- a/enginecustom/translateshaderclass.cpp +++ b/enginecustom/src/src/shader/translateshaderclass.cpp @@ -32,7 +32,7 @@ bool TranslateShaderClass::Initialize(ID3D11Device* device, HWND hwnd) int error; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"translate.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/translate.vs"); if (error != 0) { Logger::Get().Log("Failed to copy vsFilename", __FILE__, __LINE__, Logger::LogLevel::Error); @@ -40,7 +40,7 @@ bool TranslateShaderClass::Initialize(ID3D11Device* device, HWND hwnd) } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"translate.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/translate.ps"); if (error != 0) { Logger::Get().Log("Failed to copy psFilename", __FILE__, __LINE__, Logger::LogLevel::Error); diff --git a/enginecustom/transparentshaderclass.cpp b/enginecustom/src/src/shader/transparentshaderclass.cpp similarity index 99% rename from enginecustom/transparentshaderclass.cpp rename to enginecustom/src/src/shader/transparentshaderclass.cpp index 08e7f63..dfa280b 100644 --- a/enginecustom/transparentshaderclass.cpp +++ b/enginecustom/src/src/shader/transparentshaderclass.cpp @@ -32,7 +32,7 @@ bool TransparentShaderClass::Initialize(ID3D11Device* device, HWND hwnd) int error; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"transparent.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/transparent.vs"); if (error != 0) { Logger::Get().Log("Failed to copy vertex shader filename", __FILE__, __LINE__, Logger::LogLevel::Error); @@ -40,7 +40,7 @@ bool TransparentShaderClass::Initialize(ID3D11Device* device, HWND hwnd) } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"transparent.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/transparent.ps"); if (error != 0) { Logger::Get().Log("Failed to copy pixel shader filename", __FILE__, __LINE__, Logger::LogLevel::Error); diff --git a/enginecustom/watershaderclass.cpp b/enginecustom/src/src/shader/watershaderclass.cpp similarity index 99% rename from enginecustom/watershaderclass.cpp rename to enginecustom/src/src/shader/watershaderclass.cpp index 32b2a1d..8452f39 100644 --- a/enginecustom/watershaderclass.cpp +++ b/enginecustom/src/src/shader/watershaderclass.cpp @@ -31,14 +31,14 @@ bool WaterShaderClass::Initialize(ID3D11Device* device, HWND hwnd) int error; // Set the filename of the vertex shader. - error = wcscpy_s(vsFilename, 128, L"water.vs"); + error = wcscpy_s(vsFilename, 128, L"src/hlsl/water.vs"); if (error != 0) { return false; } // Set the filename of the pixel shader. - error = wcscpy_s(psFilename, 128, L"water.ps"); + error = wcscpy_s(psFilename, 128, L"src/hlsl/water.ps"); if (error != 0) { return false; diff --git a/enginecustom/Cameraclass.cpp b/enginecustom/src/src/system/Cameraclass.cpp similarity index 100% rename from enginecustom/Cameraclass.cpp rename to enginecustom/src/src/system/Cameraclass.cpp diff --git a/enginecustom/Main.cpp b/enginecustom/src/src/system/Main.cpp similarity index 100% rename from enginecustom/Main.cpp rename to enginecustom/src/src/system/Main.cpp diff --git a/enginecustom/Modellistclass.cpp b/enginecustom/src/src/system/Modellistclass.cpp similarity index 100% rename from enginecustom/Modellistclass.cpp rename to enginecustom/src/src/system/Modellistclass.cpp diff --git a/enginecustom/Positionclass.cpp b/enginecustom/src/src/system/Positionclass.cpp similarity index 100% rename from enginecustom/Positionclass.cpp rename to enginecustom/src/src/system/Positionclass.cpp diff --git a/enginecustom/Spriteclass.cpp b/enginecustom/src/src/system/Spriteclass.cpp similarity index 100% rename from enginecustom/Spriteclass.cpp rename to enginecustom/src/src/system/Spriteclass.cpp diff --git a/enginecustom/Systemclass.cpp b/enginecustom/src/src/system/Systemclass.cpp similarity index 100% rename from enginecustom/Systemclass.cpp rename to enginecustom/src/src/system/Systemclass.cpp diff --git a/enginecustom/Timerclass.cpp b/enginecustom/src/src/system/Timerclass.cpp similarity index 100% rename from enginecustom/Timerclass.cpp rename to enginecustom/src/src/system/Timerclass.cpp diff --git a/enginecustom/applicationclass.cpp b/enginecustom/src/src/system/applicationclass.cpp similarity index 100% rename from enginecustom/applicationclass.cpp rename to enginecustom/src/src/system/applicationclass.cpp diff --git a/enginecustom/bitmapclass.cpp b/enginecustom/src/src/system/bitmapclass.cpp similarity index 100% rename from enginecustom/bitmapclass.cpp rename to enginecustom/src/src/system/bitmapclass.cpp diff --git a/enginecustom/d3dclass.cpp b/enginecustom/src/src/system/d3dclass.cpp similarity index 100% rename from enginecustom/d3dclass.cpp rename to enginecustom/src/src/system/d3dclass.cpp diff --git a/enginecustom/displayplaneclass.cpp b/enginecustom/src/src/system/displayplaneclass.cpp similarity index 100% rename from enginecustom/displayplaneclass.cpp rename to enginecustom/src/src/system/displayplaneclass.cpp diff --git a/enginecustom/fontclass.cpp b/enginecustom/src/src/system/fontclass.cpp similarity index 100% rename from enginecustom/fontclass.cpp rename to enginecustom/src/src/system/fontclass.cpp diff --git a/enginecustom/fpsclass.cpp b/enginecustom/src/src/system/fpsclass.cpp similarity index 100% rename from enginecustom/fpsclass.cpp rename to enginecustom/src/src/system/fpsclass.cpp diff --git a/enginecustom/frustum.cpp b/enginecustom/src/src/system/frustum.cpp similarity index 100% rename from enginecustom/frustum.cpp rename to enginecustom/src/src/system/frustum.cpp diff --git a/enginecustom/frustumclass.cpp b/enginecustom/src/src/system/frustumclass.cpp similarity index 100% rename from enginecustom/frustumclass.cpp rename to enginecustom/src/src/system/frustumclass.cpp diff --git a/enginecustom/imguiManager.cpp b/enginecustom/src/src/system/imguiManager.cpp similarity index 100% rename from enginecustom/imguiManager.cpp rename to enginecustom/src/src/system/imguiManager.cpp diff --git a/enginecustom/inputclass.cpp b/enginecustom/src/src/system/inputclass.cpp similarity index 100% rename from enginecustom/inputclass.cpp rename to enginecustom/src/src/system/inputclass.cpp diff --git a/enginecustom/lightclass.cpp b/enginecustom/src/src/system/lightclass.cpp similarity index 100% rename from enginecustom/lightclass.cpp rename to enginecustom/src/src/system/lightclass.cpp diff --git a/enginecustom/modelclass.cpp b/enginecustom/src/src/system/modelclass.cpp similarity index 100% rename from enginecustom/modelclass.cpp rename to enginecustom/src/src/system/modelclass.cpp diff --git a/enginecustom/object.cpp b/enginecustom/src/src/system/object.cpp similarity index 100% rename from enginecustom/object.cpp rename to enginecustom/src/src/system/object.cpp diff --git a/enginecustom/physics.cpp b/enginecustom/src/src/system/physics.cpp similarity index 100% rename from enginecustom/physics.cpp rename to enginecustom/src/src/system/physics.cpp diff --git a/enginecustom/rendertextureclass.cpp b/enginecustom/src/src/system/rendertextureclass.cpp similarity index 100% rename from enginecustom/rendertextureclass.cpp rename to enginecustom/src/src/system/rendertextureclass.cpp diff --git a/enginecustom/textclass.cpp b/enginecustom/src/src/system/textclass.cpp similarity index 100% rename from enginecustom/textclass.cpp rename to enginecustom/src/src/system/textclass.cpp diff --git a/enginecustom/textureclass.cpp b/enginecustom/src/src/system/textureclass.cpp similarity index 100% rename from enginecustom/textureclass.cpp rename to enginecustom/src/src/system/textureclass.cpp