From 13c39e90b3c0ec6a470fbc3696cd73c2a65b49cf Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Wed, 15 Jul 2015 18:50:02 +0200 Subject: VBO offscreen selection drawing, cdderivedmesh Get rid of legacy drawing, it's only used for selection, in which case we can prepare a temporary color buffer and draw at once. Code is not complete here because we still redundantly set the draw color in the draw function and don't ommit hidden faces automatically. Still it works 100% without immediate mode now. --- source/blender/windowmanager/WM_api.h | 1 + source/blender/windowmanager/intern/wm_subwindow.c | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index fa9357f4eec..28e24e442ca 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -392,6 +392,7 @@ void wmOrtho2_pixelspace(const float x, const float y); /* utilities */ void WM_framebuffer_index_set(int index); +void WM_framebuffer_index_get(int index, int *r_col); int WM_framebuffer_to_index(unsigned int col); void WM_framebuffer_to_index_array(unsigned int *col, const unsigned int size); diff --git a/source/blender/windowmanager/intern/wm_subwindow.c b/source/blender/windowmanager/intern/wm_subwindow.c index 1583f9f9095..6b286bd19a5 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.c +++ b/source/blender/windowmanager/intern/wm_subwindow.c @@ -459,6 +459,13 @@ void WM_framebuffer_index_set(int index) cpack(col); } +void WM_framebuffer_index_get(int index, int *r_col) +{ + *r_col = index_to_framebuffer(index); +} + + + #define INDEX_FROM_BUF_8(col) (((col & 0xC00000) >> 18) + ((col & 0xC000) >> 12) + ((col & 0xC0) >> 6)) #define INDEX_FROM_BUF_12(col) (((col & 0xF00000) >> 12) + ((col & 0xF000) >> 8) + ((col & 0xF0) >> 4)) #define INDEX_FROM_BUF_15_16(col) (((col & 0xF80000) >> 9) + ((col & 0xF800) >> 6) + ((col & 0xF8) >> 3)) -- cgit v1.2.3