- GLenum f = (s->format->BitsPerPixel == 32) ? GL_RGBA : GL_RGB;
-
- glGenTextures(1, &fp->mv[i].o);
- glBindTexture(GL_TEXTURE_2D, fp->mv[i].o);
-
- if (k > 1)
- {
- /* Create a new buffer and copy the scaled image to it. */
-
- if ((d = image_scale(s, k)))
- {
- glTexImage2D(GL_TEXTURE_2D, 0, f, d->w, d->h, 0, f,
- GL_UNSIGNED_BYTE, d->pixels);
- SDL_FreeSurface(d);
- }
- }
- else
- glTexImage2D(GL_TEXTURE_2D, 0, f, s->w, s->h, 0, f,
- GL_UNSIGNED_BYTE, s->pixels);
-
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-