#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);
}

}  // namespace OpenGLTools
