mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:37:37 +00:00
LibGL: Implement glShadeModel()
This turns off interpolation of vertex colors when GL_FLAT is selected.
This commit is contained in:
parent
26953c2be1
commit
da57563c1c
7 changed files with 51 additions and 6 deletions
|
@ -925,6 +925,23 @@ void SoftwareGLContext::gl_blend_func(GLenum src_factor, GLenum dst_factor)
|
|||
m_rasterizer.set_options(options);
|
||||
}
|
||||
|
||||
void SoftwareGLContext::gl_shade_model(GLenum mode)
|
||||
{
|
||||
if (m_in_draw_state) {
|
||||
m_error = GL_INVALID_OPERATION;
|
||||
return;
|
||||
}
|
||||
|
||||
if (mode != GL_FLAT && mode != GL_SMOOTH) {
|
||||
m_error = GL_INVALID_ENUM;
|
||||
return;
|
||||
}
|
||||
|
||||
auto options = m_rasterizer.options();
|
||||
options.shade_smooth = (mode == GL_SMOOTH);
|
||||
m_rasterizer.set_options(options);
|
||||
}
|
||||
|
||||
void SoftwareGLContext::present()
|
||||
{
|
||||
m_rasterizer.blit_to(*m_frontbuffer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue