summaryrefslogtreecommitdiff
path: root/engine/src
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2026-03-21 15:26:06 +0100
committerHampusM <hampus@hampusmat.com>2026-03-21 15:26:06 +0100
commitd9bc1cc503c9a579dab263ed358a066053dbb495 (patch)
treeb45ac903cd129828d38a0f630b1ee2b286947a85 /engine/src
parent292217e0a7d5555b8c5534477869afcb5cd021e3 (diff)
refactor(engine): pass vertex component count in vertex attrib formatHEADmaster
Diffstat (limited to 'engine/src')
-rw-r--r--engine/src/renderer/opengl/graphics_mesh.rs14
1 files changed, 10 insertions, 4 deletions
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);