summaryrefslogtreecommitdiffstats
path: root/Common/NativeApp/src/Linux
diff options
context:
space:
mode:
authorEgor <egor.yusov@gmail.com>2019-10-28 00:46:48 +0000
committerEgor <egor.yusov@gmail.com>2019-10-28 00:46:48 +0000
commitcf0268d40bbe5cf9be97d64bc4f90661705ac91f (patch)
tree12bb74169e992a0e4ddaabcdcc0899648392bcc2 /Common/NativeApp/src/Linux
parentFixed tabs in UWP app source (diff)
downloadDiligentEngine-cf0268d40bbe5cf9be97d64bc4f90661705ac91f.tar.gz
DiligentEngine-cf0268d40bbe5cf9be97d64bc4f90661705ac91f.zip
LinuxApp: attempting to initialize in OpenGL mode if Vulkan fails
Diffstat (limited to 'Common/NativeApp/src/Linux')
-rw-r--r--Common/NativeApp/src/Linux/LinuxMain.cpp13
1 files changed, 11 insertions, 2 deletions
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