diff options
| author | 2022-10-06 19:41:00 -0700 | |
|---|---|---|
| committer | 2022-10-06 19:41:00 -0700 | |
| commit | f9a6efcaa03728f43aaa105af8936c1ed4778388 (patch) | |
| tree | f3a4e90a94afc20d300e25a96fdc74c9c9c34c95 /glow/src/triangle | |
| parent | 72feba51bed41db0bc04b43167d5d3b43007fd44 (diff) | |
| download | iced-f9a6efcaa03728f43aaa105af8936c1ed4778388.tar.gz iced-f9a6efcaa03728f43aaa105af8936c1ed4778388.tar.bz2 iced-f9a6efcaa03728f43aaa105af8936c1ed4778388.zip  | |
Fixed some more imports/documentation.
Diffstat (limited to '')
| -rw-r--r-- | glow/src/triangle/gradient.rs | 5 | ||||
| -rw-r--r-- | glow/src/triangle/solid.rs | 15 | 
2 files changed, 11 insertions, 9 deletions
diff --git a/glow/src/triangle/gradient.rs b/glow/src/triangle/gradient.rs index 4b157890..a8bb5ec5 100644 --- a/glow/src/triangle/gradient.rs +++ b/glow/src/triangle/gradient.rs @@ -22,8 +22,7 @@ pub struct GradientUniformData {  struct GradientUniformLocations {      gradient_direction_location: <Context as HasContext>::UniformLocation,      color_stops_size_location: <Context as HasContext>::UniformLocation, -    //currently the maximum number of stops is 64 due to needing to allocate the -    //memory for the array of stops with a const value in GLSL +    //currently the maximum number of stops is 16 due to lack of SSBO in GL2.1      color_stops_location: <Context as HasContext>::UniformLocation,      transform_location: <Context as HasContext>::UniformLocation,  } @@ -140,7 +139,7 @@ impl GradientUniformData {          let transform_location =              unsafe { gl.get_uniform_location(program, "u_Transform") } -                .expect("Get transform location."); +                .expect("Gradient - Get u_Transform.");          GradientUniformData {              gradient: Gradient::Linear(Linear { diff --git a/glow/src/triangle/solid.rs b/glow/src/triangle/solid.rs index 3d4d1968..5ba7f91c 100644 --- a/glow/src/triangle/solid.rs +++ b/glow/src/triangle/solid.rs @@ -25,12 +25,12 @@ impl SolidUniformData {              color_location: unsafe {                  gl.get_uniform_location(program, "color")              } -                .expect("Solid - Color uniform location."), +            .expect("Solid - Get color."),              transform: Transformation::identity(),              transform_location: unsafe {                  gl.get_uniform_location(program, "u_Transform")              } -                .expect("Get transform location."), +            .expect("Solid - Get u_Transform."),          }      }  } @@ -74,10 +74,13 @@ impl SolidProgram {          }      } -    pub fn use_program(&mut self, gl: &Context, color: &Color, transform: &Transformation) { -        unsafe { -            gl.use_program(Some(self.program)) -        } +    pub fn use_program( +        &mut self, +        gl: &Context, +        color: &Color, +        transform: &Transformation, +    ) { +        unsafe { gl.use_program(Some(self.program)) }          self.write_uniforms(gl, color, transform)      }  }  | 
