From d9bc1cc503c9a579dab263ed358a066053dbb495 Mon Sep 17 00:00:00 2001 From: HampusM Date: Sat, 21 Mar 2026 15:26:06 +0100 Subject: refactor(engine): pass vertex component count in vertex attrib format --- engine/src/renderer/opengl/graphics_mesh.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'engine/src') diff --git a/engine/src/renderer/opengl/graphics_mesh.rs b/engine/src/renderer/opengl/graphics_mesh.rs index 8e0e3cc..62dadb8 100644 --- a/engine/src/renderer/opengl/graphics_mesh.rs +++ b/engine/src/renderer/opengl/graphics_mesh.rs @@ -1,6 +1,7 @@ use opengl_bindings::CurrentContextWithFns as GlCurrentContextWithFns; use opengl_bindings::buffer::{Buffer as GlBuffer, Usage as GlBufferUsage}; use opengl_bindings::vertex_array::{ + AttributeFormat as GlVertexArrayAttributeFormat, DataType as GlVertexArrayDataType, VertexArray as GlVertexArray, }; @@ -64,11 +65,16 @@ impl GraphicsMesh vertex_arr.set_attrib_format( current_context, attrib.index, - match attrib.component_type { - VertexAttributeComponentType::Float => GlVertexArrayDataType::Float, + GlVertexArrayAttributeFormat { + data_type: match attrib.component_type { + VertexAttributeComponentType::Float => { + GlVertexArrayDataType::Float + } + }, + count: attrib.component_cnt as u8, + normalized: false, + offset, }, - false, - offset, ); vertex_arr.set_attrib_vertex_buf_binding(current_context, attrib.index, 0); -- cgit v1.2.3-18-g5258