#ifndef __TEXTURE_H__
#define __TEXTURE_H__

#include <stdbool.h>

#include "graphics/GLIncludes.h"

typedef struct Texture Texture;

struct Image;
struct JSONNode;

struct Texture {
	struct Image * image;
	GLuint name;
	GLenum internalFormat;
	GLenum minFilter;
	GLenum magFilter;
	GLenum wrapS;
	GLenum wrapT;
	bool blend;
};

Texture * Texture_create();
void Texture_init(Texture * self);
void Texture_dispose(Texture * self);
void Texture_loadJSON(Texture * self, struct JSONNode * rootNode, const char * prefix);
void Texture_activate(Texture * self);
// Side effect: Disables GL_BLEND if it was on before the call to Texture_activate and the texture has alpha
void Texture_deactivate(Texture * self);

#endif
