mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-09-22 23:18:01 +03:00
3d: Implement MESH_BOTH attribute
It disables back-face culling.
This commit is contained in:
@@ -436,11 +436,16 @@ static void render_model(struct RE_instance *inst, struct RE_renderer *r, enum d
|
||||
|
||||
glBindVertexArray(mesh->vao);
|
||||
|
||||
if (mesh->flags & MESH_BOTH)
|
||||
glDisable(GL_CULL_FACE);
|
||||
|
||||
if (mesh->nr_indices)
|
||||
glDrawElements(GL_TRIANGLES, mesh->nr_indices, GL_UNSIGNED_SHORT, NULL);
|
||||
else
|
||||
glDrawArrays(GL_TRIANGLES, 0, mesh->nr_vertices);
|
||||
|
||||
if (mesh->flags & MESH_BOTH)
|
||||
glEnable(GL_CULL_FACE);
|
||||
glBindVertexArray(0);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user