From dddda6e4a5353f1e5518bca175b523f1231fa700 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 5 Aug 2017 15:17:18 +0200 Subject: vo_opengl: move GL state resetting to vo_opengl_cb This code is pretty much for the sake of vo_opengl_cb API users. It resets certain state that either the user or our code doesn't reset correctly. This is somewhat outdated. With GL implicit state being so awfully large, it seems more reasonable require that any code restores the default state when returning to the caller. Some exceptions are defined in opengl_cb.h. --- video/out/opengl/video.c | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'video/out/opengl/video.c') diff --git a/video/out/opengl/video.c b/video/out/opengl/video.c index 1fbea4fa8c..e8dd57bc2f 100644 --- a/video/out/opengl/video.c +++ b/video/out/opengl/video.c @@ -3492,8 +3492,6 @@ static void init_gl(struct gl_video *p) debug_check_gl(p, "before init_gl"); - gl_video_set_gl_state(p); - p->upload_timer = gl_timer_create(gl); p->blit_timer = gl_timer_create(gl); @@ -3540,22 +3538,6 @@ void gl_video_uninit(struct gl_video *p) talloc_free(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); - if (gl->mpgl_caps & MPGL_CAP_ROW_LENGTH) - gl->PixelStorei(GL_UNPACK_ROW_LENGTH, 0); - gl->PixelStorei(GL_UNPACK_ALIGNMENT, 4); -} - void gl_video_reset(struct gl_video *p) { gl_video_reset_surfaces(p); -- cgit v1.2.3