mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
resize helper for perspective
* when window resized we only change aspect ratio, so projection still keeps same
This commit is contained in:
@@ -153,6 +153,18 @@ glm_perspective_default(mat4 dest) {
|
|||||||
dest);
|
dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CGLM_INLINE
|
||||||
|
void
|
||||||
|
glm_perspective_resize(mat4 proj) {
|
||||||
|
int32_t rect[4];
|
||||||
|
|
||||||
|
if (proj[0][0] == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
glm_platfom_get_viewport_rect(rect);
|
||||||
|
proj[0][0] = (float)proj[1][1] * rect[3] / rect[2];
|
||||||
|
}
|
||||||
|
|
||||||
CGLM_INLINE
|
CGLM_INLINE
|
||||||
void
|
void
|
||||||
glm_lookat(vec3 eye,
|
glm_lookat(vec3 eye,
|
||||||
|
|||||||
Reference in New Issue
Block a user