aboutsummaryrefslogtreecommitdiff
path: root/09-september/tomcat/renderer/texture.h
diff options
context:
space:
mode:
Diffstat (limited to '09-september/tomcat/renderer/texture.h')
-rw-r--r--09-september/tomcat/renderer/texture.h30
1 files changed, 30 insertions, 0 deletions
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