Commit 5a018ce8 authored by Laurent Aimar's avatar Laurent Aimar

Always bind texture before use (opengl).

It will allow to add subpictures blending.
parent 95157742
...@@ -518,6 +518,7 @@ int vout_display_opengl_Prepare(vout_display_opengl_t *vgl, ...@@ -518,6 +518,7 @@ int vout_display_opengl_Prepare(vout_display_opengl_t *vgl,
for (unsigned j = 0; j < vgl->chroma->plane_count; j++) { for (unsigned j = 0; j < vgl->chroma->plane_count; j++) {
if (vgl->chroma->plane_count > 1) if (vgl->chroma->plane_count > 1)
vgl->ActiveTextureARB(GL_TEXTURE0_ARB + j); vgl->ActiveTextureARB(GL_TEXTURE0_ARB + j);
glBindTexture(vgl->tex_target, vgl->texture[0][j]);
glPixelStorei(GL_UNPACK_ROW_LENGTH, picture->p[j].i_pitch / picture->p[j].i_pixel_pitch); glPixelStorei(GL_UNPACK_ROW_LENGTH, picture->p[j].i_pitch / picture->p[j].i_pixel_pitch);
glTexSubImage2D(vgl->tex_target, 0, glTexSubImage2D(vgl->tex_target, 0,
0, 0, 0, 0,
...@@ -597,6 +598,13 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl, ...@@ -597,6 +598,13 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
#else #else
#if !defined(MACOS_OPENGL)
for (unsigned j = 0; j < vgl->chroma->plane_count; j++) {
if (vgl->chroma->plane_count > 1)
vgl->ActiveTextureARB(GL_TEXTURE0_ARB + j);
glBindTexture(vgl->tex_target, vgl->texture[0][j]);
}
#endif
glBegin(GL_POLYGON); glBegin(GL_POLYGON);
glTexCoord2f(left[0], top[0]); glTexCoord2f(left[0], top[0]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment