Blender  V2.93
gpu_immediate_util.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
23 #include <stdio.h>
24 #include <string.h>
25 
26 #include "BLI_math.h"
27 #include "BLI_utildefines.h"
28 
29 #include "GPU_immediate.h"
30 #include "GPU_immediate_util.h"
31 
32 #include "UI_resources.h"
33 
34 static const float cube_coords[8][3] = {
35  {-1, -1, -1},
36  {-1, -1, +1},
37  {-1, +1, -1},
38  {-1, +1, +1},
39  {+1, -1, -1},
40  {+1, -1, +1},
41  {+1, +1, -1},
42  {+1, +1, +1},
43 };
44 static const int cube_quad_index[6][4] = {
45  {0, 1, 3, 2},
46  {0, 2, 6, 4},
47  {0, 4, 5, 1},
48  {1, 5, 7, 3},
49  {2, 3, 7, 6},
50  {4, 6, 7, 5},
51 };
52 static const int cube_line_index[12][2] = {
53  {0, 1},
54  {0, 2},
55  {0, 4},
56  {1, 3},
57  {1, 5},
58  {2, 3},
59  {2, 6},
60  {3, 7},
61  {4, 5},
62  {4, 6},
63  {5, 7},
64  {6, 7},
65 };
66 
67 void immRectf(uint pos, float x1, float y1, float x2, float y2)
68 {
70  immVertex2f(pos, x1, y1);
71  immVertex2f(pos, x2, y1);
72  immVertex2f(pos, x2, y2);
73  immVertex2f(pos, x1, y2);
74  immEnd();
75 }
76 
77 void immRecti(uint pos, int x1, int y1, int x2, int y2)
78 {
80  immVertex2i(pos, x1, y1);
81  immVertex2i(pos, x2, y1);
82  immVertex2i(pos, x2, y2);
83  immVertex2i(pos, x1, y2);
84  immEnd();
85 }
86 
87 void immRectf_fast(uint pos, float x1, float y1, float x2, float y2)
88 {
89  immVertex2f(pos, x1, y1);
90  immVertex2f(pos, x2, y1);
91  immVertex2f(pos, x2, y2);
92 
93  immVertex2f(pos, x1, y1);
94  immVertex2f(pos, x2, y2);
95  immVertex2f(pos, x1, y2);
96 }
97 
99  uint pos, uint col, float x1, float y1, float x2, float y2, const float color[4])
100 {
101  immAttr4fv(col, color);
102  immVertex2f(pos, x1, y1);
103  immAttr4fv(col, color);
104  immVertex2f(pos, x2, y1);
105  immAttr4fv(col, color);
106  immVertex2f(pos, x2, y2);
107 
108  immAttr4fv(col, color);
109  immVertex2f(pos, x1, y1);
110  immAttr4fv(col, color);
111  immVertex2f(pos, x2, y2);
112  immAttr4fv(col, color);
113  immVertex2f(pos, x1, y2);
114 }
115 
117  uint pos, uint col, int x1, int y1, int x2, int y2, const float color[4])
118 {
119  immAttr4fv(col, color);
120  immVertex2i(pos, x1, y1);
121  immAttr4fv(col, color);
122  immVertex2i(pos, x2, y1);
123  immAttr4fv(col, color);
124  immVertex2i(pos, x2, y2);
125 
126  immAttr4fv(col, color);
127  immVertex2i(pos, x1, y1);
128  immAttr4fv(col, color);
129  immVertex2i(pos, x2, y2);
130  immAttr4fv(col, color);
131  immVertex2i(pos, x1, y2);
132 }
133 
134 #if 0 /* more complete version in case we want that */
135 void immRecti_complete(int x1, int y1, int x2, int y2, const float color[4])
136 {
138  uint pos = add_attr(format, "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
140  immUniformColor4fv(color);
141  immRecti(pos, x1, y1, x2, y2);
143 }
144 #endif
145 
158 {
159  immUniformColor3ub(((x)&0xFF), (((x) >> 8) & 0xFF), (((x) >> 16) & 0xFF));
160 }
161 
162 static void imm_draw_circle(GPUPrimType prim_type,
163  const uint shdr_pos,
164  float x,
165  float y,
166  float rad_x,
167  float rad_y,
168  int nsegments)
169 {
170  immBegin(prim_type, nsegments);
171  for (int i = 0; i < nsegments; i++) {
172  const float angle = (float)(2 * M_PI) * ((float)i / (float)nsegments);
173  immVertex2f(shdr_pos, x + (rad_x * cosf(angle)), y + (rad_y * sinf(angle)));
174  }
175  immEnd();
176 }
177 
188 void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float rad, int nsegments)
189 {
190  imm_draw_circle(GPU_PRIM_LINE_LOOP, shdr_pos, x, y, rad, rad, nsegments);
191 }
192 
203 void imm_draw_circle_fill_2d(uint shdr_pos, float x, float y, float rad, int nsegments)
204 {
205  imm_draw_circle(GPU_PRIM_TRI_FAN, shdr_pos, x, y, rad, rad, nsegments);
206 }
207 
209  uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments)
210 {
211  imm_draw_circle(GPU_PRIM_LINE_LOOP, shdr_pos, x, y, rad_x, rad_y, nsegments);
212 }
214  uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments)
215 {
216  imm_draw_circle(GPU_PRIM_TRI_FAN, shdr_pos, x, y, rad_x, rad_y, nsegments);
217 }
218 
219 static void imm_draw_circle_partial(GPUPrimType prim_type,
220  uint pos,
221  float x,
222  float y,
223  float rad,
224  int nsegments,
225  float start,
226  float sweep)
227 {
228  /* shift & reverse angle, increase 'nsegments' to match gluPartialDisk */
229  const float angle_start = -(DEG2RADF(start)) + (float)(M_PI / 2);
230  const float angle_end = -(DEG2RADF(sweep) - angle_start);
231  nsegments += 1;
232  immBegin(prim_type, nsegments);
233  for (int i = 0; i < nsegments; i++) {
234  const float angle = interpf(angle_start, angle_end, ((float)i / (float)(nsegments - 1)));
235  const float angle_sin = sinf(angle);
236  const float angle_cos = cosf(angle);
237  immVertex2f(pos, x + rad * angle_cos, y + rad * angle_sin);
238  }
239  immEnd();
240 }
241 
243  uint pos, float x, float y, float rad, int nsegments, float start, float sweep)
244 {
245  imm_draw_circle_partial(GPU_PRIM_LINE_STRIP, pos, x, y, rad, nsegments, start, sweep);
246 }
247 
248 static void imm_draw_disk_partial(GPUPrimType prim_type,
249  uint pos,
250  float x,
251  float y,
252  float rad_inner,
253  float rad_outer,
254  int nsegments,
255  float start,
256  float sweep)
257 {
258  /* to avoid artifacts */
259  const float max_angle = 3 * 360;
260  CLAMP(sweep, -max_angle, max_angle);
261 
262  /* shift & reverse angle, increase 'nsegments' to match gluPartialDisk */
263  const float angle_start = -(DEG2RADF(start)) + (float)(M_PI / 2);
264  const float angle_end = -(DEG2RADF(sweep) - angle_start);
265  nsegments += 1;
266  immBegin(prim_type, nsegments * 2);
267  for (int i = 0; i < nsegments; i++) {
268  const float angle = interpf(angle_start, angle_end, ((float)i / (float)(nsegments - 1)));
269  const float angle_sin = sinf(angle);
270  const float angle_cos = cosf(angle);
271  immVertex2f(pos, x + rad_inner * angle_cos, y + rad_inner * angle_sin);
272  immVertex2f(pos, x + rad_outer * angle_cos, y + rad_outer * angle_sin);
273  }
274  immEnd();
275 }
276 
293  float x,
294  float y,
295  float rad_inner,
296  float rad_outer,
297  int nsegments,
298  float start,
299  float sweep)
300 {
302  GPU_PRIM_TRI_STRIP, pos, x, y, rad_inner, rad_outer, nsegments, start, sweep);
303 }
304 
305 static void imm_draw_circle_3D(
306  GPUPrimType prim_type, uint pos, float x, float y, float rad, int nsegments)
307 {
308  immBegin(prim_type, nsegments);
309  for (int i = 0; i < nsegments; i++) {
310  float angle = (float)(2 * M_PI) * ((float)i / (float)nsegments);
311  immVertex3f(pos, x + rad * cosf(angle), y + rad * sinf(angle), 0.0f);
312  }
313  immEnd();
314 }
315 
316 void imm_draw_circle_wire_3d(uint pos, float x, float y, float rad, int nsegments)
317 {
318  imm_draw_circle_3D(GPU_PRIM_LINE_LOOP, pos, x, y, rad, nsegments);
319 }
320 
321 void imm_draw_circle_dashed_3d(uint pos, float x, float y, float rad, int nsegments)
322 {
323  imm_draw_circle_3D(GPU_PRIM_LINES, pos, x, y, rad, nsegments / 2);
324 }
325 
326 void imm_draw_circle_fill_3d(uint pos, float x, float y, float rad, int nsegments)
327 {
328  imm_draw_circle_3D(GPU_PRIM_TRI_FAN, pos, x, y, rad, nsegments);
329 }
330 
340 void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2)
341 {
343  immVertex2f(pos, x1, y1);
344  immVertex2f(pos, x1, y2);
345  immVertex2f(pos, x2, y2);
346  immVertex2f(pos, x2, y1);
347  immEnd();
348 }
349 
350 void imm_draw_box_wire_3d(uint pos, float x1, float y1, float x2, float y2)
351 {
352  /* use this version when GPUVertFormat has a vec3 position */
354  immVertex3f(pos, x1, y1, 0.0f);
355  immVertex3f(pos, x1, y2, 0.0f);
356  immVertex3f(pos, x2, y2, 0.0f);
357  immVertex3f(pos, x2, y1, 0.0f);
358  immEnd();
359 }
360 
365  float y1,
366  float x2,
367  float y2,
368  const float color_primary[4],
369  const float color_secondary[4],
370  int checker_size)
371 {
373 
375 
376  immUniform4fv("color1", color_primary);
377  immUniform4fv("color2", color_secondary);
378  immUniform1i("size", checker_size);
379 
380  immRectf(pos, x1, y1, x2, y2);
381 
383 }
384 void imm_draw_box_checker_2d(float x1, float y1, float x2, float y2)
385 {
386  float checker_primary[4];
387  float checker_secondary[4];
390  int checker_size = UI_GetThemeValue(TH_TRANSPARENT_CHECKER_SIZE);
391  imm_draw_box_checker_2d_ex(x1, y1, x2, y2, checker_primary, checker_secondary, checker_size);
392 }
393 
394 void imm_draw_cube_fill_3d(uint pos, const float co[3], const float aspect[3])
395 {
396  float coords[ARRAY_SIZE(cube_coords)][3];
397 
398  for (int i = 0; i < ARRAY_SIZE(cube_coords); i++) {
399  madd_v3_v3v3v3(coords[i], co, cube_coords[i], aspect);
400  }
401 
403  for (int i = 0; i < ARRAY_SIZE(cube_quad_index); i++) {
404  immVertex3fv(pos, coords[cube_quad_index[i][0]]);
405  immVertex3fv(pos, coords[cube_quad_index[i][1]]);
406  immVertex3fv(pos, coords[cube_quad_index[i][2]]);
407 
408  immVertex3fv(pos, coords[cube_quad_index[i][0]]);
409  immVertex3fv(pos, coords[cube_quad_index[i][2]]);
410  immVertex3fv(pos, coords[cube_quad_index[i][3]]);
411  }
412  immEnd();
413 }
414 
415 void imm_draw_cube_wire_3d(uint pos, const float co[3], const float aspect[3])
416 {
417  float coords[ARRAY_SIZE(cube_coords)][3];
418 
419  for (int i = 0; i < ARRAY_SIZE(cube_coords); i++) {
420  madd_v3_v3v3v3(coords[i], co, cube_coords[i], aspect);
421  }
422 
424  for (int i = 0; i < ARRAY_SIZE(cube_line_index); i++) {
425  immVertex3fv(pos, coords[cube_line_index[i][0]]);
426  immVertex3fv(pos, coords[cube_line_index[i][1]]);
427  }
428  immEnd();
429 }
430 
444  uint pos, uint nor, float base, float top, float height, int slices, int stacks)
445 {
446  immBegin(GPU_PRIM_TRIS, 6 * slices * stacks);
447  for (int i = 0; i < slices; i++) {
448  const float angle1 = (float)(2 * M_PI) * ((float)i / (float)slices);
449  const float angle2 = (float)(2 * M_PI) * ((float)(i + 1) / (float)slices);
450  const float cos1 = cosf(angle1);
451  const float sin1 = sinf(angle1);
452  const float cos2 = cosf(angle2);
453  const float sin2 = sinf(angle2);
454 
455  for (int j = 0; j < stacks; j++) {
456  float fac1 = (float)j / (float)stacks;
457  float fac2 = (float)(j + 1) / (float)stacks;
458  float r1 = base * (1.0f - fac1) + top * fac1;
459  float r2 = base * (1.0f - fac2) + top * fac2;
460  float h1 = height * ((float)j / (float)stacks);
461  float h2 = height * ((float)(j + 1) / (float)stacks);
462 
463  const float v1[3] = {r1 * cos2, r1 * sin2, h1};
464  const float v2[3] = {r2 * cos2, r2 * sin2, h2};
465  const float v3[3] = {r2 * cos1, r2 * sin1, h2};
466  const float v4[3] = {r1 * cos1, r1 * sin1, h1};
467  float n1[3], n2[3];
468 
469  /* calc normals */
470  sub_v3_v3v3(n1, v2, v1);
471  normalize_v3(n1);
472  n1[0] = cos1;
473  n1[1] = sin1;
474  n1[2] = 1 - n1[2];
475 
476  sub_v3_v3v3(n2, v3, v4);
477  normalize_v3(n2);
478  n2[0] = cos2;
479  n2[1] = sin2;
480  n2[2] = 1 - n2[2];
481 
482  /* first tri */
483  immAttr3fv(nor, n2);
484  immVertex3fv(pos, v1);
485  immVertex3fv(pos, v2);
486  immAttr3fv(nor, n1);
487  immVertex3fv(pos, v3);
488 
489  /* second tri */
490  immVertex3fv(pos, v3);
491  immVertex3fv(pos, v4);
492  immAttr3fv(nor, n2);
493  immVertex3fv(pos, v1);
494  }
495  }
496  immEnd();
497 }
498 
500  uint pos, float base, float top, float height, int slices, int stacks)
501 {
502  immBegin(GPU_PRIM_LINES, 6 * slices * stacks);
503  for (int i = 0; i < slices; i++) {
504  const float angle1 = (float)(2 * M_PI) * ((float)i / (float)slices);
505  const float angle2 = (float)(2 * M_PI) * ((float)(i + 1) / (float)slices);
506  const float cos1 = cosf(angle1);
507  const float sin1 = sinf(angle1);
508  const float cos2 = cosf(angle2);
509  const float sin2 = sinf(angle2);
510 
511  for (int j = 0; j < stacks; j++) {
512  float fac1 = (float)j / (float)stacks;
513  float fac2 = (float)(j + 1) / (float)stacks;
514  float r1 = base * (1.0f - fac1) + top * fac1;
515  float r2 = base * (1.0f - fac2) + top * fac2;
516  float h1 = height * ((float)j / (float)stacks);
517  float h2 = height * ((float)(j + 1) / (float)stacks);
518 
519  const float v1[3] = {r1 * cos2, r1 * sin2, h1};
520  const float v2[3] = {r2 * cos2, r2 * sin2, h2};
521  const float v3[3] = {r2 * cos1, r2 * sin1, h2};
522  const float v4[3] = {r1 * cos1, r1 * sin1, h1};
523 
524  immVertex3fv(pos, v1);
525  immVertex3fv(pos, v2);
526 
527  immVertex3fv(pos, v2);
528  immVertex3fv(pos, v3);
529 
530  immVertex3fv(pos, v1);
531  immVertex3fv(pos, v4);
532  }
533  }
534  immEnd();
535 }
536 
538  uint pos, float base, float top, float height, int slices, int stacks)
539 {
540  immBegin(GPU_PRIM_TRIS, 6 * slices * stacks);
541  for (int i = 0; i < slices; i++) {
542  const float angle1 = (float)(2 * M_PI) * ((float)i / (float)slices);
543  const float angle2 = (float)(2 * M_PI) * ((float)(i + 1) / (float)slices);
544  const float cos1 = cosf(angle1);
545  const float sin1 = sinf(angle1);
546  const float cos2 = cosf(angle2);
547  const float sin2 = sinf(angle2);
548 
549  for (int j = 0; j < stacks; j++) {
550  float fac1 = (float)j / (float)stacks;
551  float fac2 = (float)(j + 1) / (float)stacks;
552  float r1 = base * (1.0f - fac1) + top * fac1;
553  float r2 = base * (1.0f - fac2) + top * fac2;
554  float h1 = height * ((float)j / (float)stacks);
555  float h2 = height * ((float)(j + 1) / (float)stacks);
556 
557  const float v1[3] = {r1 * cos2, r1 * sin2, h1};
558  const float v2[3] = {r2 * cos2, r2 * sin2, h2};
559  const float v3[3] = {r2 * cos1, r2 * sin1, h2};
560  const float v4[3] = {r1 * cos1, r1 * sin1, h1};
561 
562  /* first tri */
563  immVertex3fv(pos, v1);
564  immVertex3fv(pos, v2);
565  immVertex3fv(pos, v3);
566 
567  /* second tri */
568  immVertex3fv(pos, v3);
569  immVertex3fv(pos, v4);
570  immVertex3fv(pos, v1);
571  }
572  }
573  immEnd();
574 }
typedef float(TangentPoint)[2]
MINLINE float interpf(float a, float b, float t)
#define M_PI
Definition: BLI_math_base.h:38
#define DEG2RADF(_deg)
MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3])
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
unsigned int uint
Definition: BLI_sys_types.h:83
#define ARRAY_SIZE(arr)
void immAttr4fv(uint attr_id, const float data[4])
void immUniformColor3ub(unsigned char r, unsigned char g, unsigned char b)
void immUnbindProgram(void)
void immVertex2f(uint attr_id, float x, float y)
void immBindBuiltinProgram(eGPUBuiltinShader shader_id)
void immVertex3f(uint attr_id, float x, float y, float z)
void immUniform1i(const char *name, int x)
void immVertex2i(uint attr_id, int x, int y)
void immUniformColor4fv(const float rgba[4])
GPUVertFormat * immVertexFormat(void)
void immUniform4fv(const char *name, const float data[4])
void immAttr3fv(uint attr_id, const float data[3])
void immVertex3fv(uint attr_id, const float data[3])
void immBegin(GPUPrimType, uint vertex_len)
void immEnd(void)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble y1
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble top
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
GPUPrimType
Definition: GPU_primitive.h:34
@ GPU_PRIM_TRI_FAN
Definition: GPU_primitive.h:41
@ GPU_PRIM_LINE_LOOP
Definition: GPU_primitive.h:39
@ GPU_PRIM_LINES
Definition: GPU_primitive.h:36
@ GPU_PRIM_LINE_STRIP
Definition: GPU_primitive.h:38
@ GPU_PRIM_TRI_STRIP
Definition: GPU_primitive.h:40
@ GPU_PRIM_TRIS
Definition: GPU_primitive.h:37
@ GPU_SHADER_2D_CHECKER
Definition: GPU_shader.h:191
@ GPU_SHADER_2D_UNIFORM_COLOR
Definition: GPU_shader.h:171
@ GPU_FETCH_FLOAT
@ GPU_FETCH_INT_TO_FLOAT
uint GPU_vertformat_attr_add(GPUVertFormat *, const char *name, GPUVertCompType, uint comp_len, GPUVertFetchMode)
@ GPU_COMP_F32
@ GPU_COMP_I32
Group RGB to Bright Vector Camera CLAMP
@ TH_TRANSPARENT_CHECKER_PRIMARY
Definition: UI_resources.h:312
@ TH_TRANSPARENT_CHECKER_SECONDARY
Definition: UI_resources.h:313
@ TH_TRANSPARENT_CHECKER_SIZE
Definition: UI_resources.h:314
void UI_GetThemeColor4fv(int colorid, float col[4])
Definition: resources.c:1199
int UI_GetThemeValue(int colorid)
Definition: resources.c:1171
ATTR_WARN_UNUSED_RESULT const BMVert * v2
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
Definition: btVector3.h:356
uint pos
uint nor
uint col
void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2)
void imm_draw_box_checker_2d(float x1, float y1, float x2, float y2)
void imm_draw_cylinder_wire_3d(uint pos, float base, float top, float height, int slices, int stacks)
void imm_draw_circle_dashed_3d(uint pos, float x, float y, float rad, int nsegments)
void imm_draw_cylinder_fill_3d(uint pos, float base, float top, float height, int slices, int stacks)
void imm_draw_cylinder_fill_normal_3d(uint pos, uint nor, float base, float top, float height, int slices, int stacks)
void imm_draw_circle_fill_aspect_2d(uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments)
void imm_draw_box_checker_2d_ex(float x1, float y1, float x2, float y2, const float color_primary[4], const float color_secondary[4], int checker_size)
static void imm_draw_disk_partial(GPUPrimType prim_type, uint pos, float x, float y, float rad_inner, float rad_outer, int nsegments, float start, float sweep)
void imm_draw_cube_fill_3d(uint pos, const float co[3], const float aspect[3])
void immRectf_fast(uint pos, float x1, float y1, float x2, float y2)
void imm_draw_circle_wire_aspect_2d(uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments)
void immRecti(uint pos, int x1, int y1, int x2, int y2)
void imm_draw_circle_fill_3d(uint pos, float x, float y, float rad, int nsegments)
static const int cube_quad_index[6][4]
void imm_draw_circle_fill_2d(uint shdr_pos, float x, float y, float rad, int nsegments)
void immRectf_fast_with_color(uint pos, uint col, float x1, float y1, float x2, float y2, const float color[4])
static void imm_draw_circle_partial(GPUPrimType prim_type, uint pos, float x, float y, float rad, int nsegments, float start, float sweep)
void imm_draw_box_wire_3d(uint pos, float x1, float y1, float x2, float y2)
void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float rad, int nsegments)
void immRectf(uint pos, float x1, float y1, float x2, float y2)
static void imm_draw_circle_3D(GPUPrimType prim_type, uint pos, float x, float y, float rad, int nsegments)
static const float cube_coords[8][3]
static const int cube_line_index[12][2]
void imm_draw_circle_partial_wire_2d(uint pos, float x, float y, float rad, int nsegments, float start, float sweep)
void imm_cpack(uint x)
static void imm_draw_circle(GPUPrimType prim_type, const uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments)
void imm_draw_cube_wire_3d(uint pos, const float co[3], const float aspect[3])
void imm_draw_disk_partial_fill_2d(uint pos, float x, float y, float rad_inner, float rad_outer, int nsegments, float start, float sweep)
void imm_draw_circle_wire_3d(uint pos, float x, float y, float rad, int nsegments)
void immRecti_fast_with_color(uint pos, uint col, int x1, int y1, int x2, int y2, const float color[4])
#define sinf(x)
#define cosf(x)
format
Definition: logImageCore.h:47