62 :
PlaygroundImpl(switches), handle_(
nullptr, &DestroyWindowHandle) {
65 InitGlobalVulkanInstance();
67 ::glfwDefaultWindowHints();
68 ::glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
69 ::glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
71 auto window = ::glfwCreateWindow(1, 1,
"Test",
nullptr,
nullptr);
79 ::glfwGetWindowSize(window, &width, &height);
80 size_ =
ISize{width, height};
82 handle_.reset(window);
84 ContextVK::Settings context_settings;
85 context_settings.proc_address_callback =
86 reinterpret_cast<PFN_vkGetInstanceProcAddr
>(
87 &::glfwGetInstanceProcAddress);
89 context_settings.cache_directory = fml::paths::GetCachesDirectory();
93 if (!context_vk || !context_vk->IsValid()) {
94 VALIDATION_LOG <<
"Could not create Vulkan context in the playground.";
98 VkSurfaceKHR vk_surface;
99 auto res = vk::Result{::glfwCreateWindowSurface(
100 context_vk->GetInstance(),
105 if (res != vk::Result::eSuccess) {
107 << vk::to_string(res);
111 vk::UniqueSurfaceKHR surface{vk_surface, context_vk->GetInstance()};
112 auto context = context_vk->CreateSurfaceContext();
113 if (!context->SetWindowSurface(std::move(surface), size_)) {
118 context_ = std::move(context);