diff --git a/README.md b/README.md index 8b8f16f..6a5db7b 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,12 @@ Visual Studio files can be found in the `hellovulkan\build` directory. If you need to regenerate the Visual Studio files, open a command prompt in the `hellovulkan\premake` directory and run `..\..\premake\premake5.exe vs2015` (or `..\..\premake\premake5.exe vs2013` for Visual Studio 2013.) +`build_msvc.bat` allows to build project from `cmd`. +```cmd +> build_msvc.bat +> .\hellovulkan\bin\Main.exe +``` + Vulkan also supports Linux®, of course, and Premake can generate GNU Makefiles. However, at this time, the sample itself is Windows specific (because the helper code in Window.h/.cpp is Windows specific). Third-party software diff --git a/build_msvc.bat b/build_msvc.bat new file mode 100644 index 0000000..af9a29c --- /dev/null +++ b/build_msvc.bat @@ -0,0 +1,28 @@ +@echo off + +if not defined DevEnvDir ( + if "%VSWHERE%"=="" set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" +) +if not defined DevEnvDir ( + for /f "usebackq tokens=*" %%i in (`call "%VSWHERE%" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do ( + set InstallDir=%%i + ) +) +if not defined DevEnvDir ( + if exist "%InstallDir%\VC\Auxiliary\Build\vcvars64.bat" ( + call "%InstallDir%\VC\Auxiliary\Build\vcvars64.bat" + ) +) + +if not exist .\hellovulkan\bin mkdir .\hellovulkan\bin + +cl.exe /nologo /EHsc /Fo.\hellovulkan\bin\ /Fe.\hellovulkan\bin\ ^ + /I %VULKAN_SDK%\Include ^ + .\hellovulkan\src\Main.cpp ^ + .\hellovulkan\src\VulkanSample.cpp ^ + .\hellovulkan\src\VulkanQuad.cpp ^ + .\hellovulkan\src\VulkanTexturedQuad.cpp ^ + .\hellovulkan\src\Window.cpp ^ + .\hellovulkan\src\ImageIO.cpp ^ + .\hellovulkan\src\Utility.cpp ^ + %VULKAN_SDK%\Lib\vulkan-1.lib diff --git a/hellovulkan/src/ImageIO.cpp b/hellovulkan/src/ImageIO.cpp index d6e5b2a..b0c9659 100644 --- a/hellovulkan/src/ImageIO.cpp +++ b/hellovulkan/src/ImageIO.cpp @@ -27,6 +27,8 @@ #include // for _com_error #include +// for runtime_error +#include #include "Utility.h" #define SAFE_WIC(expr) do {const auto r = expr; if (FAILED(r)) {_com_error err (r); OutputDebugString (err.ErrorMessage()); __debugbreak ();} } while (0,0)