Added Uniform2fv

This commit is contained in:
Adrian Utrilla 2016-04-05 23:03:53 +02:00
parent 4ff131e14e
commit 36522ba9c3
2 changed files with 22 additions and 0 deletions

View file

@ -1059,6 +1059,27 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
.unwrap()
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform2fv(&self,
_cx: *mut JSContext,
uniform: Option<&WebGLUniformLocation>,
data: Option<*mut JSObject>) {
let data = match data {
Some(data) => data,
None => return self.webgl_error(InvalidValue),
};
if let Some(data) = array_buffer_view_to_vec_checked::<f32>(data) {
if data.len() < 2 {
return self.webgl_error(InvalidOperation);
}
self.Uniform2f(uniform, data[0], data[1]);
} else {
self.webgl_error(InvalidValue);
}
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform4i(&self,
uniform: Option<&WebGLUniformLocation>,