diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-03-08 15:22:42 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-03-08 15:23:39 +0300 |
commit | c24d045a23b7d990153dfbee98173c331011794a (patch) | |
tree | 309ab67f139253db873d2be12a9f5de011e379cf /source/blender/gpu/intern | |
parent | 9af0c8b00afaacd2a61aa17044be9fc4c907c8b1 (diff) |
OpenGL Select: integer rect for passing region
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r-- | source/blender/gpu/intern/gpu_select.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 */ |