From: Bernie Innocenti Date: Sat, 8 Jul 2017 16:21:51 +0000 (-0400) Subject: Load shaders to shaders/ X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=4010a0433b1dfc4b85dc0c4386bc9e5e77d2cb62;p=mandelwow.git Load shaders to shaders/ --- diff --git a/bounding_box.rs b/bounding_box.rs index d5fa413..a08246e 100644 --- a/bounding_box.rs +++ b/bounding_box.rs @@ -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 2afc947..98797f3 100644 --- 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")] diff --git a/mandelwow.rs b/mandelwow.rs index e5c883a..41f7e5d 100644 --- a/mandelwow.rs +++ b/mandelwow.rs @@ -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(display: &glium::Display, diff --git a/shaded_cube.rs b/shaded_cube.rs index eec0d16..9194d7c 100644 --- a/shaded_cube.rs +++ b/shaded_cube.rs @@ -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() }