From 244eff92018487b08929a8a765706fa9fe8072de Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 22 Apr 2016 12:08:21 +0200 Subject: vo_opengl: always reset some GL state when leaving renderer The active texture and some pixelstore parameters are now always reset to defaults when entering and leaving the renderer. Could be important for libmpv. --- video/out/opengl/video.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'video/out/opengl/video.c') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 8807b65005..4307dcde47 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -2808,6 +2808,12 @@ void gl_video_uninit(struct gl_video *p) } void gl_video_set_gl_state(struct gl_video *p) +{ + // This resets certain important state to defaults. + gl_video_unset_gl_state(p); +} + +void gl_video_unset_gl_state(struct gl_video *p) { GL *gl = p->gl; @@ -2817,11 +2823,6 @@ void gl_video_set_gl_state(struct gl_video *p) gl->PixelStorei(GL_UNPACK_ALIGNMENT, 4); } -void gl_video_unset_gl_state(struct gl_video *p) -{ - /* nop */ -} - void gl_video_reset(struct gl_video *p) { gl_video_reset_surfaces(p); -- cgit v1.2.3