mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-08 08:38:51 +00:00
Fix indentation and add full example
This commit is contained in:
+9
-9
@@ -6,14 +6,14 @@ import CA "vendor:darwin/QuartzCore"
|
||||
import NS "core:sys/darwin/Foundation"
|
||||
|
||||
GetSurface :: proc(instance: wgpu.Instance, window: ^sdl2.Window) -> wgpu.Surface {
|
||||
window_info: sdl2.SysWMinfo
|
||||
sdl2.GetWindowWMInfo(window, &window_info)
|
||||
ns_window := cast(^NS.Window)window_info.info.cocoa.window
|
||||
metal_layer := CA.MetalLayer_layer()
|
||||
ns_window->contentView()->setLayer(metal_layer)
|
||||
return wgpu.InstanceCreateSurface(
|
||||
instance,
|
||||
&wgpu.SurfaceDescriptor{
|
||||
window_info: sdl2.SysWMinfo
|
||||
sdl2.GetWindowWMInfo(window, &window_info)
|
||||
ns_window := cast(^NS.Window)window_info.info.cocoa.window
|
||||
metal_layer := CA.MetalLayer_layer()
|
||||
ns_window->contentView()->setLayer(metal_layer)
|
||||
return wgpu.InstanceCreateSurface(
|
||||
instance,
|
||||
&wgpu.SurfaceDescriptor{
|
||||
nextInChain = &wgpu.SurfaceDescriptorFromMetalLayer{
|
||||
chain = wgpu.ChainedStruct{
|
||||
sType = .SurfaceDescriptorFromMetalLayer,
|
||||
@@ -21,5 +21,5 @@ GetSurface :: proc(instance: wgpu.Instance, window: ^sdl2.Window) -> wgpu.Surfac
|
||||
layer = rawptr(metal_layer),
|
||||
},
|
||||
},
|
||||
)
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user