Mercurial > mplayer.hg
comparison libvo/gl_common.c @ 16461:f93eaa5ad64d
Use GL_CLAMP_TO_EDGE instead of GL_CLAMP to avoid border texels being sampled.
This avoids some ugly effects when vo_gl2 uses multiple textures.
(Note to self: read the specs instead of just copying the old code!).
author | reimar |
---|---|
date | Mon, 12 Sep 2005 15:15:28 +0000 |
parents | ec7036dedee4 |
children | 01d27e023ae4 |
comparison
equal
deleted
inserted
replaced
16460:ec7036dedee4 | 16461:f93eaa5ad64d |
---|---|
294 glPixelStorei(GL_UNPACK_ROW_LENGTH, w); | 294 glPixelStorei(GL_UNPACK_ROW_LENGTH, w); |
295 glTexImage2D(target, 0, fmt, w, h, 0, clrfmt, GL_UNSIGNED_BYTE, init); | 295 glTexImage2D(target, 0, fmt, w, h, 0, clrfmt, GL_UNSIGNED_BYTE, init); |
296 glTexParameterf(target, GL_TEXTURE_PRIORITY, 1.0); | 296 glTexParameterf(target, GL_TEXTURE_PRIORITY, 1.0); |
297 glTexParameteri(target, GL_TEXTURE_MIN_FILTER, filter); | 297 glTexParameteri(target, GL_TEXTURE_MIN_FILTER, filter); |
298 glTexParameteri(target, GL_TEXTURE_MAG_FILTER, filter); | 298 glTexParameteri(target, GL_TEXTURE_MAG_FILTER, filter); |
299 glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP); | 299 glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
300 glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP); | 300 glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |
301 // Border texels should not be used with CLAMP_TO_EDGE | |
302 // We set a sane default anyway. | |
301 glTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, border); | 303 glTexParameterfv(target, GL_TEXTURE_BORDER_COLOR, border); |
302 free(init); | 304 free(init); |
303 } | 305 } |
304 | 306 |
305 /** | 307 /** |