Hmm, general front buffer reading is bad for texture based RTTs, so fixed this change to the screenshot method.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1558 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2008-09-11 08:16:28 +00:00
parent 8050b2d031
commit 05c55f7151
1 changed files with 3 additions and 2 deletions

View File

@ -319,8 +319,6 @@ bool COpenGLDriver::genericDriverInit(const core::dimension2d<s32>& screenSize,
else
os::Printer::log("GLSL not available.", ELL_INFORMATION);
// We want to read the front buffer to get the latest render finished.
glReadBuffer(GL_FRONT);
glPixelStorei(GL_PACK_ALIGNMENT, 1);
// Reset The Current Viewport
@ -2688,7 +2686,10 @@ IImage* COpenGLDriver::createScreenShot()
glPixelStorei(GL_PACK_INVERT_MESA, GL_TRUE);
#endif
// We want to read the front buffer to get the latest render finished.
glReadBuffer(GL_FRONT);
glReadPixels(0, 0, ScreenSize.Width, ScreenSize.Height, GL_RGB, GL_UNSIGNED_BYTE, pPixels);
glReadBuffer(GL_BACK);
#ifdef GL_MESA_pack_invert
if (FeatureAvailable[IRR_MESA_pack_invert])