diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-04-14 15:13:38 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-04-14 19:07:16 +0300 |
commit | cb2c4bfb74ca7f385bbd8d7c3445a49a2d1b7b8d (patch) | |
tree | 516eb56f5d9247784a94f6d02d91ad247040f6a5 /source/blender/gpu/GPU_matrix.h | |
parent | e7c4eddace27272ba4d14f7e2fd0a39256e3c656 (diff) |
GPU Matrix API refactor: Stick to a single 4x4 stack for 2D and 3D
* Brings us closer to core profile, all matrices are working, and apart
from a problem with text drawing, Blender is working fine.
* Reduce the coding overhead of having to setup/teardown when
alternating between 2D and 3D drawing sessions.
* Gives us fewer modes and states we need to keep track of.
Unfortunatelly this also "rejects a fundamental change" the original
design was trying to make - that 2D is different from 3D and
deserves its own best implementation.
That said, it is still aligned with the function API design as
originally implemented (i.e., it still uses gpuTranslate2D, ...).
Finally, if you build with core profile and this patch you get:
https://developer.blender.org/F545352
[The text glitch is an unrelated issue].
Reviewers: merwin, sergey, brecht
Differential Revision: https://developer.blender.org/D2626
Diffstat (limited to 'source/blender/gpu/GPU_matrix.h')
-rw-r--r-- | source/blender/gpu/GPU_matrix.h | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/source/blender/gpu/GPU_matrix.h b/source/blender/gpu/GPU_matrix.h index 62b5b7f8ba5..4a47f55a6c6 100644 --- a/source/blender/gpu/GPU_matrix.h +++ b/source/blender/gpu/GPU_matrix.h @@ -69,12 +69,6 @@ typedef enum { MatrixMode gpuMatrixMode(void); -void gpuMatrixBegin2D(void); -void gpuMatrixBegin3D(void); -void gpuMatrixEnd(void); -/* TODO: gpuMatrixResume2D & gpuMatrixResume3D to switch modes but not reset stack */ - - /* ModelView Matrix (2D or 3D) */ void gpuPushMatrix(void); /* TODO: PushCopy vs PushIdentity? */ @@ -105,12 +99,7 @@ void gpuLookAt(float eyeX, float eyeY, float eyeZ, float centerX, float centerY, /* 2D ModelView Matrix */ -#if MATRIX_2D_4x4 void gpuMultMatrix2D(const float m[4][4]); -#else -void gpuLoadMatrix2D(const float m[3][3]); -void gpuMultMatrix2D(const float m[3][3]); -#endif void gpuTranslate2f(float x, float y); void gpuTranslate2fv(const float vec[2]); @@ -187,12 +176,7 @@ bool gpuMatricesDirty(void); /* since last bind */ # define gpuLoadProjectionMatrix3D(x) gpuLoadProjectionMatrix3D((const float (*)[4])(x)) -# if MATRIX_2D_4x4 # define gpuMultMatrix2D(x) gpuMultMatrix2D((const float (*)[4])(x)) -# else -# define gpuMultMatrix2D(x) gpuMultMatrix2D((const float (*)[3])(x)) -# define gpuLoadMatrix2D(x) gpuLoadMatrix2D((const float (*)[3])(x)) -# endif # define gpuGetModelViewMatrix3D(x) gpuGetModelViewMatrix3D((float (*)[4])(x)) # define gpuGetProjectionMatrix3D(x) gpuGetProjectionMatrix3D((float (*)[4])(x)) |