aboutsummaryrefslogtreecommitdiff
#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