X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_output%2Fopengl.h;h=c54258fc863ea51c38e2bfc134a189d9f6f4636b;hb=04ad4fc735a909c6e3f100c90bcc5efc4a2bf0c1;hp=df703794049b0511131c50e61a9572b9ec1e64d0;hpb=55fb4b535926bafc13c85e854dbce38ee738d0b6;p=vlc diff --git a/modules/video_output/opengl.h b/modules/video_output/opengl.h index df70379404..c54258fc86 100644 --- a/modules/video_output/opengl.h +++ b/modules/video_output/opengl.h @@ -263,8 +263,15 @@ static int vout_display_opengl_ResetTextures(vout_display_opengl_t *vgl) /* XXX See comment vout_display_opengl_Prepare */ struct picture_sys_t { vout_display_opengl_t *vgl; - GLuint texture; + GLuint *texture; }; + +/* Small helper */ +static inline GLuint get_texture(picture_t *picture) +{ + return *picture->p_sys->texture; +} + static int PictureLock(picture_t *picture) { if (!picture->p_sys) @@ -273,7 +280,7 @@ static int PictureLock(picture_t *picture) vout_display_opengl_t *vgl = picture->p_sys->vgl; if (!vout_opengl_Lock(vgl->gl)) { - glBindTexture(VLCGL_TARGET, picture->p_sys->texture); + glBindTexture(VLCGL_TARGET, get_texture(picture)); glTexSubImage2D(VLCGL_TARGET, 0, 0, 0, vgl->fmt.i_width, vgl->fmt.i_height, VLCGL_FORMAT, VLCGL_TYPE, picture->p[0].p_pixels); @@ -305,7 +312,10 @@ static picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl) #ifdef __APPLE__ rsc.p_sys = malloc(sizeof(*rsc.p_sys)); if (rsc.p_sys) + { rsc.p_sys->vgl = vgl; + rsc.p_sys->texture = &vgl->texture[i]; + } #endif rsc.p[0].p_pixels = vgl->buffer[i]; rsc.p[0].i_pitch = vgl->fmt.i_width * vgl->tex_pixel_size; @@ -370,7 +380,7 @@ static int vout_display_opengl_Prepare(vout_display_opengl_t *vgl, #ifdef __APPLE__ /* Bind to the texture for drawing */ - glBindTexture(VLCGL_TARGET, picture->p_sys->texture); + glBindTexture(VLCGL_TARGET, get_texture(picture)); #else /* Update the texture */ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0,