- char *filename = 0;
- XRectangle geom;
- int iw=0, ih=0, tw=0, th=0;
- time_t start = time((time_t *) 0);
- time_t end;
-
- glBindTexture (GL_TEXTURE_2D, img->texid);
- if (! screen_to_texture (mi->xgwa.screen, mi->window,
- MI_WIDTH(mi)/2-1,
- MI_HEIGHT(mi)/2-1,
- mipmap_p, &filename, &geom, &iw, &ih, &tw, &th))
- exit(1);
- image_loaded_cb (filename, &geom, iw, ih, tw, th, img);
- if (filename) free (filename);
-
- /* Push the expire times of all images forward by the amount of time
- it took to load *this* image, so that we don't count image-loading
- time against image duration.
- */
- end = time((time_t *) 0);
- for (i = 0; i < ss->nimages; i++)
- ss->images[i]->expires += end - start;
+ int w = (MI_WIDTH(mi) / 2) - 1;
+ int h = (MI_HEIGHT(mi) / 2) - 1;
+ if (w <= 10) w = 10;
+ if (h <= 10) h = 10;
+ load_texture_async (mi->xgwa.screen, mi->window, *ss->glx_context, w, h,
+ mipmap_p, frame->loading.texid,
+ image_loaded_cb, frame);