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 vertexAttribPointer and disableVertexAttribArray support #375

Merged
merged 2 commits into from Aug 28, 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

webgl: Define a command for vertexAttribPointer().

gleam already had this, and we want to be using it instead of
vertex_attrib_pointer_f32.
  • Loading branch information
anholt committed Aug 28, 2016
commit 404c42fd63954f87b7e9e59e6b57258b66fd3ae4
@@ -548,6 +548,7 @@ pub enum WebGLCommand {
UniformMatrix4fv(i32, bool, Vec<f32>),
UseProgram(WebGLProgramId),
VertexAttrib(u32, f32, f32, f32, f32),
VertexAttribPointer(u32, i32, u32, bool, i32, u32),
VertexAttribPointer2f(u32, i32, bool, i32, u32),
Viewport(i32, i32, i32, i32),
TexImage2D(u32, i32, i32, i32, i32, u32, u32, Vec<u8>),
@@ -106,6 +106,7 @@ impl fmt::Debug for WebGLCommand {
UseProgram(..) => "UseProgram",
VertexAttrib(..) => "VertexAttrib",
VertexAttribPointer2f(..) => "VertexAttribPointer2f",
VertexAttribPointer(..) => "VertexAttribPointer",
Viewport(..) => "Viewport",
TexImage2D(..) => "TexImage2D",
TexParameteri(..) => "TexParameteri",
@@ -310,6 +311,8 @@ impl WebGLCommand {
gl::vertex_attrib_4f(attrib_id, x, y, z, w),
WebGLCommand::VertexAttribPointer2f(attrib_id, size, normalized, stride, offset) =>
gl::vertex_attrib_pointer_f32(attrib_id, size, normalized, stride, offset),
WebGLCommand::VertexAttribPointer(attrib_id, size, data_type, normalized, stride, offset) =>
gl::vertex_attrib_pointer(attrib_id, size, data_type, normalized, stride, offset),
WebGLCommand::Viewport(x, y, width, height) =>
gl::viewport(x, y, width, height),
WebGLCommand::TexImage2D(target, level, internal, width, height, format, data_type, data) =>
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.