[vlc-commits] opengl: move GL_ASSERT_NOERROR macro to header
Romain Vimont
git at videolan.org
Thu Feb 13 23:12:52 CET 2020
vlc | branch: master | Romain Vimont <rom1v at videolabs.io> | Wed Jan 29 11:09:00 2020 +0100| [85ac68ae10fe64a6a84e657cf7166652b9b95757] | committer: Jean-Baptiste Kempf
opengl: move GL_ASSERT_NOERROR macro to header
The macro will be used from several files.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=85ac68ae10fe64a6a84e657cf7166652b9b95757
---
modules/video_output/opengl/gl_common.h | 27 +++++++++++++++++++++++++++
modules/video_output/opengl/vout_helper.c | 27 ---------------------------
2 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/modules/video_output/opengl/gl_common.h b/modules/video_output/opengl/gl_common.h
index f5f7f54a9f..303ef73131 100644
--- a/modules/video_output/opengl/gl_common.h
+++ b/modules/video_output/opengl/gl_common.h
@@ -97,6 +97,33 @@
# define APIENTRY
#endif
+/* FIXME: GL_ASSERT_NOERROR disabled for now because:
+ * Proper GL error handling need to be implemented
+ * glClear(GL_COLOR_BUFFER_BIT) throws a GL_INVALID_FRAMEBUFFER_OPERATION on macOS
+ * assert fails on vout_display_opengl_Delete on iOS
+ */
+#if 0
+# define HAVE_GL_ASSERT_NOERROR
+#endif
+
+#ifdef HAVE_GL_ASSERT_NOERROR
+# define GL_ASSERT_NOERROR() do { \
+ GLenum glError = vgl->vt.GetError(); \
+ switch (glError) \
+ { \
+ case GL_NO_ERROR: break; \
+ case GL_INVALID_ENUM: assert(!"GL_INVALID_ENUM"); \
+ case GL_INVALID_VALUE: assert(!"GL_INVALID_VALUE"); \
+ case GL_INVALID_OPERATION: assert(!"GL_INVALID_OPERATION"); \
+ case GL_INVALID_FRAMEBUFFER_OPERATION: assert(!"GL_INVALID_FRAMEBUFFER_OPERATION"); \
+ case GL_OUT_OF_MEMORY: assert(!"GL_OUT_OF_MEMORY"); \
+ default: assert(!"GL_UNKNOWN_ERROR"); \
+ } \
+} while(0)
+#else
+# define GL_ASSERT_NOERROR()
+#endif
+
/* Core OpenGL/OpenGLES functions: the following functions pointers typedefs
* are not defined. */
#if !defined(_WIN32) /* Already defined on Win32 */
diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
index 666314a28f..688717e78b 100644
--- a/modules/video_output/opengl/vout_helper.c
+++ b/modules/video_output/opengl/vout_helper.c
@@ -44,33 +44,6 @@
#define SPHERE_RADIUS 1.f
-/* FIXME: GL_ASSERT_NOERROR disabled for now because:
- * Proper GL error handling need to be implemented
- * glClear(GL_COLOR_BUFFER_BIT) throws a GL_INVALID_FRAMEBUFFER_OPERATION on macOS
- * assert fails on vout_display_opengl_Delete on iOS
- */
-#if 0
-# define HAVE_GL_ASSERT_NOERROR
-#endif
-
-#ifdef HAVE_GL_ASSERT_NOERROR
-# define GL_ASSERT_NOERROR() do { \
- GLenum glError = vgl->vt.GetError(); \
- switch (glError) \
- { \
- case GL_NO_ERROR: break; \
- case GL_INVALID_ENUM: assert(!"GL_INVALID_ENUM"); \
- case GL_INVALID_VALUE: assert(!"GL_INVALID_VALUE"); \
- case GL_INVALID_OPERATION: assert(!"GL_INVALID_OPERATION"); \
- case GL_INVALID_FRAMEBUFFER_OPERATION: assert(!"GL_INVALID_FRAMEBUFFER_OPERATION"); \
- case GL_OUT_OF_MEMORY: assert(!"GL_OUT_OF_MEMORY"); \
- default: assert(!"GL_UNKNOWN_ERROR"); \
- } \
-} while(0)
-#else
-# define GL_ASSERT_NOERROR()
-#endif
-
typedef struct {
GLuint texture;
GLsizei width;
More information about the vlc-commits
mailing list