diff options
Diffstat (limited to 'glow/src/quad/compatibility.rs')
-rw-r--r-- | glow/src/quad/compatibility.rs | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/glow/src/quad/compatibility.rs b/glow/src/quad/compatibility.rs index 28ad214d..76f98ab7 100644 --- a/glow/src/quad/compatibility.rs +++ b/glow/src/quad/compatibility.rs @@ -1,4 +1,4 @@ -use crate::program; +use crate::program::{self, Shader}; use crate::Transformation; use glow::HasContext; use iced_graphics::layer; @@ -27,29 +27,23 @@ pub struct Pipeline { impl Pipeline { pub fn new( gl: &glow::Context, - (vertex_version, fragment_version): &(String, String), + shader_version: &program::Version, ) -> Pipeline { let program = unsafe { + let vertex_shader = Shader::vertex( + gl, + shader_version, + include_str!("../shader/compatibility/quad.vert"), + ); + let fragment_shader = Shader::fragment( + gl, + shader_version, + include_str!("../shader/compatibility/quad.frag"), + ); + program::create( gl, - &[ - ( - glow::VERTEX_SHADER, - &format!( - "{}\n{}", - vertex_version, - include_str!("../shader/compatibility/quad.vert") - ), - ), - ( - glow::FRAGMENT_SHADER, - &format!( - "{}\n{}", - fragment_version, - include_str!("../shader/compatibility/quad.frag") - ), - ), - ], + &[vertex_shader, fragment_shader], &[ (0, "i_Pos"), (1, "i_Scale"), |