ecere/gfx/drivers/OpenGL: Added GLLoadMatrix()
authorJerome St-Louis <jerome@ecere.com>
Mon, 23 Feb 2015 14:03:27 +0000 (09:03 -0500)
committerJerome St-Louis <jerome@ecere.com>
Thu, 15 Oct 2015 00:19:30 +0000 (20:19 -0400)
ecere/src/gfx/drivers/OpenGLDisplayDriver.ec

index 4496421..ba9941c 100644 (file)
@@ -1291,6 +1291,18 @@ void (APIENTRY * glBufferDataARB) (GLenum target, int size, const GLvoid *data,
 
 static int currentVertexBuffer;
 
+public void GLLoadMatrix(Matrix matrix)
+{
+   float m[16] =
+   {
+      (float)matrix.m[0][0], (float)matrix.m[0][1], (float)matrix.m[0][2], (float)matrix.m[0][3],
+      (float)matrix.m[1][0], (float)matrix.m[1][1], (float)matrix.m[1][2], (float)matrix.m[1][3],
+      (float)matrix.m[2][0], (float)matrix.m[2][1], (float)matrix.m[2][2], (float)matrix.m[2][3],
+      (float)matrix.m[3][0], (float)matrix.m[3][1], (float)matrix.m[3][2], (float)matrix.m[3][3]
+   };
+   glLoadMatrixf(m);
+}
+
 bool GLSelectVBO(uint vbo)
 {
    if(currentVertexBuffer != vbo)