aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoruser <email>2017-12-14 11:43:06 +0100
committeruser <email>2017-12-14 11:43:06 +0100
commit963551ee6e99e069fca8eed47151f4caf628507e (patch)
tree0911fb9030d78228da4b51bdb51c70ae955b2f14 /src
parent69c8fa409a6eed0c6b041d288d40e25b4dbda740 (diff)
downloadraylib-963551ee6e99e069fca8eed47151f4caf628507e.tar.gz
raylib-963551ee6e99e069fca8eed47151f4caf628507e.zip
added possibility to get modelview matrix from rlgl to be able to send it to shaders
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.c6
-rw-r--r--src/rlgl.h2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/rlgl.c b/src/rlgl.c
index cdce92d0..5db6f1cc 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -2539,6 +2539,12 @@ void SetMatrixModelview(Matrix view)
#endif
}
+Matrix GetMatrixModelview() {
+#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
+ return modelview;
+#endif
+}
+
// Generate cubemap texture from HDR texture
// TODO: OpenGL ES 2.0 does not support GL_RGB16F texture format, neither GL_DEPTH_COMPONENT24
Texture2D GenTextureCubemap(Shader shader, Texture2D skyHDR, int size)
diff --git a/src/rlgl.h b/src/rlgl.h
index 90d6a71b..a54a912f 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -461,6 +461,8 @@ void SetShaderValuei(Shader shader, int uniformLoc, const int *value, int size);
void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4)
void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix)
void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix)
+Matrix GetMatrixModelview();
+
// Texture maps generation (PBR)
// NOTE: Required shaders should be provided