sus
This commit is contained in:
parent
3aafec5bf8
commit
8f20397130
24
.vscode/launch.json
vendored
Normal file
24
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "C/C++ Runner: Debug Session",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"externalConsole": true,
|
||||
"cwd": "c:/Users/arivas/Documents/GitHub/khaotic-engine-Reborn/enginecustom",
|
||||
"program": "c:/Users/arivas/Documents/GitHub/khaotic-engine-Reborn/enginecustom/build/Debug/outDebug",
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "gdb",
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
59
.vscode/settings.json
vendored
Normal file
59
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"C_Cpp_Runner.cCompilerPath": "gcc",
|
||||
"C_Cpp_Runner.cppCompilerPath": "g++",
|
||||
"C_Cpp_Runner.debuggerPath": "gdb",
|
||||
"C_Cpp_Runner.cStandard": "",
|
||||
"C_Cpp_Runner.cppStandard": "",
|
||||
"C_Cpp_Runner.msvcBatchPath": "C:/Program Files/Microsoft Visual Studio/VR_NR/Community/VC/Auxiliary/Build/vcvarsall.bat",
|
||||
"C_Cpp_Runner.useMsvc": false,
|
||||
"C_Cpp_Runner.warnings": [
|
||||
"-Wall",
|
||||
"-Wextra",
|
||||
"-Wpedantic",
|
||||
"-Wshadow",
|
||||
"-Wformat=2",
|
||||
"-Wcast-align",
|
||||
"-Wconversion",
|
||||
"-Wsign-conversion",
|
||||
"-Wnull-dereference"
|
||||
],
|
||||
"C_Cpp_Runner.msvcWarnings": [
|
||||
"/W4",
|
||||
"/permissive-",
|
||||
"/w14242",
|
||||
"/w14287",
|
||||
"/w14296",
|
||||
"/w14311",
|
||||
"/w14826",
|
||||
"/w44062",
|
||||
"/w44242",
|
||||
"/w14905",
|
||||
"/w14906",
|
||||
"/w14263",
|
||||
"/w44265",
|
||||
"/w14928"
|
||||
],
|
||||
"C_Cpp_Runner.enableWarnings": true,
|
||||
"C_Cpp_Runner.warningsAsError": false,
|
||||
"C_Cpp_Runner.compilerArgs": [],
|
||||
"C_Cpp_Runner.linkerArgs": [],
|
||||
"C_Cpp_Runner.includePaths": [],
|
||||
"C_Cpp_Runner.includeSearch": [
|
||||
"*",
|
||||
"**/*"
|
||||
],
|
||||
"C_Cpp_Runner.excludeSearch": [
|
||||
"**/build",
|
||||
"**/build/**",
|
||||
"**/.*",
|
||||
"**/.*/**",
|
||||
"**/.vscode",
|
||||
"**/.vscode/**"
|
||||
],
|
||||
"C_Cpp_Runner.useAddressSanitizer": false,
|
||||
"C_Cpp_Runner.useUndefinedSanitizer": false,
|
||||
"C_Cpp_Runner.useLeakSanitizer": false,
|
||||
"C_Cpp_Runner.showCompilationTime": false,
|
||||
"C_Cpp_Runner.useLinkTimeOptimization": false,
|
||||
"C_Cpp_Runner.msvcSecureNoWarnings": false
|
||||
}
|
@ -1127,7 +1127,17 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
object->Render(m_Direct3D->GetDeviceContext());
|
||||
|
||||
if (!m_enableCelShading) {
|
||||
result = m_ShaderManager->RenderlightShader(m_Direct3D->GetDeviceContext(), object->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, object->GetTexture(0),
|
||||
|
||||
// check if m_object is null or not
|
||||
if (object == nullptr) {
|
||||
|
||||
Logger::Get().Log("Object is null", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
ID3D11ShaderResourceView* ObjTexture = object->GetTexture(0);
|
||||
result = m_ShaderManager->RenderlightShader(m_Direct3D->GetDeviceContext(), object->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
|
||||
ObjTexture,
|
||||
diffuseColor, lightPosition, ambientColor);
|
||||
|
||||
if (!result)
|
||||
@ -1164,13 +1174,12 @@ bool ApplicationClass::Render(float rotation, float x, float y, float z, float t
|
||||
if (!m_enableCelShading) {
|
||||
if (chunk->GetTexture(0) == nullptr)
|
||||
{
|
||||
|
||||
Logger::Get().Log("Could not render the terrain model using the light shader, texture is null", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
result = m_ShaderManager->RenderSpecMapShader(m_Direct3D->GetDeviceContext(), chunk->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix,
|
||||
chunk->GetTexture(0), chunk->GetTexture(1), chunk->GetTexture(2), m_Lights[0]->GetDirection(), m_Lights[0]->GetDiffuseColor(),
|
||||
m_Camera->GetPosition(), m_Lights[0]->GetSpecularColor(), m_Lights[0]->GetSpecularPower());
|
||||
result = m_ShaderManager->RenderlightShader(m_Direct3D->GetDeviceContext(), chunk->GetIndexCount(), worldMatrix, viewMatrix, projectionMatrix, chunk->GetTexture(0), diffuseColor, lightPosition, ambientColor );
|
||||
|
||||
if (!result)
|
||||
{
|
||||
Logger::Get().Log("Could not render the terrain model using the light shader", __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
@ -1661,7 +1670,7 @@ void ApplicationClass::AddKobject(WCHAR* filepath)
|
||||
wcstombs_s(&convertedChars, modelFilename, sizeof(modelFilename), filepath, _TRUNCATE);
|
||||
|
||||
|
||||
/// Liste des fichiers de texture
|
||||
// Liste des fichiers de texture
|
||||
std::vector<std::wstring> kobjTexture = {
|
||||
L"assets/Texture/marble01.png"
|
||||
};
|
||||
@ -1674,8 +1683,19 @@ void ApplicationClass::AddKobject(WCHAR* filepath)
|
||||
result = DirectX::CreateWICTextureFromFile(m_Direct3D->GetDevice(), m_Direct3D->GetDeviceContext(), textureFilename.c_str(), nullptr, &texture);
|
||||
if (FAILED(result))
|
||||
{
|
||||
Logger::Get().Log("Failed to load texture: " + std::string(textureFilename.begin(), textureFilename.end()), __FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return;
|
||||
// Utiliser _com_error pour obtenir des informations détaillées sur l'erreur
|
||||
_com_error err(result);
|
||||
LPCTSTR errMsg = err.ErrorMessage();
|
||||
|
||||
//convertie errMessage en std::wstring
|
||||
std::wstring ws(errMsg);
|
||||
std::string str(ws.begin(), ws.end());
|
||||
|
||||
Logger::Get().Log("Failed to load texture: " + std::string(textureFilename.begin(), textureFilename.end()) +
|
||||
"\nError: " + std::to_string(result) +
|
||||
"\nDescription: " + str,
|
||||
__FILE__, __LINE__, Logger::LogLevel::Error);
|
||||
return; // Assurez-vous de retourner false ou de gérer l'erreur de manière appropriée
|
||||
}
|
||||
textures.push_back(texture);
|
||||
}
|
||||
|
@ -22,11 +22,6 @@
|
||||
<ClCompile Include="alphamapshaderclass.cpp" />
|
||||
<ClCompile Include="applicationclass.cpp" />
|
||||
<ClCompile Include="bitmapclass.cpp" />
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\DDSTextureLoader.cpp" />
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\DirectXHelpers.cpp" />
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\pch.cpp" />
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\SimpleMath.cpp" />
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\WICTextureLoader.cpp" />
|
||||
<ClCompile Include="Cameraclass.cpp" />
|
||||
<ClCompile Include="CelShadingShader.cpp" />
|
||||
<ClCompile Include="Colorshaderclass.cpp" />
|
||||
@ -44,6 +39,11 @@
|
||||
<ClCompile Include="fontshaderclass.cpp" />
|
||||
<ClCompile Include="fpsclass.cpp" />
|
||||
<ClCompile Include="frustumclass.cpp" />
|
||||
<ClCompile Include="include\Src\DDSTextureLoader.cpp" />
|
||||
<ClCompile Include="include\Src\DirectXHelpers.cpp" />
|
||||
<ClCompile Include="include\Src\pch.cpp" />
|
||||
<ClCompile Include="include\Src\SimpleMath.cpp" />
|
||||
<ClCompile Include="include\Src\WICTextureLoader.cpp" />
|
||||
<ClCompile Include="inputclass.cpp" />
|
||||
<ClCompile Include="Lightclass.cpp" />
|
||||
<ClCompile Include="lightmapshaderclass.cpp" />
|
||||
@ -75,11 +75,6 @@
|
||||
<ClInclude Include="alphamapshaderclass.h" />
|
||||
<ClInclude Include="applicationclass.h" />
|
||||
<ClInclude Include="bitmapclass.h" />
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\CMO.h" />
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\DDS.h" />
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\LoaderHelpers.h" />
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\pch.h" />
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\PlatformHelpers.h" />
|
||||
<ClInclude Include="Cameraclass.h" />
|
||||
<ClInclude Include="CelShadingShader.h" />
|
||||
<ClInclude Include="Colorshaderclass.h" />
|
||||
@ -98,6 +93,11 @@
|
||||
<ClInclude Include="fontshaderclass.h" />
|
||||
<ClInclude Include="fpsclass.h" />
|
||||
<ClInclude Include="frustumclass.h" />
|
||||
<ClInclude Include="include\Src\CMO.h" />
|
||||
<ClInclude Include="include\Src\DDS.h" />
|
||||
<ClInclude Include="include\Src\LoaderHelpers.h" />
|
||||
<ClInclude Include="include\Src\pch.h" />
|
||||
<ClInclude Include="include\Src\PlatformHelpers.h" />
|
||||
<ClInclude Include="inputclass.h" />
|
||||
<ClInclude Include="lightclass.h" />
|
||||
<ClInclude Include="lightmapshaderclass.h" />
|
||||
|
@ -192,19 +192,19 @@
|
||||
<ClCompile Include="CelShadingShader.cpp">
|
||||
<Filter>Fichiers sources</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\DDSTextureLoader.cpp">
|
||||
<ClCompile Include="include\Src\DDSTextureLoader.cpp">
|
||||
<Filter>Fichiers sources\DirectX Tool Kit</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\DirectXHelpers.cpp">
|
||||
<ClCompile Include="include\Src\DirectXHelpers.cpp">
|
||||
<Filter>Fichiers sources\DirectX Tool Kit</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\pch.cpp">
|
||||
<ClCompile Include="include\Src\pch.cpp">
|
||||
<Filter>Fichiers sources\DirectX Tool Kit</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\SimpleMath.cpp">
|
||||
<ClCompile Include="include\Src\SimpleMath.cpp">
|
||||
<Filter>Fichiers sources\DirectX Tool Kit</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\WICTextureLoader.cpp">
|
||||
<ClCompile Include="include\Src\WICTextureLoader.cpp">
|
||||
<Filter>Fichiers sources\DirectX Tool Kit</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
@ -356,19 +356,19 @@
|
||||
<ClInclude Include="CelShadingShader.h">
|
||||
<Filter>Fichiers d%27en-tête</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\PlatformHelpers.h">
|
||||
<ClInclude Include="include\Src\CMO.h">
|
||||
<Filter>Fichiers d%27en-tête\DirectX Tool Kit</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\pch.h">
|
||||
<ClInclude Include="include\Src\DDS.h">
|
||||
<Filter>Fichiers d%27en-tête\DirectX Tool Kit</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\LoaderHelpers.h">
|
||||
<ClInclude Include="include\Src\LoaderHelpers.h">
|
||||
<Filter>Fichiers d%27en-tête\DirectX Tool Kit</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\DDS.h">
|
||||
<ClInclude Include="include\Src\pch.h">
|
||||
<Filter>Fichiers d%27en-tête\DirectX Tool Kit</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="C:\Users\Bacon\Downloads\DirectXTK-main\DirectXTK-main\Src\CMO.h">
|
||||
<ClInclude Include="include\Src\PlatformHelpers.h">
|
||||
<Filter>Fichiers d%27en-tête\DirectX Tool Kit</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
|
@ -3,7 +3,7 @@ Pos=60,60
|
||||
Size=400,400
|
||||
|
||||
[Window][Khaotic Engine]
|
||||
Pos=1128,39
|
||||
Pos=1120,51
|
||||
Size=392,273
|
||||
|
||||
[Window][Objects]
|
||||
@ -19,6 +19,6 @@ Pos=1551,17
|
||||
Size=358,535
|
||||
|
||||
[Window][Shader Manager]
|
||||
Pos=34,253
|
||||
Pos=30,255
|
||||
Size=172,284
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user