2018-05-29 12:12:38 +00:00
|
|
|
#include <math.h>
|
|
|
|
#include "private.h"
|
|
|
|
|
|
|
|
/* Set the Perspective */
|
2018-05-29 18:39:27 +00:00
|
|
|
void APIENTRY gluPerspective(GLfloat angle, GLfloat aspect,
|
2018-05-29 12:12:38 +00:00
|
|
|
GLfloat znear, GLfloat zfar) {
|
|
|
|
GLfloat xmin, xmax, ymin, ymax;
|
|
|
|
|
|
|
|
ymax = znear * tanf(angle * F_PI / 360.0f);
|
|
|
|
ymin = -ymax;
|
|
|
|
xmin = ymin * aspect;
|
|
|
|
xmax = ymax * aspect;
|
|
|
|
|
|
|
|
glFrustum(xmin, xmax, ymin, ymax, znear, zfar);
|
|
|
|
}
|
2018-05-29 18:39:27 +00:00
|
|
|
|
|
|
|
void APIENTRY gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) {
|
|
|
|
glOrtho(left, right, bottom, top, -1.0f, 1.0f);
|
|
|
|
}
|