Skip to content

Commit

Permalink
WIP standard GL matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
mardy committed May 20, 2024
1 parent a199a75 commit bd136bb
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/gc_gl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2558,14 +2558,33 @@ void glFrustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top,
tmp = 1.0f / (far - near);
mt[2][0] = 0.0f;
mt[2][1] = 0.0f;
mt[2][2] = -near * tmp;
mt[2][3] = -(far * near) * tmp;
mt[2][2] = -(far + near) * tmp;
mt[2][3] = -2.0 * (far * near) * tmp;
mt[3][0] = 0.0f;
mt[3][1] = 0.0f;
mt[3][2] = -1.0f;
mt[3][3] = 0.0f;

glMultMatrixf((float *)mt);

mt[0][0] = 1.0;
mt[0][1] = 0.0;
mt[0][2] = 0.0;
mt[0][3] = 0.0;
mt[1][0] = 0.0;
mt[1][1] = 1.0;
mt[1][2] = 0.0;
mt[1][3] = 0.0;
mt[2][0] = 0.0;
mt[2][1] = 0.0;
mt[2][2] = 0.5;
mt[2][3] = -0.5;
mt[3][0] = 0.0;
mt[3][1] = 0.0;
mt[3][2] = 0.0;
mt[3][3] = 1.0;

glMultMatrixf((float *)mt);
}

void glOrtho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble near_val, GLdouble far_val)
Expand Down

0 comments on commit bd136bb

Please sign in to comment.