Make image drawing code working with core profile
[blender.git] / source / blender / editors / space_file / file_draw.c
index bf47657f27dc3c871458f1a775fb9827a8184301..329b3f7f5256680c726663d6811f1db5b29f7c46 100644 (file)
@@ -389,8 +389,8 @@ static void file_draw_preview(
                UI_GetThemeColor4fv(TH_TEXT, col);
        }
 
-       immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR);
-       immDrawPixelsTexScaled((float)xco, (float)yco, imb->x, imb->y, GL_RGBA, GL_UNSIGNED_BYTE, GL_NEAREST, imb->rect,
+       IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR);
+       immDrawPixelsTexScaled(&state, (float)xco, (float)yco, imb->x, imb->y, GL_RGBA, GL_UNSIGNED_BYTE, GL_NEAREST, imb->rect,
                               scale, scale, 1.0f, 1.0f, col);
 
        if (icon) {