2022-07-27 15:25:25 +00:00
|
|
|
#include "BackendBinding.hpp"
|
|
|
|
|
|
|
|
#include <SDL_metal.h>
|
|
|
|
|
|
|
|
namespace aurora::webgpu::utils {
|
2023-05-27 15:44:36 +00:00
|
|
|
std::unique_ptr<wgpu::ChainedStruct> SetupWindowAndGetSurfaceDescriptorCocoa(SDL_Window* window) {
|
|
|
|
SDL_MetalView view = SDL_Metal_CreateView(window);
|
|
|
|
std::unique_ptr<wgpu::SurfaceDescriptorFromMetalLayer> desc =
|
|
|
|
std::make_unique<wgpu::SurfaceDescriptorFromMetalLayer>();
|
|
|
|
desc->layer = SDL_Metal_GetLayer(view);
|
|
|
|
return std::move(desc);
|
|
|
|
}
|
2022-07-27 15:25:25 +00:00
|
|
|
} // namespace aurora::webgpu::utils
|