Add vendor:wgpu

This commit is contained in:
Laytan Laats
2024-06-12 17:22:02 +02:00
parent 68781f8dd3
commit 108b8feb35
23 changed files with 5430 additions and 18 deletions
+23
View File
@@ -0,0 +1,23 @@
package wgpu_glfw_glue
import win "core:sys/windows"
import "vendor:glfw"
import "vendor:wgpu"
GetSurface :: proc(instance: wgpu.Instance, window: glfw.WindowHandle) -> wgpu.Surface {
hwnd := glfw.GetWin32Window(window)
hinstance := win.GetModuleHandleW(nil)
return wgpu.InstanceCreateSurface(
instance,
&wgpu.SurfaceDescriptor{
nextInChain = &wgpu.SurfaceDescriptorFromWindowsHWND{
chain = wgpu.ChainedStruct{
sType = .SurfaceDescriptorFromWindowsHWND,
},
hinstance = rawptr(hinstance),
hwnd = rawptr(hwnd),
},
},
)
}