Fix mesh attributes;
#include "graphics/mesh.h"
#include "graphics/graphics.h"
#include <stdlib.h>
+#include <stdio.h>
static void lovrMeshBindAttributes(Mesh* mesh) {
Shader* shader = lovrGraphicsGetShader();
@@ -17,7 +18,8 @@ static void lovrMeshBindAttributes(Mesh* mesh) {
vec_foreach(&mesh->format, attribute, i) {
int location = lovrShaderGetAttributeId(shader, attribute.name);
- if (location >= 0 && (mesh->enabledAttributes & (1 << i))) {
+ if (location >= 0) {
+ if (mesh->enabledAttributes & (1 << i)) {
glEnableVertexAttribArray(location);
if (attribute.type == MESH_INT) {
@@ -32,6 +34,7 @@ static void lovrMeshBindAttributes(Mesh* mesh) {
} else {
glDisableVertexAttribArray(location);
}
+ }
offset += sizeof(attribute.type) * attribute.count;
}
