helper ortho proj

This commit is contained in:
Recep Aslantas
2016-10-09 18:06:52 +03:00
parent a6f96de292
commit 2ebdfaeeaf

View File

@@ -90,6 +90,34 @@ glm_ortho_default(mat4 dest) {
}
}
CGLM_INLINE
void
glm_ortho_default_s(float size, mat4 dest) {
GLint rect[4];
float aspectRatio;
glm_platfom_get_viewport_rect(rect);
aspectRatio = (float)rect[2]/rect[3];
if (rect[2] >= rect[3]) {
glm_ortho(-size * aspectRatio,
size * aspectRatio,
-size,
size,
size + 100.0f,
-size - 100.0f,
dest);
} else {
glm_ortho(-size,
size,
-size / aspectRatio,
size / aspectRatio,
size + 100.0f,
-size - 100.0f,
dest);
}
}
CGLM_INLINE
void
glm_perspective(float fovy,