Commit 2601d0b8 authored by hybrid's avatar hybrid

Changed ReadBuffer to be always the front buffer. Hence, screenshots under...

Changed ReadBuffer to be always the front buffer. Hence, screenshots under OpenGL will now also reflect the currently visible image, whatever render calls have been made in between.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1380 dfc29bdd-3216-0410-991c-e03cc46cb475
parent d6c32fd9
......@@ -299,25 +299,37 @@ bool COpenGLDriver::genericDriverInit(const core::dimension2d<s32>& screenSize,
else
os::Printer::log("GLSL not available.", ELL_INFORMATION);
glViewport(0, 0, screenSize.Width, screenSize.Height); // Reset The Current Viewport
setAmbientLight(SColorf(0.0f,0.0f,0.0f,0.0f));
// We want to read the front buffer to get the latest render finished.
glReadBuffer(GL_FRONT);
// Reset The Current Viewport
glViewport(0, 0, screenSize.Width, screenSize.Height);
// This needs an SMaterial flag to enable/disable later on, but should become default sometimes
// glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
// glEnable(GL_COLOR_MATERIAL);
setAmbientLight(SColorf(0.0f,0.0f,0.0f,0.0f));
#ifdef GL_EXT_separate_specular_color
if (FeatureAvailable[IRR_EXT_separate_specular_color])
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
#endif
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
// This is a fast replacement for NORMALIZE_NORMALS
// if ((Version>101) || FeatureAvailable[IRR_EXT_rescale_normal])
// glEnable(GL_RESCALE_NORMAL_EXT);
glClearDepth(1.0);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glDepthFunc(GL_LEQUAL);
glFrontFace( GL_CW );
if (AntiAlias)
{
if (MultiSamplingExtension)
glEnable(GL_MULTISAMPLE_ARB);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glEnable(GL_LINE_SMOOTH);
}
......@@ -325,9 +337,6 @@ bool COpenGLDriver::genericDriverInit(const core::dimension2d<s32>& screenSize,
// glHint(GL_POINT_SMOOTH_HINT, GL_FASTEST);
// glEnable(GL_POINT_SMOOTH);
if (AntiAlias && MultiSamplingExtension)
glEnable(GL_MULTISAMPLE_ARB);
UserClipPlane.reallocate(MaxUserClipPlanes);
UserClipPlaneEnabled.reallocate(MaxUserClipPlanes);
for (i=0; i<MaxUserClipPlanes; ++i)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment