From f190b95e10421049242e0028b40dbf4b9b5f3a2e Mon Sep 17 00:00:00 2001 From: assiduous Date: Sun, 29 Dec 2019 10:50:40 -0800 Subject: Fixed Unity emulator crash on Linux --- unityplugin/UnityEmulator/src/UnityGraphicsGLCore_Impl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'unityplugin/UnityEmulator') diff --git a/unityplugin/UnityEmulator/src/UnityGraphicsGLCore_Impl.cpp b/unityplugin/UnityEmulator/src/UnityGraphicsGLCore_Impl.cpp index fd23588..cd283f8 100644 --- a/unityplugin/UnityEmulator/src/UnityGraphicsGLCore_Impl.cpp +++ b/unityplugin/UnityEmulator/src/UnityGraphicsGLCore_Impl.cpp @@ -183,6 +183,11 @@ void UnityGraphicsGLCore_Impl::InitGLContext(void *pNativeWndHandle, if(m_Context == nullptr) LOG_ERROR_AND_THROW( "No active GL context found" ); + XWindowAttributes WndAttribs = {}; + XGetWindowAttributes(m_Display, m_LinuxWindow, &WndAttribs); + m_BackBufferWidth = WndAttribs.width; + m_BackBufferHeight = WndAttribs.height; + // Initialize GLEW GLenum err = glewInit(); if( GLEW_OK != err ) -- cgit v1.2.3