Added Uniform1iv

This commit is contained in:
Adrian Utrilla 2016-04-05 22:56:18 +02:00
parent 0d0e08638d
commit b48e0f2ba9
2 changed files with 23 additions and 1 deletions

View file

@ -1008,6 +1008,27 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
.unwrap()
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform1iv(&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::<i32>(data) {
if data.len() < 1 {
return self.webgl_error(InvalidOperation);
}
self.Uniform1i(uniform, data[0]);
} else {
self.webgl_error(InvalidValue);
}
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform1fv(&self,
uniform: Option<&WebGLUniformLocation>,