From 25b5ca97c5e5597570360c37d7452662e0118a00 Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 13 Oct 2023 22:34:23 +0200 Subject: refactor(engine): make vertex buffer wrapper hold single buffer --- engine/src/renderer/mod.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'engine/src/renderer/mod.rs') 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(); -- cgit v1.2.3-18-g5258