diff options
author | HampusM <hampus@hampusmat.com> | 2023-10-23 19:21:42 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2023-10-23 19:21:42 +0200 |
commit | bd427836bfa6f7228951c18e43058d3e35577702 (patch) | |
tree | 4d7276d7c7ded85362b3f199dbde2e9939481bfc /engine/src/renderer/mod.rs | |
parent | 54c0fd70f82eb1a6814872c78bc22380f438c9d1 (diff) |
refactor(engine): rename vertex buffer to buffer & make generic
Diffstat (limited to 'engine/src/renderer/mod.rs')
-rw-r--r-- | engine/src/renderer/mod.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/engine/src/renderer/mod.rs b/engine/src/renderer/mod.rs index 068b8f0..f31196d 100644 --- a/engine/src/renderer/mod.rs +++ b/engine/src/renderer/mod.rs @@ -5,11 +5,11 @@ use cstr::cstr; use glfw::WindowSize; use crate::object::Object; +use crate::opengl::buffer::{Buffer, Usage}; #[cfg(feature = "debug")] use crate::opengl::debug::{MessageSeverity, MessageSource, MessageType}; use crate::opengl::shader::Program as ShaderProgram; use crate::opengl::vertex_array::{PrimitiveKind, VertexArray}; -use crate::opengl::vertex_buffer::{BufferUsage, VertexBuffer}; use crate::opengl::{clear_buffers, BufferClearMask}; use crate::vector::Vec2; use crate::vertex::Vertex; @@ -123,7 +123,7 @@ pub struct Renderable vertex_arr: VertexArray, /// Vertex buffer has to live as long as the vertex array - _vertex_buffer: VertexBuffer, + _vertex_buffer: Buffer<Vertex>, } impl Renderable @@ -131,11 +131,11 @@ impl Renderable pub fn new(shader_program: ShaderProgram, vertices: &[Vertex]) -> Self { let vertex_arr = VertexArray::new(); - let vertex_buffer = VertexBuffer::new(); + let vertex_buffer = Buffer::new(); vertex_arr.bind(|vert_arr_curr_bound| { vertex_buffer.bind(|vert_buf_curr_bound| { - VertexBuffer::store(&vert_buf_curr_bound, vertices, BufferUsage::Static); + Buffer::store(&vert_buf_curr_bound, vertices, Usage::Static); VertexArray::configure_attrs(&vert_arr_curr_bound, &vert_buf_curr_bound); }); |