diff --git a/include/cglm-cam.h b/include/cglm-cam.h index 0c32628..30159e6 100644 --- a/include/cglm-cam.h +++ b/include/cglm-cam.h @@ -13,6 +13,7 @@ #define glm_vcam_h #include "cglm.h" +#include "cglm-platform.h" #include CGLM_INLINE @@ -79,6 +80,19 @@ glm_perspective(float fovy, dest[3][2] = 2 * near * far / (near - far); } +CGLM_INLINE +void +glm_perspective_default(mat4 dest) { + GLint viewport[4]; + glGetIntegerv(GL_VIEWPORT, viewport); + + glm_perspective(M_PI_4, + (float)viewport[2]/viewport[3], + 0.01f, + 100.0f, + dest); +} + CGLM_INLINE void glm_lookat(vec3 eye,