Update to latest glow

This commit is contained in:
Héctor Ramón Jiménez 2020-05-21 19:50:53 +02:00
parent 2798d4935e
commit bbfb1c040c
3 changed files with 17 additions and 25 deletions

View File

@ -14,12 +14,15 @@ svg = []
[dependencies] [dependencies]
euclid = "0.20" euclid = "0.20"
glow = "0.4"
bytemuck = "1.2" bytemuck = "1.2"
glam = "0.8" glam = "0.8"
log = "0.4" log = "0.4"
glyph_brush = "0.6" glyph_brush = "0.6"
[dependencies.glow]
git = "https://github.com/grovesNL/glow"
rev = "722a850e972a69c3012fcb3687758eacbdac2823"
[dependencies.iced_native] [dependencies.iced_native]
version = "0.2" version = "0.2"
path = "../native" path = "../native"

View File

@ -31,13 +31,11 @@ impl Pipeline {
unsafe { unsafe {
gl.use_program(Some(program)); gl.use_program(Some(program));
gl.uniform_matrix_4_f32_slice( let matrix: [f32; 16] = Transformation::identity().into();
Some(0), gl.uniform_matrix_4_f32_slice(Some(&0), false, &matrix);
false,
&Transformation::identity().into(), gl.uniform_1_f32(Some(&1), 1.0);
); gl.uniform_1_f32(Some(&2), 0.0);
gl.uniform_1_f32(Some(1), 1.0);
gl.uniform_1_f32(Some(2), 0.0);
gl.use_program(None); gl.use_program(None);
} }
@ -80,11 +78,8 @@ impl Pipeline {
if transformation != self.current_transform { if transformation != self.current_transform {
unsafe { unsafe {
gl.uniform_matrix_4_f32_slice( let matrix: [f32; 16] = transformation.into();
Some(0), gl.uniform_matrix_4_f32_slice(Some(&0), false, &matrix);
false,
&transformation.into(),
);
self.current_transform = transformation; self.current_transform = transformation;
} }
@ -92,7 +87,7 @@ impl Pipeline {
if scale != self.current_scale { if scale != self.current_scale {
unsafe { unsafe {
gl.uniform_1_f32(Some(1), scale); gl.uniform_1_f32(Some(&1), scale);
} }
self.current_scale = scale; self.current_scale = scale;
@ -100,7 +95,7 @@ impl Pipeline {
if target_height != self.current_target_height { if target_height != self.current_target_height {
unsafe { unsafe {
gl.uniform_1_f32(Some(2), target_height as f32); gl.uniform_1_f32(Some(&2), target_height as f32);
} }
self.current_target_height = target_height; self.current_target_height = target_height;

View File

@ -41,11 +41,8 @@ impl Pipeline {
unsafe { unsafe {
gl.use_program(Some(program)); gl.use_program(Some(program));
gl.uniform_matrix_4_f32_slice( let transform: [f32; 16] = Transformation::identity().into();
Some(0), gl.uniform_matrix_4_f32_slice(Some(&0), false, &transform);
false,
&Transformation::identity().into(),
);
gl.use_program(None); gl.use_program(None);
} }
@ -177,11 +174,8 @@ impl Pipeline {
unsafe { unsafe {
if self.current_transform != transform { if self.current_transform != transform {
gl.uniform_matrix_4_f32_slice( let matrix: [f32; 16] = transform.into();
Some(0), gl.uniform_matrix_4_f32_slice(Some(&0), false, &matrix);
false,
&transform.into(),
);
self.current_transform = transform; self.current_transform = transform;
} }