63 :
PlaygroundImpl(switches), handle_(
nullptr, &DestroyWindowHandle) {
66 InitGlobalVulkanInstance();
68 ::glfwDefaultWindowHints();
69 ::glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
70 ::glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
72 auto window = ::glfwCreateWindow(1, 1,
"Test",
nullptr,
nullptr);
80 ::glfwGetWindowSize(window, &width, &height);
81 size_ =
ISize{width, height};
83 handle_.reset(window);
85 ContextVK::Settings context_settings;
86 context_settings.proc_address_callback =
87 reinterpret_cast<PFN_vkGetInstanceProcAddr
>(
88 &::glfwGetInstanceProcAddress);
90 context_settings.cache_directory = fml::paths::GetCachesDirectory();
92 context_settings.fatal_missing_validations =
97 if (!context_vk || !context_vk->IsValid()) {
98 VALIDATION_LOG <<
"Could not create Vulkan context in the playground.";
102 VkSurfaceKHR vk_surface;
103 auto res = vk::Result{::glfwCreateWindowSurface(
104 context_vk->GetInstance(),
109 if (res != vk::Result::eSuccess) {
111 << vk::to_string(res);
115 vk::UniqueSurfaceKHR surface{vk_surface, context_vk->GetInstance()};
116 auto context = context_vk->CreateSurfaceContext();
117 if (!context->SetWindowSurface(std::move(surface), size_)) {
122 context_ = std::move(context);