fixed many oversights

This commit is contained in:
Slashscreen
2025-02-12 15:06:22 -08:00
parent 02b19b115b
commit 2f82d4e325
3 changed files with 56 additions and 46 deletions
+17 -11
View File
@@ -2,21 +2,27 @@ package wgpu_sdl3_glue
import win "core:sys/windows"
import "vendor:sdl3"
import "vendor:wgpu"
import "vendor:sdl3"
import "vendor:wgpu"
GetSurface :: proc(instance: wgpu.Instance, window: ^sdl3.Window) -> wgpu.Surface {
hwnd := sdl3.GetPointerProperty(sdl3.GetWindowProperties(window), sdl3.PROP_WINDOW_WIN32_HWND_POINTER, nil)
hinstance := win.GetModuleHandleW(nil)
hwnd := sdl3.GetPointerProperty(
sdl3.GetWindowProperties(window),
sdl3.PROP_WINDOW_WIN32_HWND_POINTER,
nil,
)
hinstance := sdl3.GetPointerProperty(
sdl3.GetWindowProperties(window),
sdl3.PROP_WINDOW_WIN32_INSTANCE_POINTER,
nil,
)
return wgpu.InstanceCreateSurface(
instance,
&wgpu.SurfaceDescriptor{
nextInChain = &wgpu.SurfaceDescriptorFromWindowsHWND{
chain = wgpu.ChainedStruct{
sType = .SurfaceDescriptorFromWindowsHWND,
},
hinstance = rawptr(hinstance),
hwnd = rawptr(hwnd),
&wgpu.SurfaceDescriptor {
nextInChain = &wgpu.SurfaceDescriptorFromWindowsHWND {
chain = wgpu.ChainedStruct{sType = .SurfaceDescriptorFromWindowsHWND},
hinstance = hinstance,
hwnd = hwnd,
},
},
)