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:
Diffstat (limited to 'source/blender/editors/manipulator_library/manipulator_types/cage3d_manipulator.c')
-rw-r--r--source/blender/editors/manipulator_library/manipulator_types/cage3d_manipulator.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/source/blender/editors/manipulator_library/manipulator_types/cage3d_manipulator.c b/source/blender/editors/manipulator_library/manipulator_types/cage3d_manipulator.c
index 6c2e2bd564d..a907816b08f 100644
--- a/source/blender/editors/manipulator_library/manipulator_types/cage3d_manipulator.c
+++ b/source/blender/editors/manipulator_library/manipulator_types/cage3d_manipulator.c
@@ -48,6 +48,7 @@
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#include "GPU_select.h"
+#include "GPU_state.h"
#include "RNA_access.h"
#include "RNA_define.h"
@@ -303,14 +304,14 @@ static void manipulator_cage3d_draw_intern(
/* Handy for quick testing draw (if it's outside bounds). */
if (false) {
- glEnable(GL_BLEND);
+ GPU_blend(true);
uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 3, GWN_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
immUniformColor4fv((const float[4]){1, 1, 1, 0.5f});
float s = 0.5f;
immRectf(pos, -s, -s, s, s);
immUnbindProgram();
- glDisable(GL_BLEND);
+ GPU_blend(false);
}
if (select) {
@@ -358,13 +359,13 @@ static void manipulator_cage3d_draw_intern(
#endif
if (draw_style == ED_MANIPULATOR_CAGE2D_STYLE_BOX) {
/* corner manipulators */
- glLineWidth(mpr->line_width + 3.0f);
+ GPU_line_width(mpr->line_width + 3.0f);
cage3d_draw_box_corners(size_real, margin, (const float[3]){0, 0, 0});
/* corner manipulators */
float color[4];
manipulator_color_get(mpr, highlight, color);
- glLineWidth(mpr->line_width);
+ GPU_line_width(mpr->line_width);
cage3d_draw_box_corners(size_real, margin, color);
bool show = false;
@@ -388,29 +389,29 @@ static void manipulator_cage3d_draw_intern(
float color[4];
manipulator_color_get(mpr, highlight, color);
- glEnable(GL_LINE_SMOOTH);
- glEnable(GL_POLYGON_SMOOTH);
- glEnable(GL_BLEND);
+ GPU_line_smooth(true);
+ GPU_polygon_smooth(true);
+ GPU_blend(true);
- glLineWidth(mpr->line_width + 3.0f);
+ GPU_line_width(mpr->line_width + 3.0f);
cage3d_draw_circle_wire(size_real, margin, (const float[3]){0, 0, 0}, transform_flag, draw_options);
- glLineWidth(mpr->line_width);
+ GPU_line_width(mpr->line_width);
cage3d_draw_circle_wire(size_real, margin, color, transform_flag, draw_options);
/* corner manipulators */
cage3d_draw_circle_handles(rv3d, matrix_final, size_real, margin, (const float[3]){0, 0, 0}, true, 60);
cage3d_draw_circle_handles(rv3d, matrix_final, size_real, margin, color, true, 40);
- glDisable(GL_BLEND);
- glDisable(GL_POLYGON_SMOOTH);
- glDisable(GL_LINE_SMOOTH);
+ GPU_blend(false);
+ GPU_polygon_smooth(false);
+ GPU_line_smooth(false);
}
else {
BLI_assert(0);
}
}
- glLineWidth(1.0);
+ GPU_line_width(1.0);
gpuPopMatrix();
}