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

Next

Added Uniform1iv

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