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/block.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/block.h') diff --git a/src/block.h b/src/block.h index f55f784..ad81c47 100644 --- a/src/block.h +++ b/src/block.h @@ -2,12 +2,14 @@ #include "cglm/types.h" #include "glad/glad.h" #include "shader.h" +#include "texture.h" struct block { vec3 coords; GLuint _vao; GLuint _vbo; GLuint _ebo; + GLuint _tbo; int _vertex_count; mat4 model; float angle; @@ -21,7 +23,7 @@ struct block { * */ int block_init(vec3 pos, struct block* blk); -int block_draw(struct block* blk, struct shader* shader); +int block_draw(struct block* blk, struct shader* shader, struct texture* texture); void block_debug(struct block* blk); void block_update(struct block* blk); -- cgit