works
This commit is contained in:
parent
0c374728fd
commit
2472372886
1 changed files with 18 additions and 1 deletions
19
skr/skr.h
19
skr/skr.h
|
|
@ -1009,7 +1009,24 @@ static inline void m_skr_gl_renderer_render(SkrState* s) {
|
||||||
|
|
||||||
glUseProgram(mesh->Program->Backend.GL.ID);
|
glUseProgram(mesh->Program->Backend.GL.ID);
|
||||||
glBindVertexArray(mesh->VAO);
|
glBindVertexArray(mesh->VAO);
|
||||||
glDrawArrays(GL_TRIANGLES, 0, mesh->VertexCount);
|
|
||||||
|
if (model->Textures && model->TextureCount > 0) {
|
||||||
|
for (unsigned int t = 0;
|
||||||
|
t < model->TextureCount; ++t) {
|
||||||
|
glActiveTexture(GL_TEXTURE0 + t);
|
||||||
|
glBindTexture(GL_TEXTURE_2D,
|
||||||
|
model->Textures[t]
|
||||||
|
.Backend.GL.ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mesh->IndexCount > 0) {
|
||||||
|
glDrawElements(GL_TRIANGLES, mesh->IndexCount,
|
||||||
|
GL_UNSIGNED_INT, 0);
|
||||||
|
} else {
|
||||||
|
glDrawArrays(GL_TRIANGLES, 0,
|
||||||
|
mesh->VertexCount);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue