diff options
| author | Aaditya Dhruv <[email protected]> | 2026-01-30 19:12:03 -0600 |
|---|---|---|
| committer | Aaditya Dhruv <[email protected]> | 2026-01-30 19:12:03 -0600 |
| commit | 1a721b98caf7559f4a18baa8d3b92269e8f1f6ce (patch) | |
| tree | 32be8966361f8f8ae74c6c0af226e39fe9feb375 /src/block.h | |
| parent | 4992ce0098cac8caef6c9315816b688d96259bce (diff) | |
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
Diffstat (limited to 'src/block.h')
| -rw-r--r-- | src/block.h | 4 |
1 files changed, 3 insertions, 1 deletions
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); |
