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