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

Skip to content

Commit 1936157

Browse files
authored
Merge pull request #222 from mrsaleh/patch-1
2 parents 93ce448 + 86a80c7 commit 1936157

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ 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+
To access native platform functions, you need to update the includes at the top:
46+
47+
```c++
48+
#define VK_USE_PLATFORM_WIN32_KHR
49+
#define GLFW_INCLUDE_VULKAN
50+
#include <GLFW/glfw3.h>
51+
#define GLFW_EXPOSE_NATIVE_WIN32
52+
#include <GLFW/glfw3native.h>
53+
```
54+
4555
Because a window surface is a Vulkan object, it comes with a
4656
`VkWin32SurfaceCreateInfoKHR` struct that needs to be filled in. It has two
4757
important parameters: `hwnd` and `hinstance`. These are the handles to the

0 commit comments

Comments
 (0)