mirror of
https://github.com/encounter/aurora.git
synced 2026-07-09 18:19:33 -07:00
40913d532e
Co-authored-by: Luke Street <luke@street.dev>
14 lines
494 B
Plaintext
14 lines
494 B
Plaintext
#include "BackendBinding.hpp"
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#include <SDL3/SDL_metal.h>
|
|
|
|
namespace aurora::webgpu::utils {
|
|
std::shared_ptr<wgpu::ChainedStruct> SetupWindowAndGetSurfaceDescriptorCocoa(SDL_Window* window) {
|
|
SDL_MetalView view = SDL_Metal_CreateView(window);
|
|
std::shared_ptr<wgpu::SurfaceSourceMetalLayer> desc = std::make_shared<wgpu::SurfaceSourceMetalLayer>();
|
|
desc->layer = SDL_Metal_GetLayer(view);
|
|
return std::move(desc);
|
|
}
|
|
} // namespace aurora::webgpu::utils
|