suppressing OpenGL calls for testing purpose.

This commit is contained in:
rachytski 2011-08-24 17:14:28 +03:00 committed by Alex Zolotarev
parent 365b5f448d
commit fa1710c108
3 changed files with 28 additions and 23 deletions

View file

@ -129,29 +129,32 @@ namespace yg
void FrameBuffer::checkStatus()
{
if (!yg::gl::g_doFakeOpenGLCalls)
{
#ifdef OMIM_GL_ES
GLenum res = glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES);
if (res == GL_FRAMEBUFFER_UNSUPPORTED_OES)
LOG(LINFO, ("unsupported combination of attached target formats. could be possibly skipped"));
else if (res == GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES)
LOG(LINFO, ("incomplete attachement"));
else if (res == GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES)
LOG(LINFO, ("incomplete missing attachement"));
else if (res == GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES)
{
LOG(LINFO, ("incomplete dimensions"));
}
GLenum res = glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES);
if (res == GL_FRAMEBUFFER_UNSUPPORTED_OES)
LOG(LINFO, ("unsupported combination of attached target formats. could be possibly skipped"));
else if (res == GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES)
LOG(LINFO, ("incomplete attachement"));
else if (res == GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES)
LOG(LINFO, ("incomplete missing attachement"));
else if (res == GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES)
{
LOG(LINFO, ("incomplete dimensions"));
}
#else
GLenum res = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
if (res == GL_FRAMEBUFFER_UNSUPPORTED)
{
LOG(LINFO, ("unsupported combination of attached target formats. could be possibly skipped"));
}
else if (res != GL_FRAMEBUFFER_COMPLETE_EXT)
{
LOG(LERROR, ("incomplete framebuffer"));
}
GLenum res = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
if (res == GL_FRAMEBUFFER_UNSUPPORTED)
{
LOG(LINFO, ("unsupported combination of attached target formats. could be possibly skipped"));
}
else if (res != GL_FRAMEBUFFER_COMPLETE_EXT)
{
LOG(LERROR, ("incomplete framebuffer"));
}
#endif
}
}
}
}

View file

@ -12,6 +12,7 @@ namespace yg
{
namespace gl
{
bool g_doFakeOpenGLCalls = false;
bool g_isBufferObjectsSupported = true;
bool g_isFramebufferSupported = true;
bool g_isRenderbufferSupported = true;

View file

@ -39,6 +39,7 @@ namespace yg
{
namespace gl
{
extern bool g_doFakeOpenGLCalls; //< for testing support
extern bool g_isBufferObjectsSupported;
extern bool g_isFramebufferSupported;
extern bool g_isRenderbufferSupported;
@ -53,11 +54,11 @@ namespace yg
}
#ifdef DEBUG
#define OGLCHECK(f) do {f; yg::gl::CheckError(SRC());} while(false)
#define OGLCHECKAFTER yg::gl::CheckError(SRC())
#define OGLCHECK(f) do {if (!g_doFakeOpenGLCalls) { f; yg::gl::CheckError(SRC()); } } while(false)
#define OGLCHECKAFTER if (!g_doFakeOpenGLCalls) yg::gl::CheckError(SRC())
#define EGLCHECK do {yg::gl::CheckEGLError(SRC());} while(false)
#else
#define OGLCHECK(f) f
#define OGLCHECK(f) if (!g_doFakeOpenGLCalls) f
#define OGLCHECKAFTER
#define EGLCHECK
#endif