67 handle_(nullptr, &DestroyWindowHandle),
68 data_(std::make_unique<Data>()),
71 ::glfwDefaultWindowHints();
72 ::glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
74 auto window = ::glfwCreateWindow(1, 1,
"Test",
nullptr,
nullptr);
76 return;
77 }
78
81 is_gpu_disabled_sync_switch_, "Playground Library",
82 switches.enable_wide_gamut
85 if (!context) {
86 return;
87 }
88 NSWindow* cocoa_window = ::glfwGetCocoaWindow(
window);
89 if (cocoa_window == nil) {
90 return;
91 }
92 data_->metal_layer = [CAMetalLayer layer];
94 data_->metal_layer.pixelFormat =
96 data_->metal_layer.framebufferOnly = NO;
97 cocoa_window.contentView.layer = data_->metal_layer;
98 cocoa_window.contentView.wantsLayer = YES;
99
101 context_ = std::move(context);
102 swapchain_transients_ = std::make_shared<SwapchainTransientsMTL>(
103 context_->GetResourceAllocator());
104}
static std::shared_ptr< ConcurrentMessageLoop > Create(size_t worker_count=std::thread::hardware_concurrency())
static ContextMTL & Cast(Context &base)
static std::shared_ptr< ContextMTL > Create(const Flags &flags, const std::vector< std::string > &shader_library_paths, std::shared_ptr< const fml::SyncSwitch > is_gpu_disabled_sync_switch)
id< MTLDevice > GetMTLDevice() const
PlaygroundImpl(PlaygroundSwitches switches)
static std::vector< std::shared_ptr< fml::Mapping > > ShaderLibraryMappingsForPlayground()
constexpr MTLPixelFormat ToMTLPixelFormat(PixelFormat format)