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:
authorSergey Sharybin <sergey.vfx@gmail.com>2017-04-11 17:30:00 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2017-04-11 17:49:39 +0300
commit5a4fceff1b10e18fffc1d536e71e47b27ed40402 (patch)
treeee2ca5fdba07e562a0977be8c2de3a21a0994f3f /source/blender/windowmanager/intern/wm_dragdrop.c
parent35ee9db1e2432c9c6346eb450073d609fa07dc1e (diff)
Make image drawing code working with core profile
The issue was caused here by usage of deprecated GL_CURRENT_PROGRAM which was returning rubbish value. Now we use imm API and create vertex format prior to immBindProgram. This made us required to have some sort of state passed from setup function to actual drawing.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_dragdrop.c')
-rw-r--r--source/blender/windowmanager/intern/wm_dragdrop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index 0402a528e8d..40a2bf42a28 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -335,8 +335,8 @@ void wm_drags_draw(bContext *C, wmWindow *win, rcti *rect)
drag_rect_minmax(rect, x, y, x + drag->sx, y + drag->sy);
else {
float col[4] = {1.0f, 1.0f, 1.0f, 0.65f}; /* this blends texture */
- immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR);
- immDrawPixelsTexScaled(x, y, drag->imb->x, drag->imb->y, GL_RGBA, GL_UNSIGNED_BYTE, GL_NEAREST,
+ IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR);
+ immDrawPixelsTexScaled(&state, x, y, drag->imb->x, drag->imb->y, GL_RGBA, GL_UNSIGNED_BYTE, GL_NEAREST,
drag->imb->rect, drag->scale, drag->scale, 1.0f, 1.0f, col);
}
}