1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:57:43 +00:00

LibGL: Implement glScalef

This commit is contained in:
Jesse Buhagiar 2021-04-24 22:11:48 +10:00 committed by Andreas Kling
parent 55b3ecfbd3
commit ea0df0b5da
5 changed files with 24 additions and 0 deletions

View file

@ -594,6 +594,22 @@ void SoftwareGLContext::gl_rotate(GLdouble angle, GLdouble x, GLdouble y, GLdoub
m_error = GL_NO_ERROR;
}
void SoftwareGLContext::gl_scale(GLdouble x, GLdouble y, GLdouble z)
{
if (m_in_draw_state) {
m_error = GL_INVALID_OPERATION;
return;
}
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) });
} 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_error = GL_NO_ERROR;
}
void SoftwareGLContext::gl_translate(GLdouble x, GLdouble y, GLdouble z)
{
if (m_in_draw_state) {