scale based on aspect ratio
This commit is contained in:
parent
49a13b8a95
commit
9ba5c849d6
@ -52,7 +52,8 @@ class ScreenSaver
|
|||||||
|
|
||||||
view_matrix.make_identity();
|
view_matrix.make_identity();
|
||||||
view_matrix.scale(m_height / cast(float)m_width, 1.0, 1.0);
|
view_matrix.scale(m_height / cast(float)m_width, 1.0, 1.0);
|
||||||
view_matrix.scale(0.35, 0.35, 0.35);
|
double scale = 0.35 * m_width * 1080.0 / (m_height * 1920.0);
|
||||||
|
view_matrix.scale(scale, scale, scale);
|
||||||
|
|
||||||
m_program.bind();
|
m_program.bind();
|
||||||
glUniformMatrix4fv(m_view_idx, 1, GL_TRUE, view_matrix.value_ptr);
|
glUniformMatrix4fv(m_view_idx, 1, GL_TRUE, view_matrix.value_ptr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user