Add line-numbers when printing opengl errors.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5474 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2017-06-07 14:58:46 +00:00
parent 99d93a8b16
commit 99e870e2f6
3 changed files with 19 additions and 18 deletions

View File

@ -1,6 +1,7 @@
--------------------------
Changes in 1.9 (not yet released)
- Lets the BSP loader find textures inserted with relative paths. Thx@ curaga for patch
- Slightly simplified ALLOC_STRATEGY_DOUBLE in arrays
- Add alternavive BoundingBox calculation for BillboardSceneNode which can take in a camera node. Thx @Seven and @JacKDuRdEn for bugreports.
- FPS camera now supports keyboard rotation.

View File

@ -467,7 +467,7 @@ bool COpenGLDriver::updateVertexHardwareBuffer(SHWBufferLink_opengl *HWBuffer)
extGlBindBuffer(GL_ARRAY_BUFFER, 0);
return (!testGLError());
return (!testGLError(__LINE__));
#else
return false;
#endif
@ -541,7 +541,7 @@ bool COpenGLDriver::updateIndexHardwareBuffer(SHWBufferLink_opengl *HWBuffer)
extGlBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
return (!testGLError());
return (!testGLError(__LINE__));
#else
return false;
#endif
@ -735,7 +735,7 @@ void COpenGLDriver::runOcclusionQuery(scene::ISceneNode* node, bool visible)
#else
0);
#endif
testGLError();
testGLError(__LINE__);
}
}
@ -762,7 +762,7 @@ void COpenGLDriver::updateOcclusionQuery(scene::ISceneNode* node, bool block)
0,
#endif
&available);
testGLError();
testGLError(__LINE__);
if (available==GL_TRUE)
{
extGlGetQueryObjectiv(OcclusionQueries[index].UID,
@ -777,7 +777,7 @@ void COpenGLDriver::updateOcclusionQuery(scene::ISceneNode* node, bool block)
if (queryFeature(EVDF_OCCLUSION_QUERY))
OcclusionQueries[index].Result = available;
}
testGLError();
testGLError(__LINE__);
}
}
@ -2035,7 +2035,7 @@ void COpenGLDriver::setMaterial(const SMaterial& material)
//! prints error if an error happened.
bool COpenGLDriver::testGLError()
bool COpenGLDriver::testGLError(int code)
{
#ifdef _DEBUG
GLenum g = glGetError();
@ -2044,22 +2044,22 @@ bool COpenGLDriver::testGLError()
case GL_NO_ERROR:
return false;
case GL_INVALID_ENUM:
os::Printer::log("GL_INVALID_ENUM", ELL_ERROR); break;
os::Printer::log("GL_INVALID_ENUM", core::stringc(code).c_str(), ELL_ERROR); break;
case GL_INVALID_VALUE:
os::Printer::log("GL_INVALID_VALUE", ELL_ERROR); break;
os::Printer::log("GL_INVALID_VALUE", core::stringc(code).c_str(), ELL_ERROR); break;
case GL_INVALID_OPERATION:
os::Printer::log("GL_INVALID_OPERATION", ELL_ERROR); break;
os::Printer::log("GL_INVALID_OPERATION", core::stringc(code).c_str(), ELL_ERROR); break;
case GL_STACK_OVERFLOW:
os::Printer::log("GL_STACK_OVERFLOW", ELL_ERROR); break;
os::Printer::log("GL_STACK_OVERFLOW", core::stringc(code).c_str(), ELL_ERROR); break;
case GL_STACK_UNDERFLOW:
os::Printer::log("GL_STACK_UNDERFLOW", ELL_ERROR); break;
os::Printer::log("GL_STACK_UNDERFLOW", core::stringc(code).c_str(), ELL_ERROR); break;
case GL_OUT_OF_MEMORY:
os::Printer::log("GL_OUT_OF_MEMORY", ELL_ERROR); break;
os::Printer::log("GL_OUT_OF_MEMORY", core::stringc(code).c_str(), ELL_ERROR); break;
case GL_TABLE_TOO_LARGE:
os::Printer::log("GL_TABLE_TOO_LARGE", ELL_ERROR); break;
os::Printer::log("GL_TABLE_TOO_LARGE", core::stringc(code).c_str(), ELL_ERROR); break;
#if defined(GL_EXT_framebuffer_object)
case GL_INVALID_FRAMEBUFFER_OPERATION_EXT:
os::Printer::log("GL_INVALID_FRAMEBUFFER_OPERATION", ELL_ERROR); break;
os::Printer::log("GL_INVALID_FRAMEBUFFER_OPERATION", core::stringc(code).c_str(), ELL_ERROR); break;
#endif
};
// _IRR_DEBUG_BREAK_IF(true);
@ -3931,7 +3931,7 @@ IImage* COpenGLDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RE
}
glReadBuffer(tgt);
glReadPixels(0, 0, ScreenSize.Width, ScreenSize.Height, fmt, type, pixels);
testGLError();
testGLError(__LINE__);
glReadBuffer(GL_BACK);
}
@ -3967,7 +3967,7 @@ IImage* COpenGLDriver::createScreenShot(video::ECOLOR_FORMAT format, video::E_RE
if (newImage)
{
if (testGLError() || !pixels)
if (testGLError(__LINE__) || !pixels)
{
newImage->drop();
return 0;

View File

@ -344,9 +344,9 @@ namespace video
//! Returns an image created from the last rendered frame.
virtual IImage* createScreenShot(video::ECOLOR_FORMAT format=video::ECF_UNKNOWN, video::E_RENDER_TARGET target=video::ERT_FRAME_BUFFER) _IRR_OVERRIDE_;
//! checks if an OpenGL error has happend and prints it
//! checks if an OpenGL error has happened and prints it (+ some internal code which is usually the line number)
//! for performance reasons only available in debug mode
bool testGLError();
bool testGLError(int code=0);
//! Set/unset a clipping plane.
//! There are at least 6 clipping planes available for the user to set at will.