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:
reimar 2005-09-09 17:08:26 +00:00
parent 904448cec5
commit 703189e5ea
1 changed files with 2 additions and 0 deletions

View File

@ -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);
}