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:
authorAntony Riakiotakis <kalast@gmail.com>2014-07-23 17:24:07 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-07-23 17:26:08 +0400
commit17021171f1b544aaa89d4776736255d8753e239c (patch)
treec5e61cf797b54ba77e65d05263503365a9acfc47 /source/blender/editors/armature/editarmature_sketch.c
parentcf9d5db75b4c8599b6669a49c40e40938ac6a34b (diff)
Occlusion Query based selection.
This patch creates an interface for selection mechanisms in opengl. This makes it possible to switch between occlusion query based or select rendermode based selection transparently. This is really useful on graphics drivers that do not accelerate the select rendermode path (some ATI cards are notorious for this, and the new path is used by default there), since occlusion queries are always hardware accelerated due to their use in games. The option can be found under system - selection. Auto just enables occlusion queries for ATI users while the rest of the options enforce one of the two methods always. There is just one known change, previous code enforced nearest bone to always get selected, even when mouse selecting near the same position, I couldn't replicate the behaviour though. patch by me with edits and review by Campbell. Thanks!
Diffstat (limited to 'source/blender/editors/armature/editarmature_sketch.c')
-rw-r--r--source/blender/editors/armature/editarmature_sketch.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c
index 475ffd23617..ba105325b97 100644
--- a/source/blender/editors/armature/editarmature_sketch.c
+++ b/source/blender/editors/armature/editarmature_sketch.c
@@ -53,6 +53,8 @@
#include "WM_api.h"
#include "WM_types.h"
+#include "GPU_select.h"
+
typedef int (*GestureDetectFct)(bContext *, SK_Gesture *, SK_Sketch *);
typedef void (*GestureApplyFct)(bContext *, SK_Gesture *, SK_Sketch *);
@@ -493,7 +495,7 @@ static void sk_drawStroke(SK_Stroke *stk, int id, float color[3], int start, int
gluQuadricNormals(quad, GLU_SMOOTH);
if (id != -1) {
- glLoadName(id);
+ GPU_select_load_id(id);
for (i = 0; i < stk->nb_points; i++) {
glPushMatrix();
@@ -1969,7 +1971,7 @@ static int sk_selectStroke(bContext *C, SK_Sketch *sketch, const int mval[2], in
rect.ymin = mval[1] - 5;
rect.ymax = mval[1] + 5;
- hits = view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect);
+ hits = view3d_opengl_select(&vc, buffer, MAXPICKBUF, &rect, true);
if (hits > 0) {
int besthitresult = -1;
@@ -2032,7 +2034,7 @@ static void sk_drawSketch(Scene *scene, View3D *UNUSED(v3d), SK_Sketch *sketch,
sk_drawStroke(stk, id, NULL, -1, -1);
}
- glLoadName(-1);
+ GPU_select_load_id(-1);
}
else {
float selected_rgb[3] = {1, 0, 0};