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 17 /** \file 18 * \ingroup gpu 19 * 20 * Utility drawing functions (rough equivalent to OpenGL's GLU) 21 */ 22 23 #pragma once 24 25 #ifdef __cplusplus 26 extern "C" { 27 #endif 28 29 /* Draw 2D rectangles (replaces glRect functions) */ 30 /* caller is responsible for vertex format & shader */ 31 void immRectf(uint pos, float x1, float y1, float x2, float y2); 32 void immRecti(uint pos, int x1, int y1, int x2, int y2); 33 34 /* Same as immRectf/immRecti but does not call immBegin/immEnd. To use with GPU_PRIM_TRIS. */ 35 void immRectf_fast(uint pos, float x1, float y1, float x2, float y2); 36 void immRectf_fast_with_color( 37 uint pos, uint col, float x1, float y1, float x2, float y2, const float color[4]); 38 void immRecti_fast_with_color( 39 uint pos, uint col, int x1, int y1, int x2, int y2, const float color[4]); 40 41 void imm_cpack(uint x); 42 43 void imm_draw_circle_wire_2d(uint shdr_pos, float x, float y, float radius, int nsegments); 44 void imm_draw_circle_fill_2d(uint shdr_pos, float x, float y, float radius, int nsegments); 45 46 void imm_draw_circle_wire_aspect_2d( 47 uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments); 48 void imm_draw_circle_fill_aspect_2d( 49 uint shdr_pos, float x, float y, float rad_x, float rad_y, int nsegments); 50 51 /* use this version when GPUVertFormat has a vec3 position */ 52 void imm_draw_circle_wire_3d(uint pos, float x, float y, float radius, int nsegments); 53 void imm_draw_circle_dashed_3d(uint pos, float x, float y, float radius, int nsegments); 54 void imm_draw_circle_fill_3d(uint pos, float x, float y, float radius, int nsegments); 55 56 /* same as 'imm_draw_disk_partial_fill_2d', except it draws a wire arc. */ 57 void imm_draw_circle_partial_wire_2d( 58 uint pos, float x, float y, float radius, int nsegments, float start, float sweep); 59 60 void imm_draw_disk_partial_fill_2d(uint pos, 61 float x, 62 float y, 63 float rad_inner, 64 float rad_outer, 65 int nsegments, 66 float start, 67 float sweep); 68 69 void imm_draw_box_wire_2d(uint pos, float x1, float y1, float x2, float y2); 70 void imm_draw_box_wire_3d(uint pos, float x1, float y1, float x2, float y2); 71 72 void imm_draw_box_checker_2d_ex(float x1, 73 float y1, 74 float x2, 75 float y2, 76 const float color_primary[4], 77 const float color_secondary[4], 78 int checker_size); 79 void imm_draw_box_checker_2d(float x1, float y1, float x2, float y2); 80 81 void imm_draw_cube_fill_3d(uint pos, const float co[3], const float aspect[3]); 82 void imm_draw_cube_wire_3d(uint pos, const float co[3], const float aspect[3]); 83 84 void imm_draw_cylinder_fill_normal_3d( 85 uint pos, uint nor, float base, float top, float height, int slices, int stacks); 86 void imm_draw_cylinder_wire_3d( 87 uint pos, float base, float top, float height, int slices, int stacks); 88 void imm_draw_cylinder_fill_3d( 89 uint pos, float base, float top, float height, int slices, int stacks); 90 91 #ifdef __cplusplus 92 } 93 #endif 94