Skip to content

Commit

Permalink
Fix some issues that arise when compiling with -vet
Browse files Browse the repository at this point in the history
  • Loading branch information
Valakor committed Feb 27, 2025
1 parent 2b996fd commit ce88ff8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 30 deletions.
56 changes: 27 additions & 29 deletions vendor/wgpu/sdl3glue/glue_windows.odin
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
package wgpu_sdl3_glue

import win "core:sys/windows"

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 := sdl3.GetPointerProperty(
sdl3.GetWindowProperties(window),
sdl3.PROP_WINDOW_WIN32_INSTANCE_POINTER,
nil,
)
return wgpu.InstanceCreateSurface(
instance,
&wgpu.SurfaceDescriptor {
nextInChain = &wgpu.SurfaceSourceWindowsHWND {
chain = wgpu.ChainedStruct{sType = .SurfaceSourceWindowsHWND},
hinstance = hinstance,
hwnd = hwnd,
},
},
)
}
package wgpu_sdl3_glue

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 := sdl3.GetPointerProperty(
sdl3.GetWindowProperties(window),
sdl3.PROP_WINDOW_WIN32_INSTANCE_POINTER,
nil,
)
return wgpu.InstanceCreateSurface(
instance,
&wgpu.SurfaceDescriptor {
nextInChain = &wgpu.SurfaceSourceWindowsHWND {
chain = wgpu.ChainedStruct{sType = .SurfaceSourceWindowsHWND},
hinstance = hinstance,
hwnd = hwnd,
},
},
)
}
2 changes: 1 addition & 1 deletion vendor/wgpu/wgpu.odin
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ StringView_Formatter :: proc(fi: ^fmt.Info, arg: any, verb: rune) -> bool {
fmt.fmt_cstring(fi, v.data, verb)

case:
s := strings.string_from_ptr(transmute([^]u8)(v.data), int(v.length))
s := strings.string_from_ptr(cast([^]u8)(v.data), int(v.length))
fmt.fmt_string(fi, s, verb)
}
return true
Expand Down

0 comments on commit ce88ff8

Please sign in to comment.