-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #161
- Loading branch information
Showing
2 changed files
with
118 additions
and
64 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,32 @@ | ||
pub usingnamespace @cImport({ | ||
const c = @cImport({ | ||
@cDefine("GLFW_INCLUDE_NONE", {}); | ||
@cInclude("GLFW/glfw3.h"); | ||
}); | ||
|
||
const vk = @import("vulkan"); | ||
const c = @This(); | ||
|
||
// Re-export the GLFW things that we need | ||
pub const GLFW_TRUE = c.GLFW_TRUE; | ||
pub const GLFW_FALSE = c.GLFW_FALSE; | ||
pub const GLFW_CLIENT_API = c.GLFW_CLIENT_API; | ||
pub const GLFW_NO_API = c.GLFW_NO_API; | ||
|
||
pub const GLFWwindow = c.GLFWwindow; | ||
|
||
pub const glfwInit = c.glfwInit; | ||
pub const glfwTerminate = c.glfwTerminate; | ||
pub const glfwVulkanSupported = c.glfwVulkanSupported; | ||
pub const glfwWindowHint = c.glfwWindowHint; | ||
pub const glfwCreateWindow = c.glfwCreateWindow; | ||
pub const glfwDestroyWindow = c.glfwDestroyWindow; | ||
pub const glfwWindowShouldClose = c.glfwWindowShouldClose; | ||
pub const glfwGetRequiredInstanceExtensions = c.glfwGetRequiredInstanceExtensions; | ||
pub const glfwGetFramebufferSize = c.glfwGetFramebufferSize; | ||
pub const glfwPollEvents = c.glfwPollEvents; | ||
|
||
// usually the GLFW vulkan functions are exported if Vulkan is included, | ||
// but since thats not the case here, they are manually imported. | ||
// but since thats not the case here, they are manually imported. | ||
|
||
pub extern fn glfwGetInstanceProcAddress(instance: vk.Instance, procname: [*:0]const u8) vk.PfnVoidFunction; | ||
pub extern fn glfwGetPhysicalDevicePresentationSupport(instance: vk.Instance, pdev: vk.PhysicalDevice, queuefamily: u32) c_int; | ||
pub extern fn glfwCreateWindowSurface(instance: vk.Instance, window: *c.GLFWwindow, allocation_callbacks: ?*const vk.AllocationCallbacks, surface: *vk.SurfaceKHR) vk.Result; | ||
pub extern fn glfwCreateWindowSurface(instance: vk.Instance, window: *GLFWwindow, allocation_callbacks: ?*const vk.AllocationCallbacks, surface: *vk.SurfaceKHR) vk.Result; |
This file contains 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