- glBindTexture (GL_TEXTURE_2D, name);
- if (! screen_to_texture (mi->xgwa.screen, mi->window, 0, 0,
- mipmap_p, NULL, NULL, &iw, &ih, &tw, &th))
- exit (1);
-
- gp->max_tx = (GLfloat) iw / tw;
- gp->max_ty = (GLfloat) ih / th;
-
- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
- (mipmap_p ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR));
-
- /* remember time of last image change */
- gp->start_time = time ((time_t *) 0);
+ gp->mipmap_p = True;
+ load_texture_async (mi->xgwa.screen, mi->window,
+ *gp->glx_context, 0, 0, gp->mipmap_p,
+ name, image_loaded_cb, gp);