Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2017-04-10 09:59:05 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-04-10 10:15:59 +0300
commit2482f9470632fb7fae6cd4e4f5d3e4c58fde1afc (patch)
treec6d03474f8363a160827ec845dc495de2b8e44c5 /source/blender/gpu/GPU_legacy_stubs.h
parent91056337a8e6a608c71aa1d8e73954882d21d308 (diff)
Expand OpenGL stubs to allow for breakpoints
Diffstat (limited to 'source/blender/gpu/GPU_legacy_stubs.h')
-rw-r--r--source/blender/gpu/GPU_legacy_stubs.h49
1 files changed, 43 insertions, 6 deletions
diff --git a/source/blender/gpu/GPU_legacy_stubs.h b/source/blender/gpu/GPU_legacy_stubs.h
index 33ac431566f..c1da1ec7cef 100644
--- a/source/blender/gpu/GPU_legacy_stubs.h
+++ b/source/blender/gpu/GPU_legacy_stubs.h
@@ -40,26 +40,57 @@
#if defined(__GNUC__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wunused-parameter"
+# pragma GCC diagnostic ignored "-Wunused-function"
#endif
#include "BLI_utildefines.h"
#define _GL_PREFIX static inline
+/**
+ * Empty function, use for breakpoint when a depreacated
+ * OpenGL function is called.
+ */
+static void gl_deprecated(void)
+{
+ BLI_assert(false);
+}
+
#define _GL_BOOL _GL_PREFIX GLboolean
-#define _GL_BOOL_RET { return false; }
+#define _GL_BOOL_RET { \
+ gl_deprecated(); \
+ return false; \
+}
+
#define _GL_ENUM _GL_PREFIX GLenum
-#define _GL_ENUM_RET { return 0; }
+#define _GL_ENUM_RET { \
+ gl_deprecated(); \
+ return 0; \
+}
+
#define _GL_INT _GL_PREFIX GLint
-#define _GL_INT_RET { return 0; }
+#define _GL_INT_RET { \
+ gl_deprecated(); \
+ return 0; \
+}
+
+
#define _GL_UINT _GL_PREFIX GLuint
-#define _GL_UINT_RET { return 0; }
+#define _GL_UINT_RET { \
+ gl_deprecated(); \
+ return 0; \
+}
+
#define _GL_VOID _GL_PREFIX void
-#define _GL_VOID_RET {}
+#define _GL_VOID_RET { \
+ gl_deprecated(); \
+}
static bool disable_enable_check(GLenum cap)
{
- return ELEM(cap,
+ const bool is_deprecated = \
+ ELEM(
+ cap,
GL_ALPHA_TEST,
GL_LINE_STIPPLE,
GL_POINT_SPRITE,
@@ -69,6 +100,12 @@ static bool disable_enable_check(GLenum cap)
GL_TEXTURE_GEN_T,
-1
);
+
+ if (is_deprecated) {
+ gl_deprecated();
+ }
+
+ return is_deprecated;
}
_GL_VOID USE_CAREFULLY_glDisable (GLenum cap)