OpenGL: add gpuMatrixUpdate_legacy function

Marks matrix state as dirty so shader will use the latest values from glScale, glTranslate, etc.

We'll remove this after transitioning 100% to the new matrix API, which handles this sort of thing automatically.

Part of T49450
This commit is contained in:
Mike Erwin 2017-02-06 23:23:36 -05:00
parent d23c57b84c
commit 97fa285ae1
2 changed files with 11 additions and 0 deletions

View File

@ -133,6 +133,9 @@ const float *gpuGetNormalMatrixInverse(float m[3][3]);
#if SUPPORT_LEGACY_MATRIX
/* copy top matrix from each legacy stack into new fresh stack */
void gpuMatrixBegin3D_legacy(void);
/* call after using glScale, glTranslate, etc. between draw calls */
void gpuMatrixUpdate_legacy(void);
#endif

View File

@ -699,3 +699,11 @@ bool gpuMatricesDirty()
{
return state.dirty;
}
#if SUPPORT_LEGACY_MATRIX
void gpuMatrixUpdate_legacy()
{
BLI_assert(state.mode == MATRIX_MODE_INACTIVE);
state.dirty = true;
}
#endif