From 8dea4d60ef96e5377c0b9d60fd7b29424bbcba9a Mon Sep 17 00:00:00 2001 From: jp9000 Date: Fri, 13 Dec 2013 10:32:05 -0700 Subject: [PATCH] add comment explaining the purpose of that line (because I noticed it was rather vague) --- libobs-opengl/gl-subsystem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libobs-opengl/gl-subsystem.c b/libobs-opengl/gl-subsystem.c index e7fdf6ddc..cc27e4c78 100644 --- a/libobs-opengl/gl-subsystem.c +++ b/libobs-opengl/gl-subsystem.c @@ -247,6 +247,8 @@ void device_load_texture(device_t device, texture_t tex, int unit) if (!gl_active_texture(GL_TEXTURE0 + unit)) goto fail; + /* the target for the previous text may not be the same as the + * next texture, so unbind the previous texture first to be safe */ if (cur_tex && (!tex || cur_tex->gl_target != tex->gl_target)) gl_bind_texture(cur_tex->gl_target, 0); -- GitLab