diff options
author | wm4 <wm4@nowhere> | 2016-04-22 12:08:21 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-04-22 12:08:21 +0200 |
commit | 244eff92018487b08929a8a765706fa9fe8072de (patch) | |
tree | 2efad387c43e34fcea78fe5bcca2cf7e7fa4d17f /video/out/opengl/video.c | |
parent | 2b4123f07857425d2fd77b7f339f12812eceec29 (diff) |
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.
Diffstat (limited to 'video/out/opengl/video.c')
-rw-r--r-- | video/out/opengl/video.c | 11 |
1 files changed, 6 insertions, 5 deletions
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 @@ -2809,6 +2809,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; gl->ActiveTexture(GL_TEXTURE0); @@ -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); |