2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2014 Blender Foundation.
19 * All rights reserved.
21 * Contributor(s): Antony Riakiotakis.
23 * ***** END GPL LICENSE BLOCK *****
26 /** \file GPU_select.h
30 #ifndef __GPU_SELECT_H__
31 #define __GPU_SELECT_H__
33 #include "DNA_vec_types.h" /* rcft */
34 #include "BLI_sys_types.h"
36 /* flags for mode of operation */
39 GPU_SELECT_NEAREST_FIRST_PASS = 2,
40 GPU_SELECT_NEAREST_SECOND_PASS = 3,
43 /* initialize and provide buffer for results */
44 void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, rctf *input, char mode, int oldhits);
46 /* loads a new selection id and ends previous query, if any. In second pass of selection it also returns
47 * if id has been hit on the first pass already. Thus we can skip drawing un-hit objects IMPORTANT: We rely on the order of object rendering on passes to be
48 * the same for this to work */
49 bool GPU_select_load_id(unsigned int id);
51 /* cleanup and flush selection results to buffer. Return number of hits and hits in buffer.
52 * if dopass is true, we will do a second pass with occlusion queries to get the closest hit */
53 unsigned int GPU_select_end(void);
55 /* does the GPU support occlusion queries? */
56 bool GPU_select_query_check_support(void);
58 /* is occlusion query supported and user activated? */
59 bool GPU_select_query_check_active(void);