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

Skip to content

Commit 86a80c7

Browse files
authored
Update 00_Window_surface.md
1 parent 7d00f5e commit 86a80c7

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

en/03_Drawing_a_triangle/01_Presentation/00_Window_surface.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,20 @@ platform-specific code anyway. GLFW actually has `glfwCreateWindowSurface` that
4242
handles the platform differences for us. Still, it's good to see what it does
4343
behind the scenes before we start relying on it.
4444

45-
Because a window surface is a Vulkan object, it comes with a
46-
`VkWin32SurfaceCreateInfoKHR` struct that needs to be filled in. It has two
47-
important parameters: `hwnd` and `hinstance`. These are the handles to the
48-
window and the process.You need to define VK_USE_PLATFORM_WIN32_KHR before
49-
including vulkan header file. Because include vulkan header file we define it
50-
before including glfw header. and to use glfwGetWin32Window function we need to
51-
include it from glfw3native header file and define GLFW_EXPOSE_NATIVE_WIN32 before
52-
it , to make the function available for use.
53-
54-
```
45+
To access native platform functions, you need to update the includes at the top:
5546

47+
```c++
5648
#define VK_USE_PLATFORM_WIN32_KHR
5749
#define GLFW_INCLUDE_VULKAN
5850
#include <GLFW/glfw3.h>
5951
#define GLFW_EXPOSE_NATIVE_WIN32
6052
#include <GLFW/glfw3native.h>
6153
```
6254

63-
now we can create our surface.
55+
Because a window surface is a Vulkan object, it comes with a
56+
`VkWin32SurfaceCreateInfoKHR` struct that needs to be filled in. It has two
57+
important parameters: `hwnd` and `hinstance`. These are the handles to the
58+
window and the process.
6459

6560
```c++
6661
VkWin32SurfaceCreateInfoKHR createInfo{};

0 commit comments

Comments
 (0)