From 5bd3f95bfaa4301dfb632b1108c1f3f46403bf84 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Mon, 13 Apr 2020 04:27:08 -0400 Subject: [PATCH] stringly typed binding. UGH. fixed --- src/graphics_gl.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/graphics_gl.rs b/src/graphics_gl.rs index 1e13ebb550..0f27e7b223 100644 --- a/src/graphics_gl.rs +++ b/src/graphics_gl.rs @@ -43,14 +43,14 @@ void main() { static FRAGMENT_SHADER_SRC: &'static str = " #version 150 core -uniform vec3 triangleColor; -uniform sampler2D tex; - in vec3 Color; in vec2 Texcoord; out vec4 out_color; +//uniform vec3 triangleColor; +uniform sampler2D tex; + void main() { //out_color = vec4(1.0, 1.0, 1.0, 1.0); //out_color = vec4(triangleColor, 1.0); // Uniform @@ -220,10 +220,10 @@ pub fn run() { ); // Specify the layout of the vertex data - let pos_attr = gl::GetAttribLocation(program, CString::new("in_color").unwrap().as_ptr()); - gl::EnableVertexAttribArray(pos_attr as GLuint); + let color_attr = gl::GetAttribLocation(program, CString::new("in_color").unwrap().as_ptr()); + gl::EnableVertexAttribArray(color_attr as GLuint); gl::VertexAttribPointer( - pos_attr as GLuint, + color_attr as GLuint, 3, gl::FLOAT, gl::FALSE as GLboolean, @@ -232,7 +232,7 @@ pub fn run() { ); // Specify the layout of the vertex data - let tex_attr = gl::GetAttribLocation(program, CString::new("tex_coordinate").unwrap().as_ptr()); + let tex_attr = gl::GetAttribLocation(program, CString::new("tex_coord").unwrap().as_ptr()); gl::EnableVertexAttribArray(tex_attr as GLuint); gl::VertexAttribPointer( tex_attr as GLuint,