mirror of https://github.com/mpv-player/mpv
Set texture border color to avoid weird border colors in some rare cases.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16438 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
904448cec5
commit
703189e5ea
|
@ -285,6 +285,7 @@ static void getFunctions() {
|
|||
*/
|
||||
void glCreateClearTex(GLenum target, GLenum fmt, GLint filter,
|
||||
int w, int h, char val) {
|
||||
GLfloat border[4] = {val, val, val, val};
|
||||
GLenum clrfmt = (fmt == GL_ALPHA) ? GL_ALPHA : GL_LUMINANCE;
|
||||
char *init = (char *)malloc(w * h);
|
||||
memset(init, val, w * h);
|
||||
|
@ -296,6 +297,7 @@ void glCreateClearTex(GLenum target, GLenum fmt, GLint filter,
|
|||
glTexParameteri(target, GL_TEXTURE_MAG_FILTER, filter);
|
||||
glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
glTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, border);
|
||||
free(init);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue