| 
									
										
										
										
											2017-04-05 18:30:14 +10:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * This program is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  * modify it under the terms of the GNU General Public License | 
					
						
							|  |  |  |  * as published by the Free Software Foundation; either version 2 | 
					
						
							|  |  |  |  * of the License, or (at your option) any later version. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  * GNU General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  * along with this program; if not, write to the Free Software Foundation, | 
					
						
							|  |  |  |  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-18 08:08:12 +11:00
										 |  |  | /** \file
 | 
					
						
							|  |  |  |  * \ingroup gpu | 
					
						
							| 
									
										
										
										
											2017-04-05 18:30:14 +10:00
										 |  |  |  * | 
					
						
							|  |  |  |  * Utility drawing functions (rough equivalent to OpenGL's GLU) | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-08-07 09:50:34 +02:00
										 |  |  | #pragma once
 | 
					
						
							| 
									
										
										
										
											2017-04-05 18:30:14 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-02 15:28:47 +01:00
										 |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | extern "C" { | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-17 21:11:23 +02:00
										 |  |  | /* Draw 2D rectangles (replaces glRect functions) */ | 
					
						
							| 
									
										
										
										
											2018-09-24 18:46:51 +02:00
										 |  |  | /* caller is responsible for vertex format & shader */ | 
					
						
							| 
									
										
										
										
											2018-07-17 21:11:23 +02:00
										 |  |  | void immRectf(uint pos, float x1, float y1, float x2, float y2); | 
					
						
							|  |  |  | void immRecti(uint pos, int x1, int y1, int x2, int y2); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-18 00:12:21 +02:00
										 |  |  | /* Same as immRectf/immRecti but does not call immBegin/immEnd. To use with GPU_PRIM_TRIS. */ | 
					
						
							| 
									
										
										
										
											2018-11-16 19:26:23 +01:00
										 |  |  | void immRectf_fast(uint pos, float x1, float y1, float x2, float y2); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | void immRectf_fast_with_color( | 
					
						
							|  |  |  |     uint pos, uint col, float x1, float y1, float x2, float y2, const float color[4]); | 
					
						
							|  |  |  | void immRecti_fast_with_color( | 
					
						
							|  |  |  |     uint pos, uint col, int x1, int y1, int x2, int y2, const float color[4]); | 
					
						
							| 
									
										
										
										
											2018-07-17 21:11:23 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-14 00:39:28 +10:00
										 |  |  | void imm_cpack(uint x); | 
					
						
							| 
									
										
										
										
											2017-04-05 18:30:14 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-14 00:39:28 +10:00
										 |  |  | void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float radius, int nsegments); | 
					
						
							|  |  |  | void imm_draw_circle_fill_2d(uint shdr_pos, float x, float y, float radius, int nsegments); | 
					
						
							| 
									
										
										
										
											2017-04-05 18:30:14 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | void imm_draw_circle_wire_aspect_2d( | 
					
						
							| 
									
										
										
										
											2020-09-04 20:59:13 +02:00
										 |  |  |     uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments); | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | void imm_draw_circle_fill_aspect_2d( | 
					
						
							| 
									
										
										
										
											2020-09-04 20:59:13 +02:00
										 |  |  |     uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments); | 
					
						
							| 
									
										
										
										
											2017-09-14 01:36:23 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-18 00:12:21 +02:00
										 |  |  | /* use this version when GPUVertFormat has a vec3 position */ | 
					
						
							| 
									
										
										
										
											2017-09-14 00:39:28 +10:00
										 |  |  | void imm_draw_circle_wire_3d(uint pos, float x, float y, float radius, int nsegments); | 
					
						
							| 
									
										
										
										
											2020-02-28 14:40:40 +01:00
										 |  |  | void imm_draw_circle_dashed_3d(uint pos, float x, float y, float radius, int nsegments); | 
					
						
							| 
									
										
										
										
											2017-09-14 00:39:28 +10:00
										 |  |  | void imm_draw_circle_fill_3d(uint pos, float x, float y, float radius, int nsegments); | 
					
						
							| 
									
										
										
										
											2017-04-05 18:30:14 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-24 16:22:22 +10:00
										 |  |  | /* same as 'imm_draw_disk_partial_fill_2d', except it draws a wire arc. */ | 
					
						
							|  |  |  | void imm_draw_circle_partial_wire_2d( | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |     uint pos, float x, float y, float radius, int nsegments, float start, float sweep); | 
					
						
							| 
									
										
										
										
											2018-09-24 16:22:22 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  | void imm_draw_disk_partial_fill_2d(uint pos, | 
					
						
							|  |  |  |                                    float x, | 
					
						
							|  |  |  |                                    float y, | 
					
						
							| 
									
										
										
										
											2020-09-04 20:59:13 +02:00
										 |  |  |                                    float rad_inner, | 
					
						
							|  |  |  |                                    float rad_outer, | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |                                    int nsegments, | 
					
						
							|  |  |  |                                    float start, | 
					
						
							|  |  |  |                                    float sweep); | 
					
						
							| 
									
										
										
										
											2017-04-05 18:30:14 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-26 15:21:01 +10:00
										 |  |  | void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2); | 
					
						
							|  |  |  | void imm_draw_box_wire_3d(uint pos, float x1, float y1, float x2, float y2); | 
					
						
							| 
									
										
										
										
											2017-04-05 18:30:14 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-30 17:45:02 +10:00
										 |  |  | 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); | 
					
						
							| 
									
										
										
										
											2017-09-26 15:21:01 +10:00
										 |  |  | void imm_draw_box_checker_2d(float x1, float y1, float x2, float y2); | 
					
						
							| 
									
										
										
										
											2017-04-05 18:30:14 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-26 17:51:47 +10:00
										 |  |  | void imm_draw_cube_fill_3d(uint pos, const float co[3], const float aspect[3]); | 
					
						
							|  |  |  | void imm_draw_cube_wire_3d(uint pos, const float co[3], const float aspect[3]); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-05 18:30:14 +10:00
										 |  |  | void imm_draw_cylinder_fill_normal_3d( | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |     uint pos, uint nor, float base, float top, float height, int slices, int stacks); | 
					
						
							| 
									
										
										
										
											2017-04-05 18:30:14 +10:00
										 |  |  | void imm_draw_cylinder_wire_3d( | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |     uint pos, float base, float top, float height, int slices, int stacks); | 
					
						
							| 
									
										
										
										
											2017-04-05 18:30:14 +10:00
										 |  |  | void imm_draw_cylinder_fill_3d( | 
					
						
							| 
									
										
										
										
											2019-04-17 06:17:24 +02:00
										 |  |  |     uint pos, float base, float top, float height, int slices, int stacks); | 
					
						
							| 
									
										
										
										
											2017-04-05 18:30:14 +10:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-02 15:28:47 +01:00
										 |  |  | #ifdef __cplusplus
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #endif
 |