Implement WebGL getFramebufferAttachmentParameter API

This commit is contained in:
Igor Gutorov 2018-03-14 20:41:36 +02:00
parent f92f0809f8
commit ee5bdbbd8b
10 changed files with 338 additions and 110 deletions

View file

@ -750,6 +750,8 @@ impl WebGLImpl {
Self::active_uniform(ctx.gl(), program_id, index, chan),
WebGLCommand::GetAttribLocation(program_id, name, chan) =>
Self::attrib_location(ctx.gl(), program_id, name, chan),
WebGLCommand::GetFramebufferAttachmentParameter(target, attachment, pname, chan) =>
Self::get_framebuffer_attachment_parameter(ctx.gl(), target, attachment, pname, chan),
WebGLCommand::GetVertexAttrib(index, pname, chan) =>
Self::vertex_attrib(ctx.gl(), index, pname, chan),
WebGLCommand::GetVertexAttribOffset(index, pname, chan) =>
@ -1165,6 +1167,18 @@ impl WebGLImpl {
chan.send(gl.get_string(gl::EXTENSIONS)).unwrap();
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.6
fn get_framebuffer_attachment_parameter(
gl: &gl::Gl,
target: u32,
attachment: u32,
pname: u32,
chan: WebGLSender<i32>
) {
let parameter = gl.get_framebuffer_attachment_parameter_iv(target, attachment, pname);
chan.send(parameter).unwrap();
}
fn uniform_location(gl: &gl::Gl,
program_id: WebGLProgramId,
name: String,