mirror of
				https://github.com/TES3MP/openmw-tes3mp.git
				synced 2025-10-31 20:56:42 +00:00 
			
		
		
		
	Pass only the X11 window to Ogre, otherwise it would treat it as parentWindowHandle instead of externalWindowHandle. parentWindowHandle does not seem to play nice with SDL and occasionally crashes with a GLXBadDrawable error on startup.
This commit is contained in:
		
							parent
							
								
									91f6d87126
								
							
						
					
					
						commit
						50a0d16f8f
					
				
					 2 changed files with 9 additions and 3 deletions
				
			
		
							
								
								
									
										6
									
								
								extern/sdl4ogre/sdlinputwrapper.cpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								extern/sdl4ogre/sdlinputwrapper.cpp
									
									
									
									
										vendored
									
									
								
							|  | @ -105,6 +105,12 @@ namespace SFO | |||
|             case SDL_WINDOWEVENT_FOCUS_LOST: | ||||
|             case SDL_WINDOWEVENT_CLOSE: | ||||
|                 break; | ||||
|             case SDL_WINDOWEVENT_SHOWN: | ||||
|                 mOgreWindow->setVisible(true); | ||||
|                 break; | ||||
|             case SDL_WINDOWEVENT_HIDDEN: | ||||
|                 mOgreWindow->setVisible(false); | ||||
|                 break; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
|  | @ -315,9 +315,7 @@ void OgreRenderer::createWindow(const std::string &title, const WindowSettings& | |||
|         break; | ||||
| #else | ||||
|     case SDL_SYSWM_X11: | ||||
|         winHandle = Ogre::StringConverter::toString((unsigned long)wmInfo.info.x11.display); | ||||
|         winHandle += ":0:"; | ||||
|         winHandle += Ogre::StringConverter::toString((unsigned long)wmInfo.info.x11.window); | ||||
|         winHandle = Ogre::StringConverter::toString((unsigned long)wmInfo.info.x11.window); | ||||
|         break; | ||||
| #endif | ||||
|     default: | ||||
|  | @ -325,6 +323,8 @@ void OgreRenderer::createWindow(const std::string &title, const WindowSettings& | |||
|         break; | ||||
|     } | ||||
| 
 | ||||
|     /// \todo externalWindowHandle is deprecated according to the source code. Figure out a way to get parentWindowHandle
 | ||||
|     /// to work properly. On Linux/X11 it causes an occasional GLXBadDrawable error.
 | ||||
|     params.insert(std::make_pair("externalWindowHandle",  winHandle)); | ||||
| 
 | ||||
|     mWindow = mRoot->createRenderWindow(title, settings.window_x, settings.window_y, settings.fullscreen, ¶ms); | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue