From 1a721b98caf7559f4a18baa8d3b92269e8f1f6ce Mon Sep 17 00:00:00 2001 From: Aaditya Dhruv Date: Fri, 30 Jan 2026 19:12:03 -0600 Subject: Add basic block textures - Remove the code that sent colors through uniform variables, instead send texture data - Each vertex now has a texture coordinate - struct texture is a easy way to represent textures, can be extended later - Shaders updated to use textures --- src/chunk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/chunk.c') diff --git a/src/chunk.c b/src/chunk.c index 4918d22..3a7b334 100644 --- a/src/chunk.c +++ b/src/chunk.c @@ -147,7 +147,7 @@ void chunk_load(struct chunk *chunk, int coord[2]) { } } -void chunk_draw(struct chunk* chunk, struct shader* shader) { +void chunk_draw(struct chunk* chunk, struct shader* shader, struct texture* texture) { int counter = 0; for (int i = 0; i < CHUNK_WIDTH; i++) { for (int j = 0; j < CHUNK_LENGTH; j++) { @@ -156,7 +156,7 @@ void chunk_draw(struct chunk* chunk, struct shader* shader) { if (blk == NULL) { continue; } - block_draw(blk, shader); + block_draw(blk, shader, texture); counter += 1; } } -- cgit