diff options
author | Mike Erwin <significant.bit@gmail.com> | 2017-03-22 00:27:17 +0300 |
---|---|---|
committer | Mike Erwin <significant.bit@gmail.com> | 2017-03-22 00:27:17 +0300 |
commit | 7aad5cf573a964753b37573c5a2ea12af5d5952a (patch) | |
tree | ef9cbae18c8240000ad6fb13822db3ebdcfed968 /source/blender/editors/include | |
parent | 20d02be6b81db1bb99df1e82cff1c2575db40ae4 (diff) |
OpenGL: generic inputs for new matrix API
For functions that expect a 4x4 matrix, you can pass in that, or array[16], or float*, or... Casting at each call site can get annoying, and obscures the logic.
The C11 section still needs work, but the non-C11 macros help on the system I tested on (Mac/clang).
Part of T49450
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/BIF_gl.h | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h index 218bb4b5219..3db9cc8c953 100644 --- a/source/blender/editors/include/BIF_gl.h +++ b/source/blender/editors/include/BIF_gl.h @@ -48,33 +48,6 @@ * */ void cpack(unsigned int x); -#ifdef WITH_GL_PROFILE_COMPAT -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) -# define glMultMatrixf(x) \ - glMultMatrixf(_Generic((x), \ - float *: (float *)(x), \ - float [16]: (float *)(x), \ - float (*)[4]: (float *)(x), \ - float [4][4]: (float *)(x), \ - const float *: (float *)(x), \ - const float [16]: (float *)(x), \ - const float (*)[4]: (float *)(x), \ - const float [4][4]: (float *)(x)) \ -) -# define glLoadMatrixf(x) \ - glLoadMatrixf(_Generic((x), \ - float *: (float *)(x), \ - float [16]: (float *)(x), \ - float (*)[4]: (float *)(x), \ - float [4][4]: (float *)(x)) \ -) -#else -# define glMultMatrixf(x) glMultMatrixf((float *)(x)) -# define glLoadMatrixf(x) glLoadMatrixf((float *)(x)) -#endif /* C11 */ -#endif /* WITH_GL_PROFILE_COMPAT */ - - /* hacking pointsize and linewidth */ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) # define glPointSize(f) glPointSize(U.pixelsize * _Generic((f), double: (float)(f), default: (f))) |