Add Uniform2f

This commit is contained in:
Ar13mis 2016-04-04 16:00:22 -06:00
parent b568b72d76
commit 86b1f4249a
2 changed files with 20 additions and 1 deletions

View file

@ -1019,6 +1019,25 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
self.Uniform1f(uniform, data[0]);
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform2f(&self,
uniform: Option<&WebGLUniformLocation>,
x: f32, y: f32) {
let uniform = match uniform {
Some(uniform) => uniform,
None => return,
};
match self.current_program.get() {
Some(ref program) if program.id() == uniform.program_id() => {},
_ => return self.webgl_error(InvalidOperation),
};
self.ipc_renderer
.send(CanvasMsg::WebGL(WebGLCommand::Uniform2f(uniform.id(), x, y)))
.unwrap()
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform4i(&self,
uniform: Option<&WebGLUniformLocation>,