mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 09:15:29 +01:00 
			
		
		
		
	Take screenshot from back buffer when using double buffering (#14904)
Fixes #14901 (black screenshots on Wayland)
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							95a0cc8f9a
						
					
				
				
					commit
					10fd41b4a8
				
			@@ -3018,7 +3018,7 @@ IImage *COpenGLDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RE
 | 
			
		||||
	if (newImage)
 | 
			
		||||
		pixels = static_cast<u8 *>(newImage->getData());
 | 
			
		||||
	if (pixels) {
 | 
			
		||||
		glReadBuffer(GL_FRONT);
 | 
			
		||||
		glReadBuffer(Params.Doublebuffer ? GL_BACK : GL_FRONT);
 | 
			
		||||
		glReadPixels(0, 0, ScreenSize.Width, ScreenSize.Height, fmt, type, pixels);
 | 
			
		||||
		testGLError(__LINE__);
 | 
			
		||||
		glReadBuffer(GL_BACK);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user