From 6b8af9cf83851c075c6c9514b1deaa931c2b19a4 Mon Sep 17 00:00:00 2001 From: Thomas Guillermo Albers Raviola Date: Fri, 16 Jan 2026 23:02:32 +0100 Subject: Initial commit --- 09-september/tomcat/renderer/texture.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 09-september/tomcat/renderer/texture.h (limited to '09-september/tomcat/renderer/texture.h') diff --git a/09-september/tomcat/renderer/texture.h b/09-september/tomcat/renderer/texture.h new file mode 100644 index 0000000..8288c72 --- /dev/null +++ b/09-september/tomcat/renderer/texture.h @@ -0,0 +1,30 @@ +#ifndef TEXTURE_H +#define TEXTURE_H + +#include "../shared.h" + +typedef struct _Texture +{ + GLuint tex_id; + GLenum type; + + int number_of_rows; /* used for texture atlases */ + + char _name[MAX_PATH_LENGTH]; + unsigned int hash_; + struct _Texture *_hash_next; /* linked list for storing on hash table */ + +} Texture; + +extern Texture *texture_new(const char *name); +extern Texture *texture_with_name_new(const char *name, const char *path); + +extern Texture *texture_cubemap_new(const char *paths[6]); +extern Texture *texture_cubemap_with_name_new(const char *name, const char *paths[6]); + +extern Texture *texture_get(const char *name); +extern void texture_bind(Texture *tex, int slot); + +extern void texture_purge(Texture *tex); /* Clean the texture without freeing the container */ + +#endif // TEXTURE_H -- cgit v1.2.3