| 1071 | } |
| 1072 | |
| 1073 | void DrawModelVerts(Model &model, const char *vert_attrib_str, Shaders *shaders, Graphics *graphics, int shader) { |
| 1074 | if (!model.vbo_loaded) { |
| 1075 | model.createVBO(); |
| 1076 | } |
| 1077 | model.VBO_vertices.Bind(); |
| 1078 | model.VBO_faces.Bind(); |
| 1079 | int vert_attrib_id = shaders->returnShaderAttrib(vert_attrib_str, shader); |
| 1080 | graphics->EnableVertexAttribArray(vert_attrib_id); |
| 1081 | glVertexAttribPointer(vert_attrib_id, 3, GL_FLOAT, false, 3 * sizeof(GLfloat), 0); |
| 1082 | graphics->DrawElements(GL_TRIANGLES, model.faces.size(), GL_UNSIGNED_INT, 0); |
| 1083 | graphics->ResetVertexAttribArrays(); |
| 1084 | graphics->BindArrayVBO(0); |
| 1085 | graphics->BindElementVBO(0); |
| 1086 | } |
| 1087 | |
| 1088 | // Draw model |
| 1089 | void Model::Draw() { |
no test coverage detected