diff options
author | Luca Rood <dev@lucarood.com> | 2017-01-26 17:13:50 +0300 |
---|---|---|
committer | Luca Rood <dev@lucarood.com> | 2017-02-01 22:03:58 +0300 |
commit | eca2f918a7934c09bde7f499e3a521f60250ce4c (patch) | |
tree | dd47ba2a01839e47006222a447be36db35a9fb06 /source/blender/editors/transform/transform_generics.c | |
parent | be72d7a9f5032d5e5191c66200a3377179e4dcff (diff) |
OpenGL immediate mode: transform_generics.c
Differential Revision: https://developer.blender.org/D2482
Part of T49043
Diffstat (limited to 'source/blender/editors/transform/transform_generics.c')
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index f78a23be7b8..a9eb4c705b7 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -62,8 +62,7 @@ #include "RNA_access.h" -#include "BIF_gl.h" -#include "BIF_glutil.h" +#include "GPU_immediate.h" #include "BIK_api.h" @@ -1050,14 +1049,19 @@ void drawLine(TransInfo *t, const float center[3], const float dir[3], char axis UI_GetThemeColor3ubv(TH_GRID, col); } UI_make_axis_color(col, col2, axis); - glColor3ubv(col2); - - setlinestyle(0); - glBegin(GL_LINES); - glVertex3fv(v1); - glVertex3fv(v2); - glEnd(); - + + unsigned pos = add_attrib(immVertexFormat(), "pos", GL_FLOAT, 3, KEEP_FLOAT); + + immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); + immUniformColor3ubv(col2); + + immBegin(GL_LINES, 2); + immVertex3fv(pos, v1); + immVertex3fv(pos, v2); + immEnd(); + + immUnbindProgram(); + glPopMatrix(); } } |