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:
authorClément Foucault <foucault.clem@gmail.com>2019-03-24 01:43:26 +0300
committerClément Foucault <foucault.clem@gmail.com>2019-03-24 01:43:26 +0300
commited9af18c762cf55947f51f3dae939a76fdb19d9a (patch)
tree8526bb9a0b4a9e1d413a2fb884f264c27f46ce94 /source/blender/windowmanager
parentee5e7a006e7134bad6534abe331c6f9310380337 (diff)
GPU: Replace glEnable/glDisable but GPU_state calls
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
index 194bd2b5449..df9f38824b0 100644
--- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
+++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c
@@ -39,6 +39,7 @@
#include "GPU_glew.h"
#include "GPU_matrix.h"
#include "GPU_select.h"
+#include "GPU_state.h"
#include "MEM_guardedalloc.h"
@@ -429,29 +430,29 @@ static void gizmos_draw_list(const wmGizmoMap *gzmap, const bContext *C, ListBas
}
else {
if (is_depth) {
- glEnable(GL_DEPTH_TEST);
+ GPU_depth_test(true);
}
else {
- glDisable(GL_DEPTH_TEST);
+ GPU_depth_test(false);
}
is_depth_prev = is_depth;
}
/* XXX force AntiAlias Gizmos. */
- glEnable(GL_LINE_SMOOTH);
- glEnable(GL_POLYGON_SMOOTH);
+ GPU_line_smooth(true);
+ GPU_polygon_smooth(true);
gz->type->draw(C, gz);
- glDisable(GL_LINE_SMOOTH);
- glDisable(GL_POLYGON_SMOOTH);
+ GPU_line_smooth(false);
+ GPU_polygon_smooth(false);
/* free/remove gizmo link after drawing */
BLI_freelinkN(draw_gizmos, link);
}
if (is_depth_prev) {
- glDisable(GL_DEPTH_TEST);
+ GPU_depth_test(false);
}
}
@@ -496,10 +497,10 @@ static void gizmo_draw_select_3D_loop(
}
else {
if (is_depth) {
- glEnable(GL_DEPTH_TEST);
+ GPU_depth_test(true);
}
else {
- glDisable(GL_DEPTH_TEST);
+ GPU_depth_test(false);
}
is_depth_prev = is_depth;
}
@@ -518,7 +519,7 @@ static void gizmo_draw_select_3D_loop(
}
if (is_depth_prev) {
- glDisable(GL_DEPTH_TEST);
+ GPU_depth_test(false);
}
if (is_depth_skip_prev) {
glDepthMask(true);