diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-09-25 21:07:02 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-09-25 21:14:42 +0300 |
commit | 198c7d3687c16581a48701733c4fe4b511eaf149 (patch) | |
tree | 41ff532219804afff847ac234d3af0b07521a9e2 /source/blender/windowmanager | |
parent | 98dd2a518be52b7f94c3a6f9345f19a0aebb2284 (diff) |
DRW : Add new view_update mechanism.
This makes updates for the viewport cleaner and also add the possibility to add a new callback called when the scene is updated.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_draw.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 81f913d7aa7..b4db8a8b3ac 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -58,6 +58,7 @@ #include "GPU_draw.h" #include "GPU_extensions.h" #include "GPU_immediate.h" +#include "GPU_viewport.h" #include "RE_engine.h" @@ -136,6 +137,7 @@ static void wm_region_test_render_do_draw(const Scene *scene, ScrArea *sa, ARegi if (sa->spacetype == SPACE_VIEW3D) { RegionView3D *rv3d = ar->regiondata; RenderEngine *engine = (rv3d) ? rv3d->render_engine : NULL; + GPUViewport *viewport = (rv3d) ? rv3d->viewport : NULL; if (engine && (engine->flag & RE_ENGINE_DO_DRAW)) { View3D *v3d = sa->spacedata.first; @@ -149,6 +151,9 @@ static void wm_region_test_render_do_draw(const Scene *scene, ScrArea *sa, ARegi engine->flag &= ~RE_ENGINE_DO_DRAW; } + else if (viewport && GPU_viewport_do_update(viewport)) { + ED_region_tag_redraw(ar); + } } } |