This commit is contained in:
Branimir Karadžić 2022-09-16 20:12:31 -07:00
parent cbbaba4099
commit 408988946d
2 changed files with 24 additions and 13 deletions

View File

@ -332,7 +332,13 @@ namespace entry
int32_t run(int _argc, const char* const* _argv) int32_t run(int _argc, const char* const* _argv)
{ {
XInitThreads(); XInitThreads();
m_display = XOpenDisplay(NULL); m_display = XOpenDisplay(NULL);
if (NULL == m_display)
{
bx::printf("XOpenDisplay failed: DISPLAY environment variable must be set.\n\n");
return bx::kExitFailure;
}
int32_t screen = DefaultScreen(m_display); int32_t screen = DefaultScreen(m_display);
m_depth = DefaultDepth(m_display, screen); m_depth = DefaultDepth(m_display, screen);
@ -558,6 +564,9 @@ namespace entry
XUnmapWindow(m_display, m_window[0]); XUnmapWindow(m_display, m_window[0]);
XDestroyWindow(m_display, m_window[0]); XDestroyWindow(m_display, m_window[0]);
XCloseDisplay(m_display);
m_display = NULL;
return thread.getExitCode(); return thread.getExitCode();
} }

View File

@ -749,6 +749,7 @@ namespace bgfx { namespace d3d12
m_nvapi.init(); m_nvapi.init();
{
const char* d3d12DllName = const char* d3d12DllName =
#if BX_PLATFORM_LINUX #if BX_PLATFORM_LINUX
"libd3d12.so" "libd3d12.so"
@ -764,6 +765,7 @@ namespace bgfx { namespace d3d12
BX_TRACE("Init error: Failed to load %s.", d3d12DllName); BX_TRACE("Init error: Failed to load %s.", d3d12DllName);
goto error; goto error;
} }
}
errorState = ErrorState::LoadedD3D12; errorState = ErrorState::LoadedD3D12;