Skip to content

Commit

Permalink
Force rust fmt to respect the code formatting in this instance.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArjunNair committed Jun 14, 2024
1 parent e5a6afb commit 8ed4efb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/mix/triangle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ void main() {
out_color = vec4(color, 1.0);
}";

#[rustfmt::skip]
static VERTEX_DATA: [GLfloat; 18] = [
// position //rgb color
0.0, 0.5, 0.0, 0.0, 0.0, 1.0,
Expand Down Expand Up @@ -139,7 +140,7 @@ impl Triangle {
mem::transmute(&VERTEX_DATA[0]),
gl::STATIC_DRAW,
);

// Specify the layout of the vertex data
let c_position = CString::new("aPosition").unwrap();
let pos_attr = gl::GetAttribLocation(program, c_position.as_ptr());
Expand Down Expand Up @@ -171,13 +172,13 @@ impl Triangle {
pub fn draw(&self) {
unsafe {
// Use the VAO created previously
gl::BindVertexArray(self.vao);
gl::BindVertexArray(self.vao);
// Use shader program
gl::UseProgram(self.program);
// Draw a triangle from the 3 vertices
gl::DrawArrays(gl::TRIANGLES, 0, 3);
// Unbind the VAO
gl::BindVertexArray(0);
gl::BindVertexArray(0);
}
}
}
Expand Down

0 comments on commit 8ed4efb

Please sign in to comment.