Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions build_msvc.bat
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions hellovulkan/src/ImageIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <wincodec.h>
// for _com_error
#include <comdef.h>
// for runtime_error
#include <stdexcept>

#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)
Expand Down