Make image drawing code working with core profile
[blender.git] / source / blender / windowmanager / intern / wm_gesture.c
index 460b4ac3b6da290ba09c07a7881ab0e4a330e7e0..277a219ca5cfd2e359fb7b0c33619d37601c1fca 100644 (file)
@@ -367,11 +367,11 @@ static void draw_filled_lasso(wmWindow *win, wmGesture *gt)
 
                glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
 
-               GPUShader *shader = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR);
-               GPU_shader_bind(shader);
-               GPU_shader_uniform_vector(shader, GPU_shader_get_uniform(shader, "shuffle"), 4, 1, red);
+               IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR);
+               GPU_shader_bind(state.shader);
+               GPU_shader_uniform_vector(state.shader, GPU_shader_get_uniform(state.shader, "shuffle"), 4, 1, red);
 
-               immDrawPixelsTex(rect.xmin, rect.ymin, w, h, GL_RED, GL_UNSIGNED_BYTE, GL_NEAREST, pixel_buf, 1.0f, 1.0f, NULL);
+               immDrawPixelsTex(&state, rect.xmin, rect.ymin, w, h, GL_RED, GL_UNSIGNED_BYTE, GL_NEAREST, pixel_buf, 1.0f, 1.0f, NULL);
 
                GPU_shader_unbind();