GLdc/GL/glu.c
2019-09-14 20:51:47 +01:00

18 lines
456 B
C

#include <math.h>
#include "private.h"
/* Set the Perspective */
void APIENTRY gluPerspective(GLfloat angle, GLfloat aspect,
GLfloat znear, GLfloat zfar) {
GLdouble fW, fH;
fH = tan(angle / 360 * F_PI) * znear;
fW = fH * aspect;
glFrustum(-fW, fW, -fH, fH, znear, zfar);
}
void APIENTRY gluOrtho2D(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top) {
glOrtho(left, right, bottom, top, -1.0f, 1.0f);
}