Files
GDevelop/Core/GDCore/Tools/OpenGLTools.cpp
T
Florian Rival a8559bfbbc Add clang-format to format (C++) source files automatically (#491)
* Update all CMakeLists of extensions to use clang-format
* Run clang-format on all Extensions
* Update GDCore CMakeLists.txt to add clang-format
* Run clang-format on GDCore files
* Update GDJS and GDCpp CMakeLists.txt to add clang-format
* Run clang-format on GDCpp and GDJS files
2018-05-09 15:57:38 -07:00

20 lines
474 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);
}
} // namespace OpenGLTools