From cf0268d40bbe5cf9be97d64bc4f90661705ac91f Mon Sep 17 00:00:00 2001 From: Egor Date: Sun, 27 Oct 2019 17:46:48 -0700 Subject: LinuxApp: attempting to initialize in OpenGL mode if Vulkan fails --- Common/NativeApp/src/Linux/LinuxMain.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'Common/NativeApp/src/Linux') diff --git a/Common/NativeApp/src/Linux/LinuxMain.cpp b/Common/NativeApp/src/Linux/LinuxMain.cpp index 93a3235..fc26c8a 100644 --- a/Common/NativeApp/src/Linux/LinuxMain.cpp +++ b/Common/NativeApp/src/Linux/LinuxMain.cpp @@ -214,7 +214,8 @@ int xcb_main() std::string Title = TheApp->GetAppTitle(); auto xcbInfo = InitXCBConnectionAndWindow(Title); - TheApp->InitVulkan(xcbInfo.connection, xcbInfo.window); + if(!TheApp->InitVulkan(xcbInfo.connection, xcbInfo.window)) + return -1; xcb_flush(xcbInfo.connection); @@ -509,7 +510,15 @@ int main (int argc, char ** argv) if (UseVulkan) { - return xcb_main(); + auto ret = xcb_main(); + if (ret >= 0) + { + return ret; + } + else + { + LOG_ERROR_MESSAGE("Failed to initialize the engine in Vulkan mode. Attempting to use OpenGL"); + } } #endif -- cgit v1.2.3