From 2472372886571bcc38893e2c2424ce4f198f16a7 Mon Sep 17 00:00:00 2001 From: tavo Date: Thu, 30 Oct 2025 23:19:33 -0600 Subject: [PATCH] works --- skr/skr.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/skr/skr.h b/skr/skr.h index 3b255b7..86f1e24 100644 --- a/skr/skr.h +++ b/skr/skr.h @@ -1009,7 +1009,24 @@ static inline void m_skr_gl_renderer_render(SkrState* s) { glUseProgram(mesh->Program->Backend.GL.ID); 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); + } } } }