summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
Diffstat (limited to 'libvo')
-rw-r--r--libvo/gl_common.c5
-rw-r--r--libvo/gl_common.h2
2 files changed, 4 insertions, 3 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index 2842c2a468..5a888826fb 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -284,8 +284,9 @@ static void getFunctions() {
* \param val luminance value to fill texture with
*/
void glCreateClearTex(GLenum target, GLenum fmt, GLint filter,
- int w, int h, char val) {
- GLfloat border[4] = {val, val, val, val};
+ int w, int h, unsigned char val) {
+ GLfloat fval = (GLfloat)val / 255.0;
+ GLfloat border[4] = {fval, fval, fval, fval};
GLenum clrfmt = (fmt == GL_ALPHA) ? GL_ALPHA : GL_LUMINANCE;
char *init = (char *)malloc(w * h);
memset(init, val, w * h);
diff --git a/libvo/gl_common.h b/libvo/gl_common.h
index 31792251c1..9223d81c21 100644
--- a/libvo/gl_common.h
+++ b/libvo/gl_common.h
@@ -65,7 +65,7 @@ int glFindFormat(uint32_t format, uint32_t *bpp, GLint *gl_texfmt,
GLenum *gl_format, GLenum *gl_type);
int glFmt2bpp(GLenum format, GLenum type);
void glCreateClearTex(GLenum target, GLenum fmt, GLint filter,
- int w, int h, char val);
+ int w, int h, unsigned char val);
void glUploadTex(GLenum target, GLenum format, GLenum type,
const char *data, int stride,
int x, int y, int w, int h, int slice);