Files
patchzyy ec226e8348 init
2026-08-23 17:10:50 +02:00

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