glfw/glfw

Recommended way to use glfw with vukan hpp module?

Opened this issue · 4 comments

Recommended way to use glfw with vukan hpp module?

Does the following work for you:

#include <vulkan/vulkan.hpp>
#include <GLFW/glfw3.h>

Make sure you do not have GLFW_INCLUDE_VULKAN defined as per the GLFW Vulkan guide

The above works but then you would need to include the vulkan headers via #include which one wants to avoid by using modules. The best solution I found for now is to use glfw3native which requires a bit more coding but does not need any direct vulkan.hpp includes.

The Khronos Vulkan-Hpp samples use GLFW, and they using #include for the vulkan.hpp headers.

Modules may have some benefits, but they are relatively new and their compiler support is incomplete. So I would still recommend using the include approach.

at least msvc has full support and the rest will follow soon™