mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-23 02:25:52 -04:00
a8559bfbbc
* 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
20 lines
474 B
C++
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
|