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

Skip to content

Commit fd0b7c7

Browse files
committed
Be more explicit about placement of code in instance chapter
1 parent 68effde commit fd0b7c7

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

03_Drawing_a_triangle/00_Setup/01_Instance.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ application, for example because it uses a well-known graphics engine with
2828
certain special behavior. This struct is called `VkApplicationInfo`:
2929

3030
```c++
31-
VkApplicationInfo appInfo = {};
32-
appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
33-
appInfo.pApplicationName = "Hello Triangle";
34-
appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
35-
appInfo.pEngineName = "No Engine";
36-
appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
37-
appInfo.apiVersion = VK_API_VERSION_1_0;
31+
void createInstance() {
32+
VkApplicationInfo appInfo = {};
33+
appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
34+
appInfo.pApplicationName = "Hello Triangle";
35+
appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
36+
appInfo.pEngineName = "No Engine";
37+
appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
38+
appInfo.apiVersion = VK_API_VERSION_1_0;
39+
}
3840
```
3941

4042
As mentioned before, many structs in Vulkan require you to explicitly specify

0 commit comments

Comments
 (0)