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-03-08 15:22:42 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-03-08 15:23:39 +0300
commitc24d045a23b7d990153dfbee98173c331011794a (patch)
tree309ab67f139253db873d2be12a9f5de011e379cf /source/blender/gpu
parent9af0c8b00afaacd2a61aa17044be9fc4c907c8b1 (diff)
OpenGL Select: integer rect for passing region
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/GPU_select.h4
-rw-r--r--source/blender/gpu/intern/gpu_select.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/gpu/GPU_select.h b/source/blender/gpu/GPU_select.h
index d3cb914976e..93f5ce13bbd 100644
--- a/source/blender/gpu/GPU_select.h
+++ b/source/blender/gpu/GPU_select.h
@@ -32,7 +32,7 @@
#include "BLI_sys_types.h"
-struct rctf;
+struct rcti;
/* flags for mode of operation */
enum {
@@ -41,7 +41,7 @@ enum {
GPU_SELECT_NEAREST_SECOND_PASS = 3,
};
-void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, const struct rctf *input, char mode, int oldhits);
+void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, const struct rcti *input, char mode, int oldhits);
bool GPU_select_load_id(unsigned int id);
unsigned int GPU_select_end(void);
bool GPU_select_query_check_active(void);
diff --git a/source/blender/gpu/intern/gpu_select.c b/source/blender/gpu/intern/gpu_select.c
index f78191a6f6d..35944c455a5 100644
--- a/source/blender/gpu/intern/gpu_select.c
+++ b/source/blender/gpu/intern/gpu_select.c
@@ -37,6 +37,8 @@
#include "DNA_userdef_types.h"
+#include "BLI_rect.h"
+
#include "BLI_utildefines.h"
/* Ad hoc number of queries to allocate to skip doing many glGenQueries */
@@ -72,7 +74,7 @@ static GPUQueryState g_query_state = {0};
/**
* initialize and provide buffer for results
*/
-void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, const rctf *input, char mode, int oldhits)
+void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, const rcti *input, char mode, int oldhits)
{
g_query_state.select_is_active = true;
g_query_state.query_issued = false;
@@ -109,7 +111,7 @@ void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, const rctf *in
* get rejected before the depth test. Should probably cull rect against
* scissor for viewport but this is a rare case I think */
glGetFloatv(GL_SCISSOR_BOX, viewport);
- glViewport(viewport[0], viewport[1], (int)(input->xmax - input->xmin), (int)(input->ymax - input->ymin));
+ glViewport(viewport[0], viewport[1], BLI_rcti_size_x(input), BLI_rcti_size_y(input));
/* occlusion queries operates on fragments that pass tests and since we are interested on all
* objects in the view frustum independently of their order, we need to disable the depth test */