int vkDisplay::init(const unsigned int gpu_idx) { //m_gpuIdx = gpu_idx; #if 0 VkResult result = init_vk(gpu_idx); if (result != VK_SUCCESS) { vktrace_LogError("could not init vulkan library"); return -1; } else { m_initedVK = true; } #endif #if defined(PLATFORM_LINUX) const xcb_setup_t *setup; xcb_screen_iterator_t iter; int scr; m_pXcbConnection = xcb_connect(NULL, &scr); setup = xcb_get_setup(m_pXcbConnection); iter = xcb_setup_roots_iterator(setup); while (scr-- > 0) xcb_screen_next(&iter); m_pXcbScreen = iter.data; #endif return 0; }
ShellXcb::ShellXcb(Game &game) : Shell(game) { if (game.settings().validate) instance_layers_.push_back("VK_LAYER_LUNARG_standard_validation"); instance_extensions_.push_back(VK_KHR_XCB_SURFACE_EXTENSION_NAME); init_connection(); init_vk(); }
ShellWin32::ShellWin32(Game &game) : Shell(game), hwnd_(nullptr) { if (game.settings().validate) instance_layers_.push_back("VK_LAYER_LUNARG_standard_validation"); instance_extensions_.push_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME); init_vk(); }
ShellXcb::ShellXcb(Game &game) : Shell(game) { instance_extensions_.push_back(VK_KHR_XCB_SURFACE_EXTENSION_NAME); init_connection(); init_vk(); }
ShellAndroid::ShellAndroid(android_app &app, Game &game) : Shell(game), app_(app) { instance_extensions_.push_back(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME); app_dummy(); app_.userData = this; app_.onAppCmd = on_app_cmd; app_.onInputEvent = on_input_event; init_vk(); }
ShellWin32::ShellWin32(Game &game) : Shell(game), hwnd_(nullptr) { instance_extensions_.push_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME); init_vk(); }