Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Uniform{1iv, 2f, 2fv} #10432

Merged
merged 3 commits into from Apr 6, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

Added Uniform2fv

  • Loading branch information
autrilla committed Apr 6, 2016
commit 36522ba9c3885b13029900af352b5dc35e4a682d
@@ -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>,
@@ -654,6 +654,7 @@ interface WebGLRenderingContextBase
void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
//void uniform2fv(WebGLUniformLocation? location, Float32Array v);
//void uniform2fv(WebGLUniformLocation? location, sequence<GLfloat> v);
void uniform2fv(WebGLUniformLocation? location, optional object v);
//void uniform2i(WebGLUniformLocation? location, GLint x, GLint y);
//void uniform2iv(WebGLUniformLocation? location, Int32Array v);
//void uniform2iv(WebGLUniformLocation? location, sequence<long> v);
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.