diff --git a/Premake/premake5.exe b/Premake/premake5.exe index f081fe1f..1a637aa9 100644 Binary files a/Premake/premake5.exe and b/Premake/premake5.exe differ diff --git a/SHADE_Application/SHADE_Application.vcxproj b/SHADE_Application/SHADE_Application.vcxproj index 65a17de9..b3490a70 100644 --- a/SHADE_Application/SHADE_Application.vcxproj +++ b/SHADE_Application/SHADE_Application.vcxproj @@ -66,13 +66,11 @@ false MultiThreadedDebugDLL true - stdcpplatest + stdcpp20 Windows true - spdlogd.lib;%(AdditionalDependencies) - ..\Dependencies\spdlog\lib;%(AdditionalLibraryDirectories) wWinMainCRTStartup @@ -90,14 +88,12 @@ true MultiThreadedDLL true - stdcpplatest + stdcpp20 Windows true true - spdlog.lib;%(AdditionalDependencies) - ..\Dependencies\spdlog\lib;%(AdditionalLibraryDirectories) wWinMainCRTStartup diff --git a/SHADE_Application/premake5.lua b/SHADE_Application/premake5.lua index 0830a8e1..98e26a3e 100644 --- a/SHADE_Application/premake5.lua +++ b/SHADE_Application/premake5.lua @@ -1,7 +1,7 @@ project "SHADE_Application" kind "WindowedApp" language "C++" - cppdialect "C++latest" + cppdialect "C++20" targetdir (outputdir) objdir (interdir) systemversion "latest" @@ -47,18 +47,12 @@ project "SHADE_Application" "%{IncludeDir.SDL}/lib", } - postbuildcommands - { - } - warnings 'Extra' filter "configurations:Debug" symbols "On" defines {"_DEBUG"} - links{"spdlogd.lib"} filter "configurations:Release" optimize "On" defines{"_RELEASE"} - links{"spdlog.lib"} diff --git a/SHADE_Application/src/Application/SBApplication.cpp b/SHADE_Application/src/Application/SBApplication.cpp index 057e851c..2ce30a2f 100644 --- a/SHADE_Application/src/Application/SBApplication.cpp +++ b/SHADE_Application/src/Application/SBApplication.cpp @@ -7,6 +7,7 @@ #endif // SHEDITOR #include "Tools/SHLogger.h" +#include "Tools/SHFileUtilties.h" #include #include @@ -24,7 +25,9 @@ namespace Sandbox _In_ INT nCmdShow ) { - //SHLOG_TITLE("Initialising SBApplication") + // Set working directory + SHADE::SHFileUtilities::SetWorkDirToExecDir(); + SDL_Init(SDL_INIT_VIDEO); window.Create(hInstance, hPrevInstance, lpCmdLine, nCmdShow); SDL_CreateWindowFrom(window.GetHWND()); diff --git a/SHADE_Engine/SHADE_Engine.vcxproj b/SHADE_Engine/SHADE_Engine.vcxproj index 2fb0ebb4..7ccf0e8e 100644 --- a/SHADE_Engine/SHADE_Engine.vcxproj +++ b/SHADE_Engine/SHADE_Engine.vcxproj @@ -66,13 +66,13 @@ false MultiThreadedDebugDLL true - stdcpplatest + stdcpp20 Windows true - vulkan-1.lib;shaderc_shared.lib;assimp-vc142-mtd.lib;ktxd.lib;librttr_core_d.lib;%(AdditionalDependencies) - libs;$(VULKAN_SDK)\Lib;..\Dependencies\assimp\lib\Debug;..\Dependencies\assimp\lib\Release;..\Dependencies\RTTR\lib;..\Dependencies\ktx\lib\Debug;..\Dependencies\ktx\lib\Release;%(AdditionalLibraryDirectories) + vulkan-1.lib;shaderc_shared.lib;shlwapi.lib;assimp-vc142-mtd.lib;librttr_core_d.lib;spdlogd.lib;%(AdditionalDependencies) + libs;$(VULKAN_SDK)\Lib;..\Dependencies\assimp\lib\Debug;..\Dependencies\assimp\lib\Release;..\Dependencies\RTTR\lib;..\Dependencies\spdlog\lib;%(AdditionalLibraryDirectories) ..\bin\Debug\SHADE_Engine.lib @@ -93,14 +93,14 @@ true MultiThreadedDLL true - stdcpplatest + stdcpp20 Windows true true - vulkan-1.lib;shaderc_shared.lib;assimp-vc142-mt.lib;ktx.lib;librttr_core.lib;%(AdditionalDependencies) - libs;$(VULKAN_SDK)\Lib;..\Dependencies\assimp\lib\Debug;..\Dependencies\assimp\lib\Release;..\Dependencies\RTTR\lib;..\Dependencies\ktx\lib\Debug;..\Dependencies\ktx\lib\Release;%(AdditionalLibraryDirectories) + vulkan-1.lib;shaderc_shared.lib;shlwapi.lib;assimp-vc142-mt.lib;librttr_core.lib;spdlog.lib;%(AdditionalDependencies) + libs;$(VULKAN_SDK)\Lib;..\Dependencies\assimp\lib\Debug;..\Dependencies\assimp\lib\Release;..\Dependencies\RTTR\lib;..\Dependencies\spdlog\lib;%(AdditionalLibraryDirectories) ..\bin\Release\SHADE_Engine.lib @@ -180,7 +180,6 @@ - @@ -190,6 +189,7 @@ + @@ -197,6 +197,7 @@ + @@ -269,6 +270,7 @@ + diff --git a/SHADE_Engine/SHADE_Engine.vcxproj.filters b/SHADE_Engine/SHADE_Engine.vcxproj.filters index e92c1d2e..1bbdea43 100644 --- a/SHADE_Engine/SHADE_Engine.vcxproj.filters +++ b/SHADE_Engine/SHADE_Engine.vcxproj.filters @@ -360,6 +360,7 @@ Resource + @@ -377,13 +378,15 @@ Tools + + Tools + Tools Tools - @@ -582,6 +585,9 @@ Tools + + Tools + Tools diff --git a/SHADE_Engine/premake5.lua b/SHADE_Engine/premake5.lua index 12b526b1..a8f37057 100644 --- a/SHADE_Engine/premake5.lua +++ b/SHADE_Engine/premake5.lua @@ -1,7 +1,7 @@ project "SHADE_Engine" kind "SharedLib" language "C++" - cppdialect "C++latest" + cppdialect "C++20" targetdir (outputdir) objdir (interdir) systemversion "latest" @@ -46,6 +46,7 @@ project "SHADE_Engine" "%{IncludeDir.assimp}/lib/Release", "%{IncludeDir.RTTR}/lib", "%{IncludeDir.SDL}/lib", + "%{IncludeDir.spdlog}/lib" } links @@ -56,9 +57,10 @@ project "SHADE_Engine" "reactphysics3d", "imgui", "vulkan-1.lib", - "shaderc_shared.lib", "SDL2.lib", - "SDL2main.lib" + "SDL2main.lib", + "shaderc_shared.lib", + "shlwapi" } defines @@ -94,11 +96,11 @@ project "SHADE_Engine" filter "configurations:Debug" symbols "On" defines {"_DEBUG"} - links{"assimp-vc142-mtd.lib", "librttr_core_d.lib"} + links{"assimp-vc142-mtd.lib", "librttr_core_d.lib", "spdlogd.lib"} --links{"fmodstudioL_vc.lib", "fmodL_vc.lib"} filter "configurations:Release" optimize "On" defines{"_RELEASE"} - links{"assimp-vc142-mt.lib", "librttr_core.lib"} + links{"assimp-vc142-mt.lib", "librttr_core.lib", "spdlog.lib"} --links{"fmodstudio_vc.lib", "fmod_vc.lib"} \ No newline at end of file diff --git a/SHADE_Engine/src/SHCommonTypes.h b/SHADE_Engine/src/SHCommonTypes.h new file mode 100644 index 00000000..97ef7928 --- /dev/null +++ b/SHADE_Engine/src/SHCommonTypes.h @@ -0,0 +1,28 @@ +/************************************************************************************//*! +\file SHCommonTypes.h +\author Tng Kah Wei, kahwei.tng, 390009620 +\par email: kahwei.tng\@digipen.edu +\date Sep 8, 2022 +\brief Contains the definitions of type alias for commonly used units for + clarity and convenience. + + +Copyright (C) 2022 DigiPen Institute of Technology. +Reproduction or disclosure of this file or its contents without the prior written consent +of DigiPen Institute of Technology is prohibited. +*//*************************************************************************************/ +#pragma once + +namespace SHADE +{ + /*---------------------------------------------------------------------------------*/ + /* Type Definitions */ + /*---------------------------------------------------------------------------------*/ + /***********************************************************************************/ + /*! + \brief + Type used to mark a value that is supposed to represent a size in bytes. + */ + /***********************************************************************************/ + using Byte = size_t; +} diff --git a/SHADE_Engine/src/SHpch.h b/SHADE_Engine/src/SHpch.h index 0342eedb..1db73cb9 100644 --- a/SHADE_Engine/src/SHpch.h +++ b/SHADE_Engine/src/SHpch.h @@ -30,3 +30,5 @@ #include #include #include + +#include "SHCommonTypes.h" \ No newline at end of file diff --git a/SHADE_Engine/src/Tools/SHFileUtilties.cpp b/SHADE_Engine/src/Tools/SHFileUtilties.cpp new file mode 100644 index 00000000..0e75b16a --- /dev/null +++ b/SHADE_Engine/src/Tools/SHFileUtilties.cpp @@ -0,0 +1,30 @@ +/************************************************************************************//*! +\file SHFileUtilities.cpp +\author Tng Kah Wei, kahwei.tng, 390009620 +\par email: kahwei.tng\@digipen.edu +\date Sep 15, 2022 +\brief Contains the definition of functions of the SHFileUtilities static class. + +Copyright (C) 2022 DigiPen Institute of Technology. +Reproduction or disclosure of this file or its contents without the prior written consent +of DigiPen Institute of Technology is prohibited. +*//*************************************************************************************/ +// Precompiled Header +#include "SHpch.h" +// Primary Header +#include "SHFileUtilties.h" +// Standard Libraries +#include +// External Dependencies +#include // GetModuleFileName, PathRemoveFileSpec + +namespace SHADE +{ + void SHFileUtilities::SetWorkDirToExecDir() + { + TCHAR currentExecFilePath[MAX_PATH] = { '\0' }; + GetModuleFileName(nullptr, currentExecFilePath, MAX_PATH); + PathRemoveFileSpec(currentExecFilePath); + std::filesystem::current_path(currentExecFilePath); + } +} diff --git a/SHADE_Engine/src/Tools/SHFileUtilties.h b/SHADE_Engine/src/Tools/SHFileUtilties.h new file mode 100644 index 00000000..b9ba164b --- /dev/null +++ b/SHADE_Engine/src/Tools/SHFileUtilties.h @@ -0,0 +1,38 @@ +/************************************************************************************//*! +\file SHFileUtilities.h +\author Tng Kah Wei, kahwei.tng, 390009620 +\par email: kahwei.tng\@digipen.edu +\date Sep 15, 2022 +\brief Contains the SHFileUtilities static class. + +Copyright (C) 2022 DigiPen Institute of Technology. +Reproduction or disclosure of this file or its contents without the prior written consent +of DigiPen Institute of Technology is prohibited. +*//*************************************************************************************/ + +// Project Headers +#include "SH_API.h" + +namespace SHADE +{ + /*!************************************************************************************ + + \class SHFileUtilities + + \brief + Static class that contains functions for working with files and directories. + + **************************************************************************************/ + class SH_API SHFileUtilities + { + public: + /*!********************************************************************************** + + \brief + Sets the application's current working directory to the application executable's + directory. + + ************************************************************************************/ + static void SetWorkDirToExecDir(); + }; +}