+ //tesselatePolygon(i->tesselator_line, z, line);
+}
+
+typedef struct _gfxhash
+{
+ unsigned char d[16];
+} gfxhash_t;
+
+char gfxhash_compare(gfxhash_t*h1, gfxhash_t*h2)
+{
+ return !memcmp(h1->d, h2->d, 16);
+}
+
+typedef struct _imgopengl
+{
+ gfxhash_t hash;
+ GLuint texID;
+ int width, height;
+ struct _imgopengl*next;
+} imgopengl_t;
+
+imgopengl_t*img2texid = 0;
+
+gfxhash_t gfximage_hash(gfximage_t*img)
+{
+ int t;
+ int size = img->width*img->height*4;
+ U8*data = (U8*)img->data;
+ gfxhash_t hash;
+ hash_md5(data, size, hash.d);
+ return hash;
+}
+
+imgopengl_t*addTexture(gfximage_t*img)
+{
+ gfxhash_t hash = gfximage_hash(img);
+ imgopengl_t*i = img2texid;
+