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) {
|
2019-09-14 19:51:47 +00:00
|
|
|
GLdouble fW, fH;
|
2018-05-29 12:12:38 +00:00
|
|
|
|
2019-09-14 19:51:47 +00:00
|
|
|
fH = tan(angle / 360 * F_PI) * znear;
|
|
|
|
fW = fH * aspect;
|
2018-05-29 12:12:38 +00:00
|
|
|
|
2019-09-14 19:51:47 +00:00
|
|
|
glFrustum(-fW, fW, -fH, fH, znear, zfar);
|
2018-05-29 12:12:38 +00:00
|
|
|
}
|
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);
|
|
|
|
}
|