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) {
|
2020-03-05 19:50:14 +00:00
|
|
|
GLfloat fW, fH;
|
2018-05-29 12:12:38 +00:00
|
|
|
|
2021-04-09 15:24:47 +00:00
|
|
|
fH = tanf(angle * (M_PI / 360.0f)) * znear;
|
2019-09-14 19:51:47 +00:00
|
|
|
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);
|
|
|
|
}
|