From cf921934b1a6a30461779e26d67d02d0b66bdafc Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 28 Nov 2015 01:20:28 +0100 Subject: OpenGL: use simple shader for texture drawing in a few places. Differential Revision: https://developer.blender.org/D1645 --- source/blender/editors/screen/glutil.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/screen') diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 337a959200a..a7f239ed04c 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -45,10 +45,11 @@ #include "BIF_gl.h" #include "BIF_glutil.h" - #include "IMB_colormanagement.h" #include "IMB_imbuf_types.h" +#include "GPU_simple_shader.h" + #include "UI_interface.h" #ifndef GL_CLAMP_TO_EDGE @@ -589,7 +590,7 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format, glTexSubImage2D(GL_TEXTURE_2D, 0, subpart_w, subpart_h, 1, 1, format, GL_UNSIGNED_BYTE, &uc_rect[(((size_t)subpart_y) * offset_y + subpart_h - 1) * img_w * components + (subpart_x * offset_x + subpart_w - 1) * components]); } - glEnable(GL_TEXTURE_2D); + GPU_simple_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR); glBegin(GL_QUADS); glTexCoord2f((float)(0 + offset_left) / tex_w, (float)(0 + offset_bot) / tex_h); glVertex2f(rast_x + (float)offset_left * xzoom, rast_y + (float)offset_bot * yzoom); @@ -603,7 +604,7 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format, glTexCoord2f((float)(0 + offset_left) / tex_w, (float)(subpart_h - offset_top) / tex_h); glVertex2f(rast_x + (float)offset_left * xzoom, rast_y + (float)(subpart_h - offset_top) * yzoom * scaleY); glEnd(); - glDisable(GL_TEXTURE_2D); + GPU_simple_shader_bind(GPU_SHADER_USE_COLOR); } } -- cgit v1.2.3