MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / DrawModelVerts

Function DrawModelVerts

Source/Graphics/model.cpp:1073–1086  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1071}
1072
1073void 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
1089void Model::Draw() {

Callers 1

DrawMethod · 0.85

Calls 9

createVBOMethod · 0.80
returnShaderAttribMethod · 0.80
BindArrayVBOMethod · 0.80
BindElementVBOMethod · 0.80
BindMethod · 0.45
DrawElementsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected