Add bindings for glfw Vulkan functions#39
Merged
hazeycode merged 1 commit intozig-gamedev:mainfrom Sep 14, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds Zig bindings for three remaining GLFW Vulkan functions to enable Vulkan surface creation and function pointer retrieval. These bindings provide a complete interface for using GLFW with Vulkan in Zig applications.
- Added type aliases for Vulkan objects (VkInstance, VkPhysicalDevice, VkAllocationCallbacks, VkSurfaceKHR)
- Implemented bindings for
glfwGetInstanceProcAddress,glfwGetPhysicalDevicePresentationSupport, andglfwCreateWindowSurface - Added proper error handling for all three functions following the existing pattern
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
hazeycode
approved these changes
Sep 14, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added bindings for remaining unimplemented Vulkan functions:
glfwGetInstanceProcAddressglfwGetPhysicalDevicePresentationSupportglfwCreateWindowSurfaceLibrary user will need to supply their own instance, device, surface, and allocation callback pointers. The types for Vulkan objects
VkInstanceandVkPhysicalDeviceare just aliased to?*const anyopaque, and the types for Vulkan structsVkAllocationCallbacksandVkSurfaceKHRwere aliased toanyopaque. The main intent of these aliases is to provide clarity on the expected Vulkan types and ensure the bindings function signatures are mostly aligned with the glfw API (https://www.glfw.org/docs/3.3/group__vulkan.html).I've tested
getInstanceProcAddressto confirm that it retrieves function pointers correctly, and that those function pointers can be called correctly when cast to the command signature, however I didn't go all the way to creating a new Vulkan instance because I don't have the SDK set up on my current computer.Fixes #18