mirror of
https://github.com/griffi-gh/kubi.git
synced 2024-11-25 08:18:43 -06:00
use immut. buffers for primitives
This commit is contained in:
parent
0fa723fc00
commit
0b210eac5d
|
@ -51,7 +51,7 @@ fn main() {
|
|||
gap: 1.,
|
||||
elements: {
|
||||
let mut elements: Vec<Box<dyn UiElement>> = vec![];
|
||||
for i in 0..100 {
|
||||
for i in 0..10000 {
|
||||
elements.push(Box::new(ProgressBar {
|
||||
value: (instant.elapsed().as_secs_f32() + (i as f32 / 10.)).sin().powi(2),
|
||||
size: (UiSize::Auto, UiSize::Pixels(5.)),
|
||||
|
|
|
@ -59,11 +59,11 @@ pub(super) fn init_cube_primitive(
|
|||
display: NonSendSync<UniqueView<Renderer>>
|
||||
) {
|
||||
{
|
||||
let vert = VertexBuffer::new(
|
||||
let vert = VertexBuffer::immutable(
|
||||
&display.display,
|
||||
CUBE_VERTICES
|
||||
).unwrap();
|
||||
let index = IndexBuffer::new(
|
||||
let index = IndexBuffer::immutable(
|
||||
&display.display,
|
||||
PrimitiveType::TrianglesList,
|
||||
CUBE_INDICES
|
||||
|
@ -71,11 +71,11 @@ pub(super) fn init_cube_primitive(
|
|||
storages.add_unique_non_send_sync(CubePrimitive(vert, index));
|
||||
}
|
||||
{
|
||||
let vert = VertexBuffer::new(
|
||||
let vert = VertexBuffer::immutable(
|
||||
&display.display,
|
||||
CENTERED_CUBE_VERTICES
|
||||
).unwrap();
|
||||
let index = IndexBuffer::new(
|
||||
let index = IndexBuffer::immutable(
|
||||
&display.display,
|
||||
PrimitiveType::TrianglesList,
|
||||
CUBE_INDICES
|
||||
|
|
|
@ -18,11 +18,11 @@ pub(super) fn init_rect_primitive(
|
|||
storages: AllStoragesView,
|
||||
display: NonSendSync<UniqueView<Renderer>>
|
||||
) {
|
||||
let vert = VertexBuffer::new(
|
||||
let vert = VertexBuffer::immutable(
|
||||
&display.display,
|
||||
RECT_VERTEX
|
||||
).unwrap();
|
||||
let index = IndexBuffer::new(
|
||||
let index = IndexBuffer::immutable(
|
||||
&display.display,
|
||||
PrimitiveType::TrianglesList,
|
||||
RECT_INDEX
|
||||
|
|
Loading…
Reference in a new issue