Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 25e860b

Browse files
committed
Update the tutorial for Visual Studio 2017
1 parent 67a9b52 commit 25e860b

19 files changed

Lines changed: 23 additions & 39 deletions

02_Development_environment.md

Lines changed: 18 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ separately here.
77
## Windows
88

99
If you're developing for Windows, then I will assume that you are using Visual
10-
Studio 2013 or 2015 to compile your code. The steps are the same for both
11-
versions, but the Vulkan SDK currently only includes debug symbols that are
12-
compatible with Visual Studio 2013. That isn't really a problem in practice, but
13-
it's something that you may wish to take into account.
10+
Studio 2017 to compile your code. You may also use Visual Studio 2013 or 2015, but the steps may be a bit different.
1411

1512
### Vulkan SDK
1613

@@ -29,7 +26,7 @@ be useful to you.
2926
Proceed through the installation and pay attention to the install location of
3027
the SDK. The first thing we'll do is verify that your graphics card and driver
3128
properly support Vulkan. Go to the directory where you installed the SDK, open
32-
the `Bin32` directory and run the `cube.exe` demo. You should see the following:
29+
the `Bin` directory and run the `cube.exe` demo. You should see the following:
3330

3431
![](/images/cube_demo.png)
3532

@@ -38,18 +35,11 @@ include the Vulkan runtime and that your graphics card is supported. See the
3835
[introduction chapter](!Introduction) for links to drivers from the major
3936
vendors.
4037

41-
There are two other programs in this directory that will be useful for
42-
development. The `vkjson_info.exe` program generates a JSON file with a detailed
43-
description of the capabilities of your hardware when using Vulkan. If you are
44-
wondering what support is like for extensions and other optional features among
45-
the graphics cards of your end users, then you can use [this website](http://vulkan.gpuinfo.org/)
46-
to view the results of a wide range of GPUs.
47-
48-
The `glslangValidator.exe` program will be used to compile shaders from the
38+
There is another program in this directory that will be useful for development. The `glslangValidator.exe` program will be used to compile shaders from the
4939
human-readable [GLSL](https://en.wikipedia.org/wiki/OpenGL_Shading_Language) to
5040
bytecode. We'll cover this in depth in the [shader modules](!Drawing_a_triangle/Graphics_pipeline_basics/Shader_modules)
51-
chapter. The `Bin32` directory also contains the binaries of the Vulkan loader
52-
and the validation layers, while the `Lib32` directory contains the libraries.
41+
chapter. The `Bin` directory also contains the binaries of the Vulkan loader
42+
and the validation layers, while the `Lib` directory contains the libraries.
5343

5444
The `Doc` directory contains useful information about the Vulkan SDK and an
5545
offline version of the entire Vulkan specification. Lastly, there's the
@@ -68,9 +58,9 @@ it also abstracts away some of the other platform-specific things in Vulkan
6858
besides just window creation.
6959

7060
You can find the latest release of GLFW on the [official website](http://www.glfw.org/download.html).
71-
In this tutorial we'll be using the 32-bit binaries, but you can of course also
72-
choose to build in 64 bit mode. In that case make sure to link with the Vulkan
73-
SDK binaries in the `Bin` directory. After downloading it, extract the archive
61+
In this tutorial we'll be using the 64-bit binaries, but you can of course also
62+
choose to build in 32 bit mode. In that case make sure to link with the Vulkan
63+
SDK binaries in the `Lib32` directory instead of `Lib`. After downloading it, extract the archive
7464
to a convenient location. I've chosen to create a `Libraries` directory in the
7565
Visual Studio directory under documents.
7666

@@ -95,16 +85,15 @@ Now that you've installed all of the dependencies we can set up a basic Visual
9585
Studio project for Vulkan and write a little bit of code to make sure that
9686
everything works.
9787

98-
Start Visual Studio and create a new C++ Win32 project.
88+
Start Visual Studio and create a new `Windows Desktop Wizard` project by entering a name and pressing `OK`.
9989

10090
![](/images/vs_new_cpp_project.png)
10191

102-
Click `Next`, select `Console application` as application type and make sure
103-
that `Empty project` is checked.
92+
Make sure that `Console Application (.exe)` is selected as application type so that we have a place to print debug messages to, and check `Empty Project` to prevent Visual Studio from adding boilerplate code.
10493

10594
![](/images/vs_application_settings.png)
10695

107-
Press `Finish` to create the project and add a C++ source file. You should
96+
Press `OK` to create the project and add a C++ source file. You should
10897
already know how to do that, but the steps are included here for completeness.
10998

11099
![](/images/vs_new_item.png)
@@ -170,7 +159,7 @@ Add the header directories for Vulkan, GLFW and GLM:
170159

171160
![](/images/vs_include_dirs.png)
172161

173-
Next, open the editor for library directories:
162+
Next, open the editor for library directories under `Linker -> General`:
174163

175164
![](/images/vs_link_settings.png)
176165

@@ -190,6 +179,10 @@ Enter the names of the Vulkan and GLFW object files:
190179
You can now close the project properties dialog. If you did everything right
191180
then you should no longer see any more errors being highlighted in the code.
192181

182+
Finally, ensure that you are actually compiling in 64 bit mode:
183+
184+
![](/images/vs_build_mode.png)
185+
193186
Press `F5` to compile and run the project and you should see a command prompt
194187
and a window pop up like this:
195188

@@ -464,23 +457,10 @@ You can now use this directory as a template for your Vulkan projects. Make a
464457
copy, rename it to something like `HelloTriangle` and remove all of the code
465458
in `main.cpp`.
466459

467-
Before we move on, let's explore the Vulkan SDK a bit more. There are two
468-
programs in it that will be very useful for development. The
469-
`x86_64/bin/vkjson_info` program generates a JSON file with a detailed
470-
description of the capabilities of your hardware when using Vulkan. If you are
471-
wondering what support is like for extensions and other optional features among
472-
the graphics cards of your end users, then you can use [this website](http://vulkan.gpuinfo.org/)
473-
to view the results of a wide range of GPUs. This program needs to be run with
474-
the same `LD_LIBRARY_PATH` variable as your own programs:
475-
476-
```bash
477-
LD_LIBRARY_PATH=../lib ./vkjson_info
478-
```
479-
480-
The `x86_64/bin/glslangValidator` program will be used to compile shaders from
460+
Before we move on, let's explore the Vulkan SDK a bit more. There is another program in it that will be very useful for development. The `x86_64/bin/glslangValidator` program will be used to compile shaders from
481461
the human-readable [GLSL](https://en.wikipedia.org/wiki/OpenGL_Shading_Language)
482462
to bytecode. We'll cover this in depth in the [shader modules](!Drawing_a_triangle/Graphics_pipeline_basics/Shader_modules)
483-
chapter. It does not depend on the Vulkan library.
463+
chapter.
484464

485465
The `Doc` directory contains useful information about the Vulkan SDK and an
486466
offline version of the entire Vulkan specification. Feel free to explore the

03_Drawing_a_triangle/01_Presentation/01_Swap_chain.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ void cleanup() {
556556
}
557557
```
558558

559-
Now run the application to ensure that the swap chain is created successfully!
559+
Now run the application to ensure that the swap chain is created successfully! If at this point you get an access violation error in `vkCreateSwapchainKHR`, then see the [FAQ entry](!FAQ) about the Steam overlay layer.
560560

561561
Try removing the `createInfo.imageExtent = extent;` line with validation layers
562562
enabled. You'll see that one of the validation layers immediately catches the

99_FAQ.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ few possible workarounds:
1919
* Opt out of the Steam beta program.
2020
* Set the `DISABLE_VK_LAYER_VALVE_steam_overlay_1` environment variable to `1`
2121
* Delete the Steam overlay Vulkan layer entry in the registry under `HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\Vulkan\ImplicitLayers`
22+
23+
Example:
24+
25+
![](/images/steam_layers_env.png)

images/glfw_directory.png

-1.15 KB
Loading

images/include_dirs_stb.png

2.67 KB
Loading
4.09 KB
Loading

images/library_directory.png

207 Bytes
Loading

images/steam_layers_env.png

18.8 KB
Loading

images/vs_all_configs.png

698 Bytes
Loading

images/vs_application_settings.png

-8.27 KB
Loading

0 commit comments

Comments
 (0)