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:
authorMike Erwin <significant.bit@gmail.com>2016-10-10 06:03:35 +0300
committerMike Erwin <significant.bit@gmail.com>2016-10-10 06:03:35 +0300
commit7a60f889d3f328e38aa882891cda615a06333ab6 (patch)
treef83e9f3e9df86f7d8da5027773acd980d6f7c94c /source/blender/gpu/GPU_matrix.h
parente636529e33a2a2dc7d9acfed44325e2b38be86ac (diff)
OpenGL: plug new matrix system into shaders (WIP)
Built-in shaders now use uniforms instead of legacy built-in matrices. So far I only hooked this up for new immediate mode. We use the same matrix naming convention as OpenGL, but without the gl_ prefix, e.g. gl_ModelView becomes ModelView. Right now it can skip the new matrix stack and use the legacy built-in matrices app-side. This will help us transition gradually from glMatrix functions to gpuMatrix functions. Still some work to do in gpuBindMatrices. See TODO comments in gpu_matrix.c for specifics.
Diffstat (limited to 'source/blender/gpu/GPU_matrix.h')
-rw-r--r--source/blender/gpu/GPU_matrix.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_matrix.h b/source/blender/gpu/GPU_matrix.h
index 13648fdc3bd..73566292799 100644
--- a/source/blender/gpu/GPU_matrix.h
+++ b/source/blender/gpu/GPU_matrix.h
@@ -115,6 +115,14 @@ bool gpuUnProject(const float win[3], const float model[4][4], const float proj[
void gpuOrtho2D(float left, float right, float bottom, float top);
+/* functions to get matrix values */
+const float *gpuGetModelViewMatrix3D(float m[4][4]);
+const float *gpuGetProjectionMatrix3D(float m[4][4]);
+const float *gpuGetModelViewProjectionMatrix3D(float m[4][4]);
+
+/* set uniform values for currently bound shader */
+void gpuBindMatrices(GLuint program);
+
#ifdef __cplusplus
}
#endif