1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:38:10 +00:00

LibWeb/WebGL: Implement WebGLRenderingContextBase.lineWidth()

This commit is contained in:
Luke Wilde 2022-06-13 16:55:21 +01:00 committed by Linus Groh
parent a6617e1096
commit d9ef228c76
3 changed files with 15 additions and 0 deletions

View file

@ -242,6 +242,19 @@ GLenum WebGLRenderingContextBase::get_error()
return m_context->gl_get_error();
}
void WebGLRenderingContextBase::line_width(GLfloat width)
{
if (m_context_lost)
return;
dbgln_if(WEBGL_CONTEXT_DEBUG, "WebGLRenderingContextBase::line_width(width={})", width);
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#NAN_LINE_WIDTH
// "In the WebGL API, if the width parameter passed to lineWidth is set to NaN, an INVALID_VALUE error is generated and the line width is not changed."
RETURN_WITH_WEBGL_ERROR_IF(isnan(width), GL_INVALID_VALUE);
m_context->gl_line_width(width);
}
void WebGLRenderingContextBase::polygon_offset(GLfloat factor, GLfloat units)
{
if (m_context_lost)