Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2015-11-28 03:20:28 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2015-12-06 21:35:15 +0300
commitcf921934b1a6a30461779e26d67d02d0b66bdafc (patch)
treeea6e1a6618628f11a4114ecb47cfd94acc005939 /source/blender/editors/screen
parent147f7a1e860587a928f465b0b4d0ecf816c997be (diff)
OpenGL: use simple shader for texture drawing in a few places.
Differential Revision: https://developer.blender.org/D1645
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/glutil.c7
1 files changed, 4 insertions, 3 deletions
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);
}
}