mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-25 12:25:52 -04:00
18 lines
371 B
C++
18 lines
371 B
C++
#include <SFML/OpenGL.hpp>
|
|
#include <cmath>
|
|
|
|
namespace OpenGLTools {
|
|
|
|
void GD_CORE_API PerspectiveGL( GLdouble fovY, GLdouble aspect, GLdouble zNear, GLdouble zFar )
|
|
{
|
|
const GLdouble pi = 3.1415926535897932384626433832795;
|
|
GLdouble fW, fH;
|
|
|
|
fH = std::tan( fovY / 360 * pi ) * zNear;
|
|
fW = fH * aspect;
|
|
|
|
glFrustum( -fW, fW, -fH, fH, zNear, zFar );
|
|
}
|
|
|
|
}
|