projects
/
andemo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed windows build
[andemo]
/
src
/
sanegl.c
diff --git
a/src/sanegl.c
b/src/sanegl.c
index
b22dadd
..
48c8f05
100644
(file)
--- a/
src/sanegl.c
+++ b/
src/sanegl.c
@@
-152,17
+152,17
@@
void gl_scalef(float x, float y, float z)
gl_mult_matrixf(mat);
}
gl_mult_matrixf(mat);
}
-void gl_ortho(float left, float right, float bottom, float top, float near, float far)
+void gl_ortho(float left, float right, float bottom, float top, float znear, float zfar)
{
float mat[] = MAT_IDENT;
float dx = right - left;
float dy = top - bottom;
{
float mat[] = MAT_IDENT;
float dx = right - left;
float dy = top - bottom;
- float dz = far - near;
+ float dz = zfar - znear;
float tx = -(right + left) / dx;
float ty = -(top + bottom) / dy;
float tx = -(right + left) / dx;
float ty = -(top + bottom) / dy;
- float tz = -(far + near) / dz;
+ float tz = -(zfar + znear) / dz;
float sx = 2.0 / dx;
float sy = 2.0 / dy;
float sx = 2.0 / dx;
float sy = 2.0 / dy;
@@
-178,21
+178,21
@@
void gl_ortho(float left, float right, float bottom, float top, float near, floa
gl_mult_matrixf(mat);
}
gl_mult_matrixf(mat);
}
-void gl_frustum(float left, float right, float bottom, float top, float near, float far)
+void gl_frustum(float left, float right, float bottom, float top, float znear, float zfar)
{
float mat[] = MAT_IDENT;
float dx = right - left;
float dy = top - bottom;
{
float mat[] = MAT_IDENT;
float dx = right - left;
float dy = top - bottom;
- float dz = far - near;
+ float dz = zfar - znear;
float a = (right + left) / dx;
float b = (top + bottom) / dy;
float a = (right + left) / dx;
float b = (top + bottom) / dy;
- float c = -(far + near) / dz;
- float d = -2.0 * far * near / dz;
+ float c = -(zfar + znear) / dz;
+ float d = -2.0 * zfar * znear / dz;
- mat[0] = 2.0 * near / dx;
- mat[5] = 2.0 * near / dy;
+ mat[0] = 2.0 * znear / dx;
+ mat[5] = 2.0 * znear / dy;
mat[8] = a;
mat[9] = b;
mat[10] = c;
mat[8] = a;
mat[9] = b;
mat[10] = c;
@@
-202,11
+202,11
@@
void gl_frustum(float left, float right, float bottom, float top, float near, fl
gl_mult_matrixf(mat);
}
gl_mult_matrixf(mat);
}
-void glu_perspective(float vfov, float aspect, float near, float far)
+void glu_perspective(float vfov, float aspect, float znear, float zfar)
{
float vfov_rad = M_PI * vfov / 180.0;
{
float vfov_rad = M_PI * vfov / 180.0;
- float x = near * tan(vfov_rad / 2.0);
- gl_frustum(-aspect * x, aspect * x, -x, x, near, far);
+ float x = znear * tan(vfov_rad / 2.0);
+ gl_frustum(-aspect * x, aspect * x, -x, x, znear, zfar);
}
void gl_apply_xform(unsigned int prog)
}
void gl_apply_xform(unsigned int prog)