diff --git a/Juliet/include/Core/Math/MathUtils.h b/Juliet/include/Core/Math/MathUtils.h index 426d145..5e60554 100644 --- a/Juliet/include/Core/Math/MathUtils.h +++ b/Juliet/include/Core/Math/MathUtils.h @@ -1,5 +1,8 @@ #pragma once +#include +#include + namespace Juliet { extern JULIET_API float RoundF(float value); diff --git a/JulietShaderCompiler/ShaderCompiler.cpp b/JulietShaderCompiler/ShaderCompiler.cpp index deebc05..3fd8aed 100644 --- a/JulietShaderCompiler/ShaderCompiler.cpp +++ b/JulietShaderCompiler/ShaderCompiler.cpp @@ -1,5 +1,6 @@ #include +#include #include #include #include diff --git a/JulietShaderCompiler/main.cpp b/JulietShaderCompiler/main.cpp index f12f954..ab53576 100644 --- a/JulietShaderCompiler/main.cpp +++ b/JulietShaderCompiler/main.cpp @@ -51,8 +51,8 @@ int main(int argc, char* argv[]) { IOClose(outStream); } - // Pause here to not close the console window immediately on stop - system("PAUSE"); + // Pause here to not close the console window immediately on stop while debugging + __asm int 3; }); for (int idx = 1; idx < argc; ++idx) @@ -221,9 +221,5 @@ int main(int argc, char* argv[]) case SourceLanguage::Invalid: Assert(false && "Source Language is invalid"); return 1; } - // - // IOPrintf(stream, ":)"); - // IOPrintf(stream, "%d%s", 1234, "Hello World!"); - return 0; } diff --git a/misc/recompile_shaders.bat b/misc/recompile_shaders.bat new file mode 100644 index 0000000..feb6c45 --- /dev/null +++ b/misc/recompile_shaders.bat @@ -0,0 +1,41 @@ +@echo off +setlocal enabledelayedexpansion + +set TARGET=x64\Debug + +REM Chemin relatif vers JulietShaderCompiler.exe +set COMPILER_PATH=..\bin\%TARGET%\JulietShaderCompiler.exe +echo Compiler Path: !COMPILER_PATH! + +REM Dossier source contenant les fichiers .frag.hlsl et .vert.hlsl +set SOURCE_DIR=..\Assets\source +echo Source Dir: !SOURCE_DIR! + +REM Dossier de sortie pour les fichiers compilés +set OUTPUT_DIR=..\Assets\compiled +echo Output Dir: !OUTPUT_DIR! + +REM Créer le dossier de sortie s'il n'existe pas +if not exist "%OUTPUT_DIR%" mkdir "%OUTPUT_DIR%" + +REM Parcourir tous les fichiers .frag.hlsl et .vert.hlsl dans le dossier source +for %%F in ("%SOURCE_DIR%\*.frag.hlsl" "%SOURCE_DIR%\*.vert.hlsl") do ( + REM Extraire le nom du fichier sans l'extension + set "FILENAME=%%~nF" + REM Extraire l'extension du fichier + set "EXTENSION=%%~xF" + REM Remplacer .frag.hlsl par frag et .vert.hlsl par vert + if "%%~xF"==".frag.hlsl" ( + set "SHORT_EXTENSION=frag" + ) else if "%%~xF"==".vert.hlsl" ( + set "SHORT_EXTENSION=vert" + ) + REM Construire la ligne de commande + set "COMMAND=%COMPILER_PATH% %SOURCE_DIR%\!FILENAME!!EXTENSION! -o %OUTPUT_DIR%\!FILENAME!!SHORT_EXTENSION!.dxil" + REM Afficher la ligne de commande pour le débogage + echo !COMMAND! + REM Appeler JulietShaderCompiler.exe avec les arguments spécifiés + !COMMAND! +) + +endlocal \ No newline at end of file