1 #ifndef ANDROID_DVR_DEBUG_H_ 2 #define ANDROID_DVR_DEBUG_H_ 3 4 #include <GLES3/gl3.h> 5 #include <math.h> 6 7 #include <log/log.h> 8 9 #ifndef NDEBUG 10 #define CHECK_GL() \ 11 do { \ 12 const GLenum err = glGetError(); \ 13 if (err != GL_NO_ERROR) { \ 14 ALOGE("OpenGL error %d", err); \ 15 } \ 16 } while (0) 17 18 #define CHECK_GL_FBO() \ 19 do { \ 20 GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); \ 21 switch (status) { \ 22 case GL_FRAMEBUFFER_COMPLETE: \ 23 break; \ 24 case GL_FRAMEBUFFER_UNSUPPORTED: \ 25 ALOGE("GL_FRAMEBUFFER_UNSUPPORTED"); \ 26 break; \ 27 default: \ 28 ALOGE("FBO user error: %d", status); \ 29 break; \ 30 } \ 31 } while (0) 32 #else 33 #define CHECK_GL() 34 #define CHECK_GL_FBO() 35 #endif 36 37 #endif // ANDROID_DVR_DEBUG_H_ 38