Commit d6d8374d authored by Victorien Le Couviour--Tuffet's avatar Victorien Le Couviour--Tuffet Committed by Jean-Baptiste Kempf

opengl: correct vertical alignment

The GL textures are Y inverted, so we must reverse the vertical alignment.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent c4948b42
......@@ -213,11 +213,17 @@ static int Control (vout_display_t *vd, int query, va_list ap)
case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
case VOUT_DISPLAY_CHANGE_ZOOM:
{
const vout_display_cfg_t *c = va_arg (ap, const vout_display_cfg_t *);
vout_display_cfg_t c = *va_arg (ap, const vout_display_cfg_t *);
const video_format_t *src = &vd->source;
vout_display_place_t place;
vout_display_PlacePicture (&place, src, c, false);
/* Reverse vertical alignment as the GL tex are Y inverted */
if (c.align.vertical == VOUT_DISPLAY_ALIGN_TOP)
c.align.vertical = VOUT_DISPLAY_ALIGN_BOTTOM;
else if (c.align.vertical == VOUT_DISPLAY_ALIGN_BOTTOM)
c.align.vertical = VOUT_DISPLAY_ALIGN_TOP;
vout_display_PlacePicture (&place, src, &c, false);
vlc_gl_Resize (sys->gl, place.width, place.height);
if (vlc_gl_MakeCurrent (sys->gl) != VLC_SUCCESS)
return VLC_EGENERIC;
......
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