Use gl_texturemode for videos, fixes #491

.. and whatever else uses Draw_StretchRaw()
This commit is contained in:
Daniel Gibson 2019-12-21 05:11:15 +01:00
parent 1077b7525f
commit 9f5ee77c77
2 changed files with 8 additions and 4 deletions

View file

@ -501,8 +501,10 @@ RDraw_StretchRaw(int x, int y, int w, int h, int cols, int rows, byte *data)
0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, image8);
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Note: gl_filter_min could be GL_*_MIPMAP_* so we can't use it for min filter here (=> no mipmaps)
// but gl_filter_max (either GL_LINEAR or GL_NEAREST) should do the trick.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
glEnableClientState( GL_VERTEX_ARRAY );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );

View file

@ -378,8 +378,10 @@ GL3_Draw_StretchRaw(int x, int y, int w, int h, int cols, int rows, byte *data)
free(img);
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
// Note: gl_filter_min could be GL_*_MIPMAP_* so we can't use it for min filter here (=> no mipmaps)
// but gl_filter_max (either GL_LINEAR or GL_NEAREST) should do the trick.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
drawTexturedRectangle(x, y, w, h, 0.0f, 0.0f, 1.0f, 1.0f);