diff options
author | M. Stoeckl <manuel.stoeckl93@gmail.com> | 2019-02-03 16:45:09 +0000 |
---|---|---|
committer | Christian Duerr <chrisduerr@users.noreply.github.com> | 2019-02-03 16:45:09 +0000 |
commit | 3f0d11381dd72f9ed3db040210293a2f7fa74ea3 (patch) | |
tree | e3347d4e1bb266550979dc0cc03890d1ab83cde7 /src | |
parent | 20f319860908c2fa86bba25bb1e7bf8ba1a464e1 (diff) | |
download | alacritty-3f0d11381dd72f9ed3db040210293a2f7fa74ea3.tar.gz alacritty-3f0d11381dd72f9ed3db040210293a2f7fa74ea3.zip |
Remove unused coordinate from rect shader
Diffstat (limited to 'src')
-rw-r--r-- | src/renderer/mod.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs index f743e4b9..1446fe3c 100644 --- a/src/renderer/mod.rs +++ b/src/renderer/mod.rs @@ -134,7 +134,7 @@ pub struct RectShaderProgram { // Program id id: GLuint, /// Rectangle color - u_col: GLint, + u_color: GLint, } #[derive(Copy, Debug, Clone)] @@ -720,7 +720,7 @@ impl QuadRenderer { gl::BindBuffer(gl::ARRAY_BUFFER, self.rect_vbo); // Position - gl::VertexAttribPointer(0, 3, gl::FLOAT, gl::FALSE, (size_of::<f32>() * 3) as _, ptr::null()); + gl::VertexAttribPointer(0, 2, gl::FLOAT, gl::FALSE, (size_of::<f32>() * 2) as _, ptr::null()); gl::EnableVertexAttribArray(0); } @@ -876,11 +876,11 @@ impl QuadRenderer { unsafe { // Setup vertices - let vertices: [f32; 12] = [ - x + width, y , 0.0, - x + width, y - height, 0.0, - x , y - height, 0.0, - x , y , 0.0, + let vertices: [f32; 8] = [ + x + width, y , + x + width, y - height, + x , y - height, + x , y , ]; // Load vertex data into array buffer @@ -1285,13 +1285,13 @@ impl RectShaderProgram { } // get uniform locations - let u_col = unsafe { - gl::GetUniformLocation(program, b"col\0".as_ptr() as *const _) + let u_color = unsafe { + gl::GetUniformLocation(program, b"color\0".as_ptr() as *const _) }; let shader = RectShaderProgram { id: program, - u_col, + u_color, }; unsafe { gl::UseProgram(0) } @@ -1302,7 +1302,7 @@ impl RectShaderProgram { fn set_color(&self, color: Rgb, alpha: f32) { unsafe { gl::Uniform4f( - self.u_col, + self.u_color, f32::from(color.r) / 255., f32::from(color.g) / 255., f32::from(color.b) / 255., |