diff options
author | HampusM <hampus@hampusmat.com> | 2023-10-13 22:34:23 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-10-13 22:34:23 +0200 |
commit | 25b5ca97c5e5597570360c37d7452662e0118a00 (patch) | |
tree | be724d8a454faf955b6cdc59203b94a4a6ddeee0 /engine/src/renderer/mod.rs | |
parent | 4da06868266c12622207e2e61f92aee93c24aaf8 (diff) |
refactor(engine): make vertex buffer wrapper hold single buffer
Diffstat (limited to 'engine/src/renderer/mod.rs')
-rw-r--r-- | engine/src/renderer/mod.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/engine/src/renderer/mod.rs b/engine/src/renderer/mod.rs index bbcb5e9..364b7f4 100644 --- a/engine/src/renderer/mod.rs +++ b/engine/src/renderer/mod.rs @@ -4,12 +4,12 @@ use std::process::abort; use glfw::WindowSize; use crate::renderer::vertex_array::{PrimitiveKind, VertexArray}; -use crate::renderer::vertex_buffers::{BufferUsage, VertexBuffers}; +use crate::renderer::vertex_buffer::{BufferUsage, VertexBuffer}; use crate::vector::Vec2; use crate::vertex::Vertex; mod vertex_array; -mod vertex_buffers; +mod vertex_buffer; pub fn initialize(window: &glfw::Window) -> Result<(), Error> { @@ -56,7 +56,7 @@ pub struct Renderable vertex_arr: VertexArray, /// Vertex buffer has to live as long as the vertex array - _vertex_buffer: VertexBuffers<1>, + _vertex_buffer: VertexBuffer, } impl Renderable @@ -67,11 +67,9 @@ impl Renderable vertex_arr.bind(); - let vertex_buffer = VertexBuffers::<1>::new(); + let vertex_buffer = VertexBuffer::new(); - vertex_buffer - .store(0, vertices, BufferUsage::Static) - .unwrap(); + vertex_buffer.store(vertices, BufferUsage::Static); VertexArray::configure_attrs(); |