diff options
author | wm4 <wm4@nowhere> | 2017-07-29 20:14:48 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-07-29 20:14:48 +0200 |
commit | 8494fdadaeb25b3c1a42c71559be5bd74d1d4638 (patch) | |
tree | da93683844c45e1fec754c68dc19c99d167562f2 /video/out/opengl/ra_gl.c | |
parent | 0f9fcf0ed4ecb54eaadbddd3cbbc14d39ab93227 (diff) | |
download | mpv-8494fdadaeb25b3c1a42c71559be5bd74d1d4638.tar.bz2 mpv-8494fdadaeb25b3c1a42c71559be5bd74d1d4638.tar.xz |
vo_opengl: manage dither texture via ra
Also add some more helpers.
Fix the broken math.h include statement.
utils.c uses ra_gl.h internals, which it shouldn't, and which will be
removed again as soon as this code gets converted to ra fully.
Diffstat (limited to 'video/out/opengl/ra_gl.c')
-rw-r--r-- | video/out/opengl/ra_gl.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/video/out/opengl/ra_gl.c b/video/out/opengl/ra_gl.c index 01f1fcd6e5..faf8812df7 100644 --- a/video/out/opengl/ra_gl.c +++ b/video/out/opengl/ra_gl.c @@ -144,24 +144,29 @@ static struct ra_tex *gl_tex_create(struct ra *ra, if (params->dimensions > 2) gl->TexParameteri(tex_gl->target, GL_TEXTURE_WRAP_R, wrap); + gl->PixelStorei(GL_UNPACK_ALIGNMENT, 1); switch (params->dimensions) { case 1: gl->TexImage1D(tex_gl->target, 0, tex_gl->internal_format, params->w, - 0, tex_gl->format, tex_gl->type, NULL); + 0, tex_gl->format, tex_gl->type, params->initial_data); break; case 2: gl->TexImage2D(tex_gl->target, 0, tex_gl->internal_format, params->w, - params->h, 0, tex_gl->format, tex_gl->type, NULL); + params->h, 0, tex_gl->format, tex_gl->type, + params->initial_data); break; case 3: gl->TexImage3D(tex_gl->target, 0, tex_gl->internal_format, params->w, params->h, params->d, 0, tex_gl->format, tex_gl->type, - NULL); + params->initial_data); break; } + gl->PixelStorei(GL_UNPACK_ALIGNMENT, 4); gl->BindTexture(tex_gl->target, 0); + tex->params.initial_data = NULL; + return tex; } |