mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/WebGL: Implement getRenderbufferParameter()
This commit is contained in:
parent
9375660b64
commit
82dfa69e4e
Notes:
github-actions[bot]
2025-11-27 14:53:23 +00:00
Author: https://github.com/gmta
Commit: 82dfa69e4e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6941
3 changed files with 28 additions and 1 deletions
|
|
@ -1604,6 +1604,32 @@ Optional<String> WebGLRenderingContextImpl::get_program_info_log(GC::Root<WebGLP
|
|||
return String::from_utf8_without_validation(ReadonlyBytes { info_log.data(), static_cast<size_t>(info_log_length - 1) });
|
||||
}
|
||||
|
||||
JS::Value WebGLRenderingContextImpl::get_renderbuffer_parameter(WebIDL::UnsignedLong target, WebIDL::UnsignedLong pname)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
||||
switch (pname) {
|
||||
case GL_RENDERBUFFER_WIDTH:
|
||||
case GL_RENDERBUFFER_HEIGHT:
|
||||
case GL_RENDERBUFFER_INTERNAL_FORMAT:
|
||||
case GL_RENDERBUFFER_RED_SIZE:
|
||||
case GL_RENDERBUFFER_GREEN_SIZE:
|
||||
case GL_RENDERBUFFER_BLUE_SIZE:
|
||||
case GL_RENDERBUFFER_ALPHA_SIZE:
|
||||
case GL_RENDERBUFFER_DEPTH_SIZE:
|
||||
case GL_RENDERBUFFER_SAMPLES:
|
||||
case GL_RENDERBUFFER_STENCIL_SIZE: {
|
||||
GLint result = 0;
|
||||
glGetRenderbufferParameteriv(target, pname, &result);
|
||||
return JS::Value(result);
|
||||
}
|
||||
default:
|
||||
// If pname is not in the table above, generates an INVALID_ENUM error.
|
||||
set_error(GL_INVALID_ENUM);
|
||||
return JS::js_null();
|
||||
}
|
||||
}
|
||||
|
||||
JS::Value WebGLRenderingContextImpl::get_shader_parameter(GC::Root<WebGLShader> shader, WebIDL::UnsignedLong pname)
|
||||
{
|
||||
m_context->make_current();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue