Possible to reload shaders
@@ -36,7 +36,7 @@ fn main() {
let gl = gl::Gl::load_with(|s| video_ctx.gl_get_proc_address(s) as *const std::os::raw::c_void);
// set up shader program
- let shader_program = program::Program::from_resource(
+ let mut shader_program = program::Program::from_resource(
&gl, "assets/shaders/triangle"
).unwrap();
@@ -117,6 +117,13 @@ fn main() {
Event::Quit {..} | Event::KeyDown {keycode: Some(Keycode::Escape), ..} => {
process::exit(1);
},
+ Event::KeyDown {keycode: Some(Keycode::R), ..} => {
+ shader_program = program::Program::from_resource(
+ &gl, "assets/shaders/triangle"
+ ).unwrap();
+
+ shader_program.set_used();
+ },
_ => {}
}
}
