#ifndef _TEXTURE_H_
#define _TEXTURE_H_

#include "getglut.h"

typedef struct {
	int size; /* Size of texture (pixels; must be square) */
	void* pixels; /* Pixel data (GL expects void *) */
	int memsize; /* Size in bytes */
	char* name; /* Filename */
	GLuint id; /* GL texture ID */
} texture;

void texture_prepare(int texcount);
texture* texture_frompnm(char* filename, int size);
void texture_use(texture* t);
long texture_memusage(void);

#endif
