mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
19 lines
498 B
Odin
19 lines
498 B
Odin
package wgpu_sdl3_glue
|
|
|
|
import "vendor:sdl3"
|
|
import "vendor:wgpu"
|
|
|
|
GetSurface :: proc(instance: wgpu.Instance, window: ^sdl3.Window) -> wgpu.Surface {
|
|
view := sdl3.Metal_CreateView(window)
|
|
metal_layer := sdl3.Metal_GetLayer(view)
|
|
return wgpu.InstanceCreateSurface(
|
|
instance,
|
|
&wgpu.SurfaceDescriptor {
|
|
nextInChain = &wgpu.SurfaceDescriptorFromMetalLayer {
|
|
chain = wgpu.ChainedStruct{sType = .SurfaceDescriptorFromMetalLayer},
|
|
layer = metal_layer,
|
|
},
|
|
},
|
|
)
|
|
}
|