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

WebGL: add Uniform2f #10356

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

Always

Just for now

@@ -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>,
@@ -650,7 +650,7 @@ 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 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.