diff options
author | Stephan Unverwerth <s.unverwerth@gmx.de> | 2021-05-13 21:33:17 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-13 22:24:42 +0200 |
commit | c2d84efaae6adea228d562800d7840f26726c441 (patch) | |
tree | 92d2be3b23e536991872748514f71f1cb20b522e /Userland/Libraries/LibGL | |
parent | 0833db08745f45e89d9ac14901336884b8662255 (diff) | |
download | serenity-c2d84efaae6adea228d562800d7840f26726c441.zip |
LibGfx+Demos: Make Matrix4x4 a true alias for Matrix<4,T>
Matrix4x4 was defined as a derived class of Matrix<N,T> before.
Furthermore, some code was duplicated and it was overall just messy.
This commit turns Matrix4x4 into a simple alias for Matrix<4,T>.
Diffstat (limited to 'Userland/Libraries/LibGL')
-rw-r--r-- | Userland/Libraries/LibGL/SoftwareGLContext.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibGL/SoftwareGLContext.cpp b/Userland/Libraries/LibGL/SoftwareGLContext.cpp index 2e0b051eed..e952dab48e 100644 --- a/Userland/Libraries/LibGL/SoftwareGLContext.cpp +++ b/Userland/Libraries/LibGL/SoftwareGLContext.cpp @@ -576,7 +576,7 @@ void SoftwareGLContext::gl_rotate(GLdouble angle, GLdouble x, GLdouble y, GLdoub FloatVector3 axis = { (float)x, (float)y, (float)z }; axis.normalize(); - auto rotation_mat = FloatMatrix4x4::rotate(axis, angle); + auto rotation_mat = Gfx::rotation_matrix(axis, static_cast<float>(angle)); if (m_current_matrix_mode == GL_MODELVIEW) m_model_view_matrix = m_model_view_matrix * rotation_mat; @@ -596,9 +596,9 @@ void SoftwareGLContext::gl_scale(GLdouble x, GLdouble y, GLdouble z) } if (m_current_matrix_mode == GL_MODELVIEW) { - m_model_view_matrix = m_model_view_matrix * FloatMatrix4x4::scale({ static_cast<float>(x), static_cast<float>(y), static_cast<float>(z) }); + m_model_view_matrix = m_model_view_matrix * Gfx::scale_matrix(FloatVector3 { static_cast<float>(x), static_cast<float>(y), static_cast<float>(z) }); } else if (m_current_matrix_mode == GL_PROJECTION) { - m_projection_matrix = m_projection_matrix * FloatMatrix4x4::scale({ static_cast<float>(x), static_cast<float>(y), static_cast<float>(z) }); + m_projection_matrix = m_projection_matrix * Gfx::scale_matrix(FloatVector3 { static_cast<float>(x), static_cast<float>(y), static_cast<float>(z) }); } m_error = GL_NO_ERROR; @@ -614,9 +614,9 @@ void SoftwareGLContext::gl_translate(GLdouble x, GLdouble y, GLdouble z) } if (m_current_matrix_mode == GL_MODELVIEW) { - m_model_view_matrix = m_model_view_matrix * FloatMatrix4x4::translate({ (float)x, (float)y, (float)z }); + m_model_view_matrix = m_model_view_matrix * Gfx::translation_matrix(FloatVector3 { (float)x, (float)y, (float)z }); } else if (m_current_matrix_mode == GL_PROJECTION) { - m_projection_matrix = m_projection_matrix * FloatMatrix4x4::translate({ (float)x, (float)y, (float)z }); + m_projection_matrix = m_projection_matrix * Gfx::translation_matrix(FloatVector3 { (float)x, (float)y, (float)z }); } m_error = GL_NO_ERROR; |