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

LibGL: Implement glPolygonMode

Currently just sets the renderer option for what polygon mode we
want the rasterizer to draw in. GLQuake only uses `GL_FRONT_AND_BACK`
with `GL_FILL` )which implies both back and front facing triangles
are to be filled completely by the rasterizer), so keeping this as
a small stub is perfectly fine for now.
This commit is contained in:
Jesse Buhagiar 2021-08-17 22:00:39 +10:00 committed by Ali Mohammad Pur
parent f58e2350dc
commit 89eddb5bff
6 changed files with 23 additions and 0 deletions

View file

@ -1733,6 +1733,18 @@ void SoftwareGLContext::gl_color_mask(GLboolean red, GLboolean green, GLboolean
m_rasterizer.set_options(options);
}
void SoftwareGLContext::gl_polygon_mode(GLenum face, GLenum mode)
{
RETURN_WITH_ERROR_IF(!(face == GL_BACK || face == GL_FRONT || face == GL_FRONT_AND_BACK), GL_INVALID_ENUM);
RETURN_WITH_ERROR_IF(!(mode == GL_POINT || mode == GL_LINE || mode == GL_FILL), GL_INVALID_ENUM);
RETURN_WITH_ERROR_IF(m_in_draw_state, GL_INVALID_OPERATION);
auto options = m_rasterizer.options();
options.polygon_mode = mode;
m_rasterizer.set_options(options);
}
void SoftwareGLContext::present()
{
m_rasterizer.blit_to(*m_frontbuffer);