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.
This commit is contained in:
wm4 2016-04-22 12:08:21 +02:00
parent 2b4123f078
commit 244eff9201
1 changed files with 6 additions and 5 deletions

View File

@ -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);