Skip to content

Commit

Permalink
TestOpenGL: more error checks
Browse files Browse the repository at this point in the history
  • Loading branch information
devernay committed Jun 3, 2016
1 parent 42fe9be commit 9e58da5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Test/TestOpenGLRender.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ glErrorString(GLenum errorCode)
{ \
GLenum _glerror_ = glGetError(); \
if (_glerror_ != GL_NO_ERROR) { \
std::cout << "GL_ERROR :" << __FILE__ << " " << __LINE__ << " " << glErrorString(_glerror_) << std::endl; \
std::cout << "GL_ERROR: " << __FILE__ << ":" << __LINE__ << " " << glErrorString(_glerror_) << std::endl; \
glError(); \
} \
}
Expand Down Expand Up @@ -1010,7 +1010,7 @@ TestOpenGLPlugin::RENDERFUNC(const OFX::RenderArguments &args)
# ifdef USE_OPENGL
const GLuint dstIndex = (GLuint)dst->getIndex();
const GLenum dstTarget = (GLenum)dst->getTarget();
DPRINT( ( "openGL: output texture index %d, target %d, depth %s\n",
DPRINT( ( "openGL: output texture index %d, target 0x%04X, depth %s\n",
dstIndex, dstTarget, mapBitDepthEnumToStr(dstBitDepth) ) );
# endif
OfxRectI dstBounds = dst->getBounds();
Expand Down Expand Up @@ -1043,7 +1043,7 @@ TestOpenGLPlugin::RENDERFUNC(const OFX::RenderArguments &args)
# ifdef USE_OPENGL
const GLuint srcIndex = (GLuint)src->getIndex();
const GLenum srcTarget = (GLenum)src->getTarget();
DPRINT( ( "openGL: source texture index %d, target %d, depth %s\n",
DPRINT( ( "openGL: source texture index %d, target 0x%04X, depth %s\n",
srcIndex, srcTarget, mapBitDepthEnumToStr(srcBitDepth) ) );
# endif
// XXX: check status for errors
Expand Down Expand Up @@ -1340,6 +1340,7 @@ TestOpenGLPlugin::RENDERFUNC(const OFX::RenderArguments &args)

// done; clean up.
glPopAttrib();
glCheckError();

#define DEBUG_OPENGL_BITS
#ifdef DEBUG_OPENGL_BITS
Expand All @@ -1365,6 +1366,7 @@ TestOpenGLPlugin::RENDERFUNC(const OFX::RenderArguments &args)
glFlush(); // waits until commands are submitted but does not wait for the commands to finish executing
glFinish(); // waits for all previously submitted commands to complete executing
}
glCheckError();
// make sure the buffer is not referenced anymore
osmesa->setContext(format, depthBits, type, stencilBits, accumBits, NULL, dstBounds);
OSMesaMakeCurrent(NULL, NULL, 0, 0, 0); // disactivate the context so that it can be used from another thread
Expand Down

0 comments on commit 9e58da5

Please sign in to comment.