Replace magic constants in glow::triangle
This commit is contained in:
parent
33c3c0c0aa
commit
c81eaf5f8d
1 changed files with 6 additions and 3 deletions
|
|
@ -9,6 +9,9 @@ use iced_graphics::triangle::{ColoredVertex2D, Vertex2D};
|
||||||
use glow::HasContext;
|
use glow::HasContext;
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
|
const DEFAULT_VERTICES: usize = 1_000;
|
||||||
|
const DEFAULT_INDICES: usize = 1_000;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub(crate) struct Pipeline {
|
pub(crate) struct Pipeline {
|
||||||
indices: Buffer<u32>,
|
indices: Buffer<u32>,
|
||||||
|
|
@ -23,7 +26,7 @@ impl Pipeline {
|
||||||
gl,
|
gl,
|
||||||
glow::ELEMENT_ARRAY_BUFFER,
|
glow::ELEMENT_ARRAY_BUFFER,
|
||||||
glow::DYNAMIC_DRAW,
|
glow::DYNAMIC_DRAW,
|
||||||
1000,
|
DEFAULT_INDICES,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -366,7 +369,7 @@ mod solid {
|
||||||
gl,
|
gl,
|
||||||
glow::ARRAY_BUFFER,
|
glow::ARRAY_BUFFER,
|
||||||
glow::DYNAMIC_DRAW,
|
glow::DYNAMIC_DRAW,
|
||||||
1000,
|
super::DEFAULT_VERTICES,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -487,7 +490,7 @@ mod gradient {
|
||||||
gl,
|
gl,
|
||||||
glow::ARRAY_BUFFER,
|
glow::ARRAY_BUFFER,
|
||||||
glow::DYNAMIC_DRAW,
|
glow::DYNAMIC_DRAW,
|
||||||
1000,
|
super::DEFAULT_VERTICES,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue