mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 10:27:35 +00:00
LibGL: Stub GL_BACK
implementation for glPolygonMode
This prevents overwriting the front face mode when providing `GL_BACK` as a parameter.
This commit is contained in:
parent
453f62c935
commit
c5abef86db
1 changed files with 17 additions and 10 deletions
|
@ -2548,18 +2548,25 @@ void SoftwareGLContext::gl_polygon_mode(GLenum face, GLenum mode)
|
||||||
auto options = m_rasterizer.options();
|
auto options = m_rasterizer.options();
|
||||||
|
|
||||||
// FIXME: This must support different polygon modes for front- and backside
|
// FIXME: This must support different polygon modes for front- and backside
|
||||||
switch (mode) {
|
if (face == GL_BACK) {
|
||||||
case GL_POINT:
|
dbgln_if(GL_DEBUG, "gl_polygon_mode(GL_BACK, {:#x}): unimplemented", mode);
|
||||||
options.polygon_mode = SoftGPU::PolygonMode::Point;
|
return;
|
||||||
break;
|
|
||||||
case GL_LINE:
|
|
||||||
options.polygon_mode = SoftGPU::PolygonMode::Line;
|
|
||||||
break;
|
|
||||||
case GL_FILL:
|
|
||||||
options.polygon_mode = SoftGPU::PolygonMode::Fill;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto map_mode = [](GLenum mode) -> SoftGPU::PolygonMode {
|
||||||
|
switch (mode) {
|
||||||
|
case GL_FILL:
|
||||||
|
return SoftGPU::PolygonMode::Fill;
|
||||||
|
case GL_LINE:
|
||||||
|
return SoftGPU::PolygonMode::Line;
|
||||||
|
case GL_POINT:
|
||||||
|
return SoftGPU::PolygonMode::Point;
|
||||||
|
default:
|
||||||
|
VERIFY_NOT_REACHED();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
options.polygon_mode = map_mode(mode);
|
||||||
m_rasterizer.set_options(options);
|
m_rasterizer.set_options(options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue