Load shaders to shaders/
authorBernie Innocenti <bernie@codewiz.org>
Sat, 8 Jul 2017 16:21:51 +0000 (12:21 -0400)
committerBernie Innocenti <bernie@codewiz.org>
Sat, 8 Jul 2017 16:33:26 +0000 (12:33 -0400)
bounding_box.rs
lib.rs
mandelwow.rs
shaded_cube.rs

index d5fa4139654327557a7d225b150a98fa331e4b6e..a08246e6dfe179416710c80c38174391625a499b 100644 (file)
@@ -4,8 +4,8 @@ use glium::{Display, Program, Surface};
 use glium::index::{IndexBuffer, PrimitiveType};
 
 pub fn solid_fill_program(display: &Display) -> Program {
-    let vertex_shader_src = include_str!("solid.vert");
-    let fragment_shader_src = include_str!("solid.frag");
+    let vertex_shader_src = include_str!("shaders/solid.vert");
+    let fragment_shader_src = include_str!("shaders/solid.frag");
     Program::from_source(display, vertex_shader_src, fragment_shader_src, None).unwrap()
 }
 
diff --git a/lib.rs b/lib.rs
index 2afc947314b23b7e19db9faf87b937dbcc820594..98797f372eb1af0485144d2c6d2395b978bc70c3 100644 (file)
--- a/lib.rs
+++ b/lib.rs
@@ -1,5 +1,5 @@
 extern crate cgmath;
-#[macro_use(uniform,program,implement_vertex)]
+#[macro_use(uniform,implement_vertex)]
 extern crate glium;
 extern crate glutin;
 #[cfg(feature = "image")]
index e5c883ac8c7342564f1e49cf17cfd6f82f93f7fd..41f7e5d8cabf569f25e401253ae96f1b87e5e50d 100644 (file)
@@ -29,11 +29,11 @@ fn mand(cx: f32, cy: f32) -> [f32; 3] {
 */
 
 pub fn program(display: &glium::Display) -> glium::Program {
-    program!(display,
-        100 => {
-            vertex: include_str!("mandelwow.vert"),
-            fragment: include_str!("mandelwow.frag"),
-        }).unwrap()
+    Program::from_source(
+            display,
+            include_str!("shaders/mandelwow.vert"),
+            include_str!("shaders/mandelwow.frag"), None)
+        .unwrap()
 }
 
 fn mandel<U>(display: &glium::Display,
index eec0d16c7900fc1976a3c1d8bd8eb7afe1942267..9194d7c8a986002591983ded73d97027ccae1d8a 100644 (file)
@@ -3,8 +3,8 @@ use glium::{Display, Program, Surface};
 use glium::index::{IndexBuffer, PrimitiveType};
 
 pub fn shaded_program(display: &Display) -> Program {
-    let vertex_shader_src = include_str!("shaded.vert");
-    let fragment_shader_src = include_str!("shaded.frag");
+    let vertex_shader_src = include_str!("shaders/shaded.vert");
+    let fragment_shader_src = include_str!("shaders/shaded.frag");
     Program::from_source(display, vertex_shader_src, fragment_shader_src, None).unwrap()
 }