LibGL: Make MaterialFace a simple u8 enum

Now we don't need to use `to_underlying` everywhere.
This commit is contained in:
Jelle Raaijmakers 2022-01-13 02:59:46 +01:00 committed by Andreas Kling
parent 58e025ac08
commit c03b21f0ea
Notes: sideshowbarker 2024-07-17 20:59:54 +09:00
2 changed files with 9 additions and 9 deletions

View file

@ -3187,14 +3187,14 @@ void SoftwareGLContext::gl_materialf(GLenum face, GLenum pname, GLfloat param)
switch (face) {
case GL_FRONT:
m_material_states.at(to_underlying(MaterialFace::Front)).shininess = param;
m_material_states.at(MaterialFace::Front).shininess = param;
break;
case GL_BACK:
m_material_states.at(to_underlying(MaterialFace::Back)).shininess = param;
m_material_states.at(MaterialFace::Back).shininess = param;
break;
case GL_FRONT_AND_BACK:
m_material_states.at(to_underlying(MaterialFace::Front)).shininess = param;
m_material_states.at(to_underlying(MaterialFace::Back)).shininess = param;
m_material_states.at(MaterialFace::Front).shininess = param;
m_material_states.at(MaterialFace::Back).shininess = param;
break;
default:
VERIFY_NOT_REACHED();
@ -3236,14 +3236,14 @@ void SoftwareGLContext::gl_materialfv(GLenum face, GLenum pname, GLfloat const*
switch (face) {
case GL_FRONT:
update_material(m_material_states.at(to_underlying(MaterialFace::Front)), pname, params);
update_material(m_material_states.at(MaterialFace::Front), pname, params);
break;
case GL_BACK:
update_material(m_material_states.at(to_underlying(MaterialFace::Back)), pname, params);
update_material(m_material_states.at(MaterialFace::Back), pname, params);
break;
case GL_FRONT_AND_BACK:
update_material(m_material_states.at(to_underlying(MaterialFace::Front)), pname, params);
update_material(m_material_states.at(to_underlying(MaterialFace::Back)), pname, params);
update_material(m_material_states.at(MaterialFace::Front), pname, params);
update_material(m_material_states.at(MaterialFace::Back), pname, params);
break;
}

View file

@ -41,7 +41,7 @@ struct ContextParameter {
} value;
};
enum class MaterialFace : u8 {
enum MaterialFace : u8 {
Front = 0,
Back = 1,
};