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:
authorCampbell Barton <ideasman42@gmail.com>2017-08-03 08:12:47 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-08-03 08:12:47 +0300
commit4fada2e10f925100956f47e2ff994471bc844db4 (patch)
tree9a96050c4f38aa694f07bc94709768b495511944 /source/blender/draw/intern/draw_view.c
parentfc9da7494248faf9ba591d95e470fd5f8efaebc9 (diff)
Manipulator: Use 2D manipulators in the 3D view
Also split update flag into draw-steps, since drawing 3D manipulators was tagging 2D as being refreshed.
Diffstat (limited to 'source/blender/draw/intern/draw_view.c')
-rw-r--r--source/blender/draw/intern/draw_view.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c
index e58f7cfbd29..67bb781562e 100644
--- a/source/blender/draw/intern/draw_view.c
+++ b/source/blender/draw/intern/draw_view.c
@@ -728,5 +728,29 @@ void DRW_draw_manipulator(void)
/* draw depth culled manipulators - manipulators need to be updated *after* view matrix was set up */
/* TODO depth culling manipulators is not yet supported, just drawing _3D here, should
* later become _IN_SCENE (and draw _3D separate) */
- WM_manipulatormap_draw(ar->manipulator_map, draw_ctx->evil_C, WM_MANIPULATORMAP_DRAWSTEP_3D);
+ WM_manipulatormap_draw(
+ ar->manipulator_map, draw_ctx->evil_C,
+ WM_MANIPULATORMAP_DRAWSTEP_3D);
+
+ /* We may want to split this into a separate pass.
+ * or maintain a stage in the draw manager where all pixel-space drawing happens. */
+ {
+ float original_proj[4][4];
+ gpuGetProjectionMatrix(original_proj);
+ wmOrtho2_region_pixelspace(ar);
+
+ gpuPushMatrix();
+ gpuLoadIdentity();
+
+ glDepthMask(GL_FALSE);
+
+ WM_manipulatormap_draw(
+ ar->manipulator_map, draw_ctx->evil_C,
+ WM_MANIPULATORMAP_DRAWSTEP_2D);
+
+ glDepthMask(GL_TRUE);
+
+ gpuPopMatrix();
+ gpuLoadProjectionMatrix(original_proj);
+ }
}