#ifndef _TEXTURE_H_
#define _TEXTURE_H_

#include <GL/gl.h>
#include <stdio.h>

/* Yep...there's not a lot to them at the moment */
typedef struct {
	GLuint id; /* GL texture ID */
} texture;

/* May return zero in some cases (e.g. bad texture) */
texture* texture_new(char* filename);
void texture_destroy(texture* this);

/* Can pass this a NULL to reset texturing */
inline static void texture_apply(texture* this) {
	glBindTexture(GL_TEXTURE_2D, (this ? this->id : 0));
}

#endif
