raylib.c.v (66856B)
1 module vraylib 2 3 #flag -I @VMODROOT/c 4 #flag -l raylib 5 6 #include "raylib.h" 7 8 @[typedef] 9 struct C.Vector2 { 10 pub mut: 11 x f32 12 y f32 13 } 14 15 pub type Vector2 = C.Vector2 16 17 @[typedef] 18 struct C.Vector3 { 19 pub mut: 20 x f32 21 y f32 22 z f32 23 } 24 25 pub type Vector3 = C.Vector3 26 27 @[typedef] 28 struct C.Vector4 { 29 pub mut: 30 x f32 31 y f32 32 z f32 33 w f32 34 } 35 36 pub type Vector4 = C.Vector4 37 38 pub type Quaternion = C.Vector4 39 40 @[typedef] 41 struct C.Matrix { 42 pub mut: 43 m0 f32 44 m4 f32 45 m8 f32 46 m12 f32 47 m1 f32 48 m5 f32 49 m9 f32 50 m13 f32 51 m2 f32 52 m6 f32 53 m10 f32 54 m14 f32 55 m3 f32 56 m7 f32 57 m11 f32 58 m15 f32 59 } 60 61 pub type Matrix = C.Matrix 62 63 @[typedef] 64 struct C.Color { 65 pub mut: 66 r u8 67 g u8 68 b u8 69 a u8 70 } 71 72 pub type Color = C.Color 73 74 @[typedef] 75 struct C.Rectangle { 76 pub mut: 77 x f32 78 y f32 79 width f32 80 height f32 81 } 82 83 pub type Rectangle = C.Rectangle 84 85 @[typedef] 86 struct C.Image { 87 pub mut: 88 data voidptr 89 width int 90 height int 91 mipmaps int 92 format int 93 } 94 95 pub type Image = C.Image 96 97 @[typedef] 98 struct C.Texture { 99 pub mut: 100 id u32 101 width int 102 height int 103 mipmaps int 104 format int 105 } 106 107 pub type Texture = C.Texture 108 109 pub type Texture2D = C.Texture 110 pub type TextureCubemap = C.Texture 111 112 @[typedef] 113 struct C.RenderTexture { 114 pub mut: 115 id u32 116 texture Texture 117 depth Texture 118 } 119 120 pub type RenderTexture = C.RenderTexture 121 122 pub type RenderTexture2D = C.RenderTexture 123 124 @[typedef] 125 struct C.NPatchInfo { 126 pub mut: 127 source Rectangle 128 left int 129 top int 130 right int 131 bottom int 132 layout int 133 } 134 135 pub type NPatchInfo = C.NPatchInfo 136 137 @[typedef] 138 struct C.GlyphInfo { 139 pub mut: 140 value int 141 offsetX int 142 offsetY int 143 advanceX int 144 image Image 145 } 146 147 pub type GlyphInfo = C.GlyphInfo 148 149 @[typedef] 150 struct C.Font { 151 pub mut: 152 baseSize int 153 glyphCount int 154 glyphPadding int 155 texture Texture2D 156 recs &Rectangle 157 glyphs &GlyphInfo 158 } 159 160 pub type Font = C.Font 161 162 @[typedef] 163 struct C.Camera3D { 164 pub mut: 165 position Vector3 166 target Vector3 167 up Vector3 168 fovy f32 169 projection int 170 } 171 172 pub type Camera3D = C.Camera3D 173 174 pub type Camera = C.Camera3D 175 176 @[typedef] 177 struct C.Camera2D { 178 pub mut: 179 offset Vector2 180 target Vector2 181 rotation f32 182 zoom f32 183 } 184 185 pub type Camera2D = C.Camera2D 186 187 @[typedef] 188 struct C.Mesh { 189 pub mut: 190 vertexCount int 191 triangleCount int 192 vertices &f32 193 texcoords &f32 194 texcoords2 &f32 195 normals &f32 196 tangents &f32 197 colors &u8 198 indices &u16 199 animVertices &f32 200 animNormals &f32 201 boneIds &u8 202 boneWeights &f32 203 vaoId u32 204 vboId &u32 205 } 206 207 pub type Mesh = C.Mesh 208 209 @[typedef] 210 struct C.Shader { 211 pub mut: 212 id u32 213 locs &int 214 } 215 216 pub type Shader = C.Shader 217 218 @[typedef] 219 struct C.MaterialMap { 220 pub mut: 221 texture Texture2D 222 color Color 223 value f32 224 } 225 226 pub type MaterialMap = C.MaterialMap 227 228 @[typedef] 229 struct C.Material { 230 pub mut: 231 shader Shader 232 maps &MaterialMap 233 params [4]f32 234 } 235 236 pub type Material = C.Material 237 238 @[typedef] 239 struct C.Transform { 240 pub mut: 241 translation Vector3 242 rotation Quaternion 243 scale Vector3 244 } 245 246 pub type Transform = C.Transform 247 248 @[typedef] 249 struct C.BoneInfo { 250 pub mut: 251 name [32]i8 252 parent int 253 } 254 255 pub type BoneInfo = C.BoneInfo 256 257 @[typedef] 258 struct C.Model { 259 pub mut: 260 transform Matrix 261 meshCount int 262 materialCount int 263 meshes &Mesh 264 materials &Material 265 meshMaterial &int 266 boneCount int 267 bones &BoneInfo 268 bindPose &Transform 269 } 270 271 pub type Model = C.Model 272 273 @[typedef] 274 struct C.ModelAnimation { 275 pub mut: 276 boneCount int 277 frameCount int 278 bones &BoneInfo 279 framePoses &&Transform 280 name [32]i8 281 } 282 283 pub type ModelAnimation = C.ModelAnimation 284 285 @[typedef] 286 struct C.Ray { 287 pub mut: 288 position Vector3 289 direction Vector3 290 } 291 292 pub type Ray = C.Ray 293 294 @[typedef] 295 struct C.RayCollision { 296 pub mut: 297 hit bool 298 distance f32 299 point Vector3 300 normal Vector3 301 } 302 303 pub type RayCollision = C.RayCollision 304 305 @[typedef] 306 struct C.BoundingBox { 307 pub mut: 308 min Vector3 309 max Vector3 310 } 311 312 pub type BoundingBox = C.BoundingBox 313 314 @[typedef] 315 struct C.Wave { 316 pub mut: 317 frameCount u32 318 sampleRate u32 319 sampleSize u32 320 channels u32 321 data voidptr 322 } 323 324 pub type Wave = C.Wave 325 326 @[typedef] 327 struct C.AudioStream { 328 pub mut: 329 buffer C.rAudioBuffer 330 processor C.rAudioProcessor 331 sampleRate u32 332 sampleSize u32 333 channels u32 334 } 335 336 pub type AudioStream = C.AudioStream 337 338 @[typedef] 339 struct C.Sound { 340 pub mut: 341 stream AudioStream 342 frameCount u32 343 } 344 345 pub type Sound = C.Sound 346 347 @[typedef] 348 struct C.Music { 349 pub mut: 350 stream AudioStream 351 frameCount u32 352 looping bool 353 ctxType int 354 ctxData voidptr 355 } 356 357 pub type Music = C.Music 358 359 @[typedef] 360 struct C.VrDeviceInfo { 361 pub mut: 362 hResolution int 363 vResolution int 364 hScreenSize f32 365 vScreenSize f32 366 eyeToScreenDistance f32 367 lensSeparationDistance f32 368 interpupillaryDistance f32 369 lensDistortionValues [4]f32 370 chromaAbCorrection [4]f32 371 } 372 373 pub type VrDeviceInfo = C.VrDeviceInfo 374 375 @[typedef] 376 struct C.VrStereoConfig { 377 pub mut: 378 projection [2]Matrix 379 viewOffset [2]Matrix 380 leftLensCenter [2]f32 381 rightLensCenter [2]f32 382 leftScreenCenter [2]f32 383 rightScreenCenter [2]f32 384 scale [2]f32 385 scaleIn [2]f32 386 } 387 388 pub type VrStereoConfig = C.VrStereoConfig 389 390 @[typedef] 391 struct C.FilePathList { 392 pub mut: 393 capacity u32 394 count u32 395 paths &&u8 396 } 397 398 pub type FilePathList = C.FilePathList 399 400 @[typedef] 401 struct C.AutomationEvent { 402 pub mut: 403 frame u32 404 type_ u32 405 params [4]int 406 } 407 408 pub type AutomationEvent = C.AutomationEvent 409 410 @[typedef] 411 struct C.AutomationEventList { 412 pub mut: 413 capacity u32 414 count u32 415 events &AutomationEvent 416 } 417 418 pub type AutomationEventList = C.AutomationEventList 419 420 pub const ( 421 lightgray = Color{ 200, 200, 200, 255 } 422 gray = Color{ 130, 130, 130, 255 } 423 darkgray = Color{ 80, 80, 80, 255 } 424 yellow = Color{ 253, 249, 0, 255 } 425 gold = Color{ 255, 203, 0, 255 } 426 orange = Color{ 255, 161, 0, 255 } 427 pink = Color{ 255, 109, 194, 255 } 428 red = Color{ 230, 41, 55, 255 } 429 maroon = Color{ 190, 33, 55, 255 } 430 green = Color{ 0, 228, 48, 255 } 431 lime = Color{ 0, 158, 47, 255 } 432 darkgreen = Color{ 0, 117, 44, 255 } 433 skyblue = Color{ 102, 191, 255, 255 } 434 blue = Color{ 0, 121, 241, 255 } 435 darkblue = Color{ 0, 82, 172, 255 } 436 purple = Color{ 200, 122, 255, 255 } 437 violet = Color{ 135, 60, 190, 255 } 438 darkpurple = Color{ 112, 31, 126, 255 } 439 beige = Color{ 211, 176, 131, 255 } 440 brown = Color{ 127, 106, 79, 255 } 441 darkbrown = Color{ 76, 63, 47, 255 } 442 443 white = Color{ 255, 255, 255, 255 } 444 black = Color{ 0, 0, 0, 255 } 445 blank = Color{ 0, 0, 0, 0 } 446 magenta = Color{ 255, 0, 255, 255 } 447 raywhite = Color{ 245, 245, 245, 255 } 448 ) 449 450 pub enum ConfigFlags { 451 flag_vsync_hint = 64 452 flag_fullscreen_mode = 2 453 flag_window_resizable = 4 454 flag_window_undecorated = 8 455 flag_window_hidden = 128 456 flag_window_minimized = 512 457 flag_window_maximized = 1024 458 flag_window_unfocused = 2048 459 flag_window_topmost = 4096 460 flag_window_always_run = 256 461 flag_window_transparent = 16 462 flag_window_highdpi = 8192 463 flag_window_mouse_passthrough = 16384 464 flag_borderless_windowed_mode = 32768 465 flag_msaa_4x_hint = 32 466 flag_interlaced_hint = 65536 467 } 468 469 pub enum TraceLogLevel { 470 log_all = 0 471 log_trace 472 log_debug 473 log_info 474 log_warning 475 log_error 476 log_fatal 477 log_none 478 } 479 480 pub enum KeyboardKey { 481 key_null = 0 482 key_apostrophe = 39 483 key_comma = 44 484 key_minus = 45 485 key_period = 46 486 key_slash = 47 487 key_zero = 48 488 key_one = 49 489 key_two = 50 490 key_three = 51 491 key_four = 52 492 key_five = 53 493 key_six = 54 494 key_seven = 55 495 key_eight = 56 496 key_nine = 57 497 key_semicolon = 59 498 key_equal = 61 499 key_a = 65 500 key_b = 66 501 key_c = 67 502 key_d = 68 503 key_e = 69 504 key_f = 70 505 key_g = 71 506 key_h = 72 507 key_i = 73 508 key_j = 74 509 key_k = 75 510 key_l = 76 511 key_m = 77 512 key_n = 78 513 key_o = 79 514 key_p = 80 515 key_q = 81 516 key_r = 82 517 key_s = 83 518 key_t = 84 519 key_u = 85 520 key_v = 86 521 key_w = 87 522 key_x = 88 523 key_y = 89 524 key_z = 90 525 key_left_bracket = 91 526 key_backslash = 92 527 key_right_bracket = 93 528 key_grave = 96 529 key_space = 32 530 key_escape = 256 531 key_enter = 257 532 key_tab = 258 533 key_backspace = 259 534 key_insert = 260 535 key_delete = 261 536 key_right = 262 537 key_left = 263 538 key_down = 264 539 key_up = 265 540 key_page_up = 266 541 key_page_down = 267 542 key_home = 268 543 key_end = 269 544 key_caps_lock = 280 545 key_scroll_lock = 281 546 key_num_lock = 282 547 key_print_screen = 283 548 key_pause = 284 549 key_f1 = 290 550 key_f2 = 291 551 key_f3 = 292 552 key_f4 = 293 553 key_f5 = 294 554 key_f6 = 295 555 key_f7 = 296 556 key_f8 = 297 557 key_f9 = 298 558 key_f10 = 299 559 key_f11 = 300 560 key_f12 = 301 561 key_left_shift = 340 562 key_left_control = 341 563 key_left_alt = 342 564 key_left_super = 343 565 key_right_shift = 344 566 key_right_control = 345 567 key_right_alt = 346 568 key_right_super = 347 569 key_kb_menu = 348 570 key_kp_0 = 320 571 key_kp_1 = 321 572 key_kp_2 = 322 573 key_kp_3 = 323 574 key_kp_4 = 324 575 key_kp_5 = 325 576 key_kp_6 = 326 577 key_kp_7 = 327 578 key_kp_8 = 328 579 key_kp_9 = 329 580 key_kp_decimal = 330 581 key_kp_divide = 331 582 key_kp_multiply = 332 583 key_kp_subtract = 333 584 key_kp_add = 334 585 key_kp_enter = 335 586 key_kp_equal = 336 587 key_back = 4 588 key_menu = 5 589 key_volume_up = 24 590 key_volume_down = 25 591 } 592 593 pub enum MouseButton { 594 mouse_button_left = 0 595 mouse_button_right = 1 596 mouse_button_middle = 2 597 mouse_button_side = 3 598 mouse_button_extra = 4 599 mouse_button_forward = 5 600 mouse_button_back = 6 601 } 602 603 pub enum MouseCursor { 604 mouse_cursor_default = 0 605 mouse_cursor_arrow = 1 606 mouse_cursor_ibeam = 2 607 mouse_cursor_crosshair = 3 608 mouse_cursor_pointing_hand = 4 609 mouse_cursor_resize_ew = 5 610 mouse_cursor_resize_ns = 6 611 mouse_cursor_resize_nwse = 7 612 mouse_cursor_resize_nesw = 8 613 mouse_cursor_resize_all = 9 614 mouse_cursor_not_allowed = 10 615 } 616 617 pub enum GamepadButton { 618 gamepad_button_unknown = 0 619 gamepad_button_left_face_up 620 gamepad_button_left_face_right 621 gamepad_button_left_face_down 622 gamepad_button_left_face_left 623 gamepad_button_right_face_up 624 gamepad_button_right_face_right 625 gamepad_button_right_face_down 626 gamepad_button_right_face_left 627 gamepad_button_left_trigger_1 628 gamepad_button_left_trigger_2 629 gamepad_button_right_trigger_1 630 gamepad_button_right_trigger_2 631 gamepad_button_middle_left 632 gamepad_button_middle 633 gamepad_button_middle_right 634 gamepad_button_left_thumb 635 gamepad_button_right_thumb 636 } 637 638 pub enum GamepadAxis { 639 gamepad_axis_left_x = 0 640 gamepad_axis_left_y = 1 641 gamepad_axis_right_x = 2 642 gamepad_axis_right_y = 3 643 gamepad_axis_left_trigger = 4 644 gamepad_axis_right_trigger = 5 645 } 646 647 pub enum MaterialMapIndex { 648 material_map_albedo = 0 649 material_map_metalness 650 material_map_normal 651 material_map_roughness 652 material_map_occlusion 653 material_map_emission 654 material_map_height 655 material_map_cubemap 656 material_map_irradiance 657 material_map_prefilter 658 material_map_brdf 659 } 660 661 pub enum ShaderLocationIndex { 662 shader_loc_vertex_position = 0 663 shader_loc_vertex_texcoord01 664 shader_loc_vertex_texcoord02 665 shader_loc_vertex_normal 666 shader_loc_vertex_tangent 667 shader_loc_vertex_color 668 shader_loc_matrix_mvp 669 shader_loc_matrix_view 670 shader_loc_matrix_projection 671 shader_loc_matrix_model 672 shader_loc_matrix_normal 673 shader_loc_vector_view 674 shader_loc_color_diffuse 675 shader_loc_color_specular 676 shader_loc_color_ambient 677 shader_loc_map_albedo 678 shader_loc_map_metalness 679 shader_loc_map_normal 680 shader_loc_map_roughness 681 shader_loc_map_occlusion 682 shader_loc_map_emission 683 shader_loc_map_height 684 shader_loc_map_cubemap 685 shader_loc_map_irradiance 686 shader_loc_map_prefilter 687 shader_loc_map_brdf 688 } 689 690 pub enum ShaderUniformDataType { 691 shader_uniform_float = 0 692 shader_uniform_vec2 693 shader_uniform_vec3 694 shader_uniform_vec4 695 shader_uniform_int 696 shader_uniform_ivec2 697 shader_uniform_ivec3 698 shader_uniform_ivec4 699 shader_uniform_sampler2d 700 } 701 702 pub enum ShaderAttributeDataType { 703 shader_attrib_float = 0 704 shader_attrib_vec2 705 shader_attrib_vec3 706 shader_attrib_vec4 707 } 708 709 pub enum PixelFormat { 710 pixelformat_uncompressed_grayscale = 1 711 pixelformat_uncompressed_gray_alpha 712 pixelformat_uncompressed_r5g6b5 713 pixelformat_uncompressed_r8g8b8 714 pixelformat_uncompressed_r5g5b5a1 715 pixelformat_uncompressed_r4g4b4a4 716 pixelformat_uncompressed_r8g8b8a8 717 pixelformat_uncompressed_r32 718 pixelformat_uncompressed_r32g32b32 719 pixelformat_uncompressed_r32g32b32a32 720 pixelformat_uncompressed_r16 721 pixelformat_uncompressed_r16g16b16 722 pixelformat_uncompressed_r16g16b16a16 723 pixelformat_compressed_dxt1_rgb 724 pixelformat_compressed_dxt1_rgba 725 pixelformat_compressed_dxt3_rgba 726 pixelformat_compressed_dxt5_rgba 727 pixelformat_compressed_etc1_rgb 728 pixelformat_compressed_etc2_rgb 729 pixelformat_compressed_etc2_eac_rgba 730 pixelformat_compressed_pvrt_rgb 731 pixelformat_compressed_pvrt_rgba 732 pixelformat_compressed_astc_4x4_rgba 733 pixelformat_compressed_astc_8x8_rgba 734 } 735 736 pub enum TextureFilter { 737 texture_filter_point = 0 738 texture_filter_bilinear 739 texture_filter_trilinear 740 texture_filter_anisotropic_4x 741 texture_filter_anisotropic_8x 742 texture_filter_anisotropic_16x 743 } 744 745 pub enum TextureWrap { 746 texture_wrap_repeat = 0 747 texture_wrap_clamp 748 texture_wrap_mirror_repeat 749 texture_wrap_mirror_clamp 750 } 751 752 pub enum CubemapLayout { 753 cubemap_layout_auto_detect = 0 754 cubemap_layout_line_vertical 755 cubemap_layout_line_horizontal 756 cubemap_layout_cross_three_by_four 757 cubemap_layout_cross_four_by_three 758 cubemap_layout_panorama 759 } 760 761 pub enum FontType { 762 font_default = 0 763 font_bitmap 764 font_sdf 765 } 766 767 pub enum BlendMode { 768 blend_alpha = 0 769 blend_additive 770 blend_multiplied 771 blend_add_colors 772 blend_subtract_colors 773 blend_alpha_premultiply 774 blend_custom 775 blend_custom_separate 776 } 777 778 pub enum Gesture { 779 gesture_none = 0 780 gesture_tap = 1 781 gesture_doubletap = 2 782 gesture_hold = 4 783 gesture_drag = 8 784 gesture_swipe_right = 16 785 gesture_swipe_left = 32 786 gesture_swipe_up = 64 787 gesture_swipe_down = 128 788 gesture_pinch_in = 256 789 gesture_pinch_out = 512 790 } 791 792 pub enum CameraMode { 793 camera_custom = 0 794 camera_free 795 camera_orbital 796 camera_first_person 797 camera_third_person 798 } 799 800 pub enum CameraProjection { 801 camera_perspective = 0 802 camera_orthographic 803 } 804 805 pub enum NPatchLayout { 806 npatch_nine_patch = 0 807 npatch_three_patch_vertical 808 npatch_three_patch_horizontal 809 } 810 811 pub type AudioCallback = fn (voidptr, u32) 812 813 fn C.InitWindow(width int, height int, title &u8) 814 815 @[inline] 816 pub fn init_window(width int, height int, title string) { 817 C.InitWindow(width, height, title.str) 818 } 819 820 fn C.CloseWindow() 821 822 @[inline] 823 pub fn close_window() { 824 C.CloseWindow() 825 } 826 827 fn C.WindowShouldClose() bool 828 829 @[inline] 830 pub fn window_should_close() bool { 831 return C.WindowShouldClose() 832 } 833 834 fn C.IsWindowReady() bool 835 836 @[inline] 837 pub fn is_window_ready() bool { 838 return C.IsWindowReady() 839 } 840 841 fn C.IsWindowFullscreen() bool 842 843 @[inline] 844 pub fn is_window_fullscreen() bool { 845 return C.IsWindowFullscreen() 846 } 847 848 fn C.IsWindowHidden() bool 849 850 @[inline] 851 pub fn is_window_hidden() bool { 852 return C.IsWindowHidden() 853 } 854 855 fn C.IsWindowMinimized() bool 856 857 @[inline] 858 pub fn is_window_minimized() bool { 859 return C.IsWindowMinimized() 860 } 861 862 fn C.IsWindowMaximized() bool 863 864 @[inline] 865 pub fn is_window_maximized() bool { 866 return C.IsWindowMaximized() 867 } 868 869 fn C.IsWindowFocused() bool 870 871 @[inline] 872 pub fn is_window_focused() bool { 873 return C.IsWindowFocused() 874 } 875 876 fn C.IsWindowResized() bool 877 878 @[inline] 879 pub fn is_window_resized() bool { 880 return C.IsWindowResized() 881 } 882 883 fn C.IsWindowState(flag u32) bool 884 885 @[inline] 886 pub fn is_window_state(flag u32) bool { 887 return C.IsWindowState(flag) 888 } 889 890 fn C.SetWindowState(flags u32) 891 892 @[inline] 893 pub fn set_window_state(flags u32) { 894 C.SetWindowState(flags) 895 } 896 897 fn C.ClearWindowState(flags u32) 898 899 @[inline] 900 pub fn clear_window_state(flags u32) { 901 C.ClearWindowState(flags) 902 } 903 904 fn C.ToggleFullscreen() 905 906 @[inline] 907 pub fn toggle_fullscreen() { 908 C.ToggleFullscreen() 909 } 910 911 fn C.ToggleBorderlessWindowed() 912 913 @[inline] 914 pub fn toggle_borderless_windowed() { 915 C.ToggleBorderlessWindowed() 916 } 917 918 fn C.MaximizeWindow() 919 920 @[inline] 921 pub fn maximize_window() { 922 C.MaximizeWindow() 923 } 924 925 fn C.MinimizeWindow() 926 927 @[inline] 928 pub fn minimize_window() { 929 C.MinimizeWindow() 930 } 931 932 fn C.RestoreWindow() 933 934 @[inline] 935 pub fn restore_window() { 936 C.RestoreWindow() 937 } 938 939 fn C.SetWindowIcon(image Image) 940 941 @[inline] 942 pub fn set_window_icon(image Image) { 943 C.SetWindowIcon(image) 944 } 945 946 fn C.SetWindowIcons(images &Image, count int) 947 948 @[inline] 949 pub fn set_window_icons(images []Image) { 950 C.SetWindowIcons(images.data, images.len) 951 } 952 953 fn C.SetWindowTitle(title &u8) 954 955 @[inline] 956 pub fn set_window_title(title string) { 957 C.SetWindowTitle(title.str) 958 } 959 960 fn C.SetWindowPosition(x int, y int) 961 962 @[inline] 963 pub fn set_window_position(x int, y int) { 964 C.SetWindowPosition(x, y) 965 } 966 967 fn C.SetWindowMonitor(monitor int) 968 969 @[inline] 970 pub fn set_window_monitor(monitor int) { 971 C.SetWindowMonitor(monitor) 972 } 973 974 fn C.SetWindowMinSize(width int, height int) 975 976 @[inline] 977 pub fn set_window_min_size(width int, height int) { 978 C.SetWindowMinSize(width, height) 979 } 980 981 fn C.SetWindowMaxSize(width int, height int) 982 983 @[inline] 984 pub fn set_window_max_size(width int, height int) { 985 C.SetWindowMaxSize(width, height) 986 } 987 988 fn C.SetWindowSize(width int, height int) 989 990 @[inline] 991 pub fn set_window_size(width int, height int) { 992 C.SetWindowSize(width, height) 993 } 994 995 fn C.SetWindowOpacity(opacity f32) 996 997 @[inline] 998 pub fn set_window_opacity(opacity f32) { 999 C.SetWindowOpacity(opacity) 1000 } 1001 1002 fn C.SetWindowFocused() 1003 1004 @[inline] 1005 pub fn set_window_focused() { 1006 C.SetWindowFocused() 1007 } 1008 1009 fn C.GetWindowHandle() voidptr 1010 1011 @[inline] 1012 pub fn get_window_handle() voidptr { 1013 return C.GetWindowHandle() 1014 } 1015 1016 fn C.GetScreenWidth() int 1017 1018 @[inline] 1019 pub fn get_screen_width() int { 1020 return C.GetScreenWidth() 1021 } 1022 1023 fn C.GetScreenHeight() int 1024 1025 @[inline] 1026 pub fn get_screen_height() int { 1027 return C.GetScreenHeight() 1028 } 1029 1030 fn C.GetRenderWidth() int 1031 1032 @[inline] 1033 pub fn get_render_width() int { 1034 return C.GetRenderWidth() 1035 } 1036 1037 fn C.GetRenderHeight() int 1038 1039 @[inline] 1040 pub fn get_render_height() int { 1041 return C.GetRenderHeight() 1042 } 1043 1044 fn C.GetMonitorCount() int 1045 1046 @[inline] 1047 pub fn get_monitor_count() int { 1048 return C.GetMonitorCount() 1049 } 1050 1051 fn C.GetCurrentMonitor() int 1052 1053 @[inline] 1054 pub fn get_current_monitor() int { 1055 return C.GetCurrentMonitor() 1056 } 1057 1058 fn C.GetMonitorPosition(monitor int) Vector2 1059 1060 @[inline] 1061 pub fn get_monitor_position(monitor int) Vector2 { 1062 return C.GetMonitorPosition(monitor) 1063 } 1064 1065 fn C.GetMonitorWidth(monitor int) int 1066 1067 @[inline] 1068 pub fn get_monitor_width(monitor int) int { 1069 return C.GetMonitorWidth(monitor) 1070 } 1071 1072 fn C.GetMonitorHeight(monitor int) int 1073 1074 @[inline] 1075 pub fn get_monitor_height(monitor int) int { 1076 return C.GetMonitorHeight(monitor) 1077 } 1078 1079 fn C.GetMonitorPhysicalWidth(monitor int) int 1080 1081 @[inline] 1082 pub fn get_monitor_physical_width(monitor int) int { 1083 return C.GetMonitorPhysicalWidth(monitor) 1084 } 1085 1086 fn C.GetMonitorPhysicalHeight(monitor int) int 1087 1088 @[inline] 1089 pub fn get_monitor_physical_height(monitor int) int { 1090 return C.GetMonitorPhysicalHeight(monitor) 1091 } 1092 1093 fn C.GetMonitorRefreshRate(monitor int) int 1094 1095 @[inline] 1096 pub fn get_monitor_refresh_rate(monitor int) int { 1097 return C.GetMonitorRefreshRate(monitor) 1098 } 1099 1100 fn C.GetWindowPosition() Vector2 1101 1102 @[inline] 1103 pub fn get_window_position() Vector2 { 1104 return C.GetWindowPosition() 1105 } 1106 1107 fn C.GetWindowScaleDPI() Vector2 1108 1109 @[inline] 1110 pub fn get_window_scale_dpi() Vector2 { 1111 return C.GetWindowScaleDPI() 1112 } 1113 1114 fn C.GetMonitorName(monitor int) &u8 1115 1116 @[inline] 1117 pub fn get_monitor_name(monitor int) string { 1118 cstr := C.GetMonitorName(monitor) 1119 return unsafe { tos_clone(cstr) } 1120 } 1121 1122 fn C.SetClipboardText(text &u8) 1123 1124 @[inline] 1125 pub fn set_clipboard_text(text string) { 1126 C.SetClipboardText(text.str) 1127 } 1128 1129 fn C.GetClipboardText() &u8 1130 1131 @[inline] 1132 pub fn get_clipboard_text() string { 1133 cstr := C.GetClipboardText() 1134 return unsafe { tos_clone(cstr) } 1135 } 1136 1137 fn C.EnableEventWaiting() 1138 1139 @[inline] 1140 pub fn enable_event_waiting() { 1141 C.EnableEventWaiting() 1142 } 1143 1144 fn C.DisableEventWaiting() 1145 1146 @[inline] 1147 pub fn disable_event_waiting() { 1148 C.DisableEventWaiting() 1149 } 1150 1151 fn C.ShowCursor() 1152 1153 @[inline] 1154 pub fn show_cursor() { 1155 C.ShowCursor() 1156 } 1157 1158 fn C.HideCursor() 1159 1160 @[inline] 1161 pub fn hide_cursor() { 1162 C.HideCursor() 1163 } 1164 1165 fn C.IsCursorHidden() bool 1166 1167 @[inline] 1168 pub fn is_cursor_hidden() bool { 1169 return C.IsCursorHidden() 1170 } 1171 1172 fn C.EnableCursor() 1173 1174 @[inline] 1175 pub fn enable_cursor() { 1176 C.EnableCursor() 1177 } 1178 1179 fn C.DisableCursor() 1180 1181 @[inline] 1182 pub fn disable_cursor() { 1183 C.DisableCursor() 1184 } 1185 1186 fn C.IsCursorOnScreen() bool 1187 1188 @[inline] 1189 pub fn is_cursor_on_screen() bool { 1190 return C.IsCursorOnScreen() 1191 } 1192 1193 fn C.ClearBackground(color Color) 1194 1195 @[inline] 1196 pub fn clear_background(color Color) { 1197 C.ClearBackground(color) 1198 } 1199 1200 fn C.BeginDrawing() 1201 1202 @[inline] 1203 pub fn begin_drawing() { 1204 C.BeginDrawing() 1205 } 1206 1207 fn C.EndDrawing() 1208 1209 @[inline] 1210 pub fn end_drawing() { 1211 C.EndDrawing() 1212 } 1213 1214 fn C.BeginMode2D(camera Camera2D) 1215 1216 @[inline] 1217 pub fn begin_mode_2d(camera Camera2D) { 1218 C.BeginMode2D(camera) 1219 } 1220 1221 fn C.EndMode2D() 1222 1223 @[inline] 1224 pub fn end_mode_2d() { 1225 C.EndMode2D() 1226 } 1227 1228 fn C.BeginMode3D(camera Camera3D) 1229 1230 @[inline] 1231 pub fn begin_mode_3d(camera Camera3D) { 1232 C.BeginMode3D(camera) 1233 } 1234 1235 fn C.EndMode3D() 1236 1237 @[inline] 1238 pub fn end_mode_3d() { 1239 C.EndMode3D() 1240 } 1241 1242 fn C.BeginTextureMode(target RenderTexture2D) 1243 1244 @[inline] 1245 pub fn begin_texture_mode(target RenderTexture2D) { 1246 C.BeginTextureMode(target) 1247 } 1248 1249 fn C.EndTextureMode() 1250 1251 @[inline] 1252 pub fn end_texture_mode() { 1253 C.EndTextureMode() 1254 } 1255 1256 fn C.BeginShaderMode(shader Shader) 1257 1258 @[inline] 1259 pub fn begin_shader_mode(shader Shader) { 1260 C.BeginShaderMode(shader) 1261 } 1262 1263 fn C.EndShaderMode() 1264 1265 @[inline] 1266 pub fn end_shader_mode() { 1267 C.EndShaderMode() 1268 } 1269 1270 fn C.BeginBlendMode(mode int) 1271 1272 @[inline] 1273 pub fn begin_blend_mode(mode int) { 1274 C.BeginBlendMode(mode) 1275 } 1276 1277 fn C.EndBlendMode() 1278 1279 @[inline] 1280 pub fn end_blend_mode() { 1281 C.EndBlendMode() 1282 } 1283 1284 fn C.BeginScissorMode(x int, y int, width int, height int) 1285 1286 @[inline] 1287 pub fn begin_scissor_mode(x int, y int, width int, height int) { 1288 C.BeginScissorMode(x, y, width, height) 1289 } 1290 1291 fn C.EndScissorMode() 1292 1293 @[inline] 1294 pub fn end_scissor_mode() { 1295 C.EndScissorMode() 1296 } 1297 1298 fn C.BeginVrStereoMode(config VrStereoConfig) 1299 1300 @[inline] 1301 pub fn begin_vr_stereo_mode(config VrStereoConfig) { 1302 C.BeginVrStereoMode(config) 1303 } 1304 1305 fn C.EndVrStereoMode() 1306 1307 @[inline] 1308 pub fn end_vr_stereo_mode() { 1309 C.EndVrStereoMode() 1310 } 1311 1312 fn C.LoadVrStereoConfig(device VrDeviceInfo) VrStereoConfig 1313 1314 @[inline] 1315 pub fn load_vr_stereo_config(device VrDeviceInfo) VrStereoConfig { 1316 return C.LoadVrStereoConfig(device) 1317 } 1318 1319 fn C.UnloadVrStereoConfig(config VrStereoConfig) 1320 1321 @[inline] 1322 pub fn unload_vr_stereo_config(config VrStereoConfig) { 1323 C.UnloadVrStereoConfig(config) 1324 } 1325 1326 fn C.LoadShader(vsfilename &u8, fsfilename &u8) Shader 1327 1328 @[inline] 1329 pub fn load_shader(vsfilename string, fsfilename string) Shader { 1330 return C.LoadShader(vsfilename.str, fsfilename.str) 1331 } 1332 1333 fn C.LoadShaderFromMemory(vscode &u8, fscode &u8) Shader 1334 1335 @[inline] 1336 pub fn load_shader_from_memory(vscode string, fscode string) Shader { 1337 return C.LoadShaderFromMemory(vscode.str, fscode.str) 1338 } 1339 1340 fn C.IsShaderReady(shader Shader) bool 1341 1342 @[inline] 1343 pub fn is_shader_ready(shader Shader) bool { 1344 return C.IsShaderReady(shader) 1345 } 1346 1347 fn C.GetShaderLocation(shader Shader, uniformname &u8) int 1348 1349 @[inline] 1350 pub fn get_shader_location(shader Shader, uniformname string) int { 1351 return C.GetShaderLocation(shader, uniformname.str) 1352 } 1353 1354 fn C.GetShaderLocationAttrib(shader Shader, attribname &u8) int 1355 1356 @[inline] 1357 pub fn get_shader_location_attrib(shader Shader, attribname string) int { 1358 return C.GetShaderLocationAttrib(shader, attribname.str) 1359 } 1360 1361 @[keep_args_alive] 1362 fn C.SetShaderValue(shader Shader, locindex int, value voidptr, uniformtype int) 1363 1364 @[inline] 1365 pub fn set_shader_value(shader Shader, locindex int, value voidptr, uniformtype int) { 1366 C.SetShaderValue(shader, locindex, value, uniformtype) 1367 } 1368 1369 @[keep_args_alive] 1370 fn C.SetShaderValueV(shader Shader, locindex int, value voidptr, uniformtype int, count int) 1371 1372 @[inline] 1373 pub fn set_shader_value_v(shader Shader, locindex int, value voidptr, uniformtype int, count int) { 1374 C.SetShaderValueV(shader, locindex, value, uniformtype, count) 1375 } 1376 1377 fn C.SetShaderValueMatrix(shader Shader, locindex int, mat Matrix) 1378 1379 @[inline] 1380 pub fn set_shader_value_matrix(shader Shader, locindex int, mat Matrix) { 1381 C.SetShaderValueMatrix(shader, locindex, mat) 1382 } 1383 1384 fn C.SetShaderValueTexture(shader Shader, locindex int, texture Texture2D) 1385 1386 @[inline] 1387 pub fn set_shader_value_texture(shader Shader, locindex int, texture Texture2D) { 1388 C.SetShaderValueTexture(shader, locindex, texture) 1389 } 1390 1391 fn C.UnloadShader(shader Shader) 1392 1393 @[inline] 1394 pub fn unload_shader(shader Shader) { 1395 C.UnloadShader(shader) 1396 } 1397 1398 fn C.GetMouseRay(mouseposition Vector2, camera Camera) Ray 1399 1400 @[inline] 1401 pub fn get_mouse_ray(mouseposition Vector2, camera Camera) Ray { 1402 return C.GetMouseRay(mouseposition, camera) 1403 } 1404 1405 fn C.GetCameraMatrix(camera Camera) Matrix 1406 1407 @[inline] 1408 pub fn get_camera_matrix(camera Camera) Matrix { 1409 return C.GetCameraMatrix(camera) 1410 } 1411 1412 fn C.GetCameraMatrix2D(camera Camera2D) Matrix 1413 1414 @[inline] 1415 pub fn get_camera_matrix_2d(camera Camera2D) Matrix { 1416 return C.GetCameraMatrix2D(camera) 1417 } 1418 1419 fn C.GetWorldToScreen(position Vector3, camera Camera) Vector2 1420 1421 @[inline] 1422 pub fn get_world_to_screen(position Vector3, camera Camera) Vector2 { 1423 return C.GetWorldToScreen(position, camera) 1424 } 1425 1426 fn C.GetScreenToWorld2D(position Vector2, camera Camera2D) Vector2 1427 1428 @[inline] 1429 pub fn get_screen_to_world_2d(position Vector2, camera Camera2D) Vector2 { 1430 return C.GetScreenToWorld2D(position, camera) 1431 } 1432 1433 fn C.GetWorldToScreenEx(position Vector3, camera Camera, width int, height int) Vector2 1434 1435 @[inline] 1436 pub fn get_world_to_screen_ex(position Vector3, camera Camera, width int, height int) Vector2 { 1437 return C.GetWorldToScreenEx(position, camera, width, height) 1438 } 1439 1440 fn C.GetWorldToScreen2D(position Vector2, camera Camera2D) Vector2 1441 1442 @[inline] 1443 pub fn get_world_to_screen_2d(position Vector2, camera Camera2D) Vector2 { 1444 return C.GetWorldToScreen2D(position, camera) 1445 } 1446 1447 fn C.SetTargetFPS(fps int) 1448 1449 @[inline] 1450 pub fn set_target_fps(fps int) { 1451 C.SetTargetFPS(fps) 1452 } 1453 1454 fn C.GetFrameTime() f32 1455 1456 @[inline] 1457 pub fn get_frame_time() f32 { 1458 return C.GetFrameTime() 1459 } 1460 1461 fn C.GetTime() f64 1462 1463 @[inline] 1464 pub fn get_time() f64 { 1465 return C.GetTime() 1466 } 1467 1468 fn C.GetFPS() int 1469 1470 @[inline] 1471 pub fn get_fps() int { 1472 return C.GetFPS() 1473 } 1474 1475 /* Manual frame control; end_drawing() does this job, and can not be disabled 1476 because we need to modify config.h manually. 1477 1478 fn C.SwapScreenBuffer() 1479 1480 @[inline] 1481 pub fn swap_screen_buffer() { 1482 C.SwapScreenBuffer() 1483 } 1484 1485 fn C.PollInputEvents() 1486 1487 @[inline] 1488 pub fn poll_input_events() { 1489 C.PollInputEvents() 1490 } 1491 */ 1492 1493 fn C.WaitTime(seconds f64) 1494 1495 @[inline] 1496 pub fn wait_time(seconds f64) { 1497 C.WaitTime(seconds) 1498 } 1499 1500 fn C.SetRandomSeed(seed u32) 1501 1502 @[inline] 1503 pub fn set_random_seed(seed u32) { 1504 C.SetRandomSeed(seed) 1505 } 1506 1507 fn C.GetRandomValue(min int, max int) int 1508 1509 @[inline] 1510 pub fn get_random_value(min int, max int) int { 1511 return C.GetRandomValue(min, max) 1512 } 1513 1514 fn C.LoadRandomSequence(count u32, min int, max int) &int 1515 1516 fn C.UnloadRandomSequence(sequence &int) 1517 1518 pub fn random_sequence(mut out []int, min int, max int) { 1519 count := out.len 1520 1521 seq := C.LoadRandomSequence(count, min, max) 1522 1523 for i in 0..count { 1524 out[i] = seq[i] 1525 } 1526 1527 C.UnloadRandomSequence(seq) 1528 } 1529 1530 fn C.TakeScreenshot(filename &u8) 1531 1532 @[inline] 1533 pub fn take_screenshot(filename string) { 1534 C.TakeScreenshot(filename.str) 1535 } 1536 1537 fn C.SetConfigFlags(flags u32) 1538 1539 @[inline] 1540 pub fn set_config_flags(flags u32) { 1541 C.SetConfigFlags(flags) 1542 } 1543 1544 fn C.OpenURL(url &u8) 1545 1546 @[inline] 1547 pub fn open_url(url string) { 1548 C.OpenURL(url.str) 1549 } 1550 1551 fn C.TraceLog(loglevel int, args ...&u8) 1552 1553 @[inline] 1554 pub fn trace_log(loglevel int, text string) { 1555 // The TraceLog is printf-like function. but since V supports 1556 // string interpolation, we can just pass the string 1557 C.TraceLog(loglevel, text.str) 1558 } 1559 1560 fn C.SetTraceLogLevel(loglevel int) 1561 1562 @[inline] 1563 pub fn set_trace_log_level(loglevel int) { 1564 C.SetTraceLogLevel(loglevel) 1565 } 1566 1567 fn C.MemAlloc(size u32) voidptr 1568 1569 @[unsafe] 1570 @[inline] 1571 pub fn mem_alloc(size u32) voidptr { 1572 return C.MemAlloc(size) 1573 } 1574 1575 fn C.MemRealloc(ptr voidptr, size u32) voidptr 1576 1577 @[unsafe] 1578 @[inline] 1579 pub fn mem_realloc(ptr voidptr, size u32) voidptr { 1580 return C.MemRealloc(ptr, size) 1581 } 1582 1583 fn C.MemFree(ptr voidptr) 1584 1585 @[unsafe] 1586 @[inline] 1587 pub fn mem_free(ptr voidptr) { 1588 C.MemFree(ptr) 1589 } 1590 1591 // TODO: Drag-and-drop support 1592 fn C.IsFileDropped() bool 1593 1594 @[inline] 1595 pub fn is_file_dropped() bool { 1596 return C.IsFileDropped() 1597 } 1598 1599 fn C.LoadDroppedFiles() FilePathList 1600 1601 fn C.UnloadDroppedFiles(files FilePathList) 1602 1603 // TODO: Automation Event support 1604 fn C.LoadAutomationEventList(filename &i8) AutomationEventList 1605 1606 fn C.UnloadAutomationEventList(list AutomationEventList) 1607 1608 fn C.SetAutomationEventList(list &AutomationEventList) 1609 1610 fn C.SetAutomationEventBaseFrame(frame int) 1611 1612 fn C.StartAutomationEventRecording() 1613 1614 fn C.StopAutomationEventRecording() 1615 1616 fn C.PlayAutomationEvent(event AutomationEvent) 1617 1618 fn C.IsKeyPressed(key int) bool 1619 1620 @[inline] 1621 pub fn is_key_pressed(key int) bool { 1622 return C.IsKeyPressed(key) 1623 } 1624 1625 fn C.IsKeyPressedRepeat(key int) bool 1626 1627 @[inline] 1628 pub fn is_key_pressed_repeat(key int) bool { 1629 return C.IsKeyPressedRepeat(key) 1630 } 1631 1632 fn C.IsKeyDown(key int) bool 1633 1634 @[inline] 1635 pub fn is_key_down(key int) bool { 1636 return C.IsKeyDown(key) 1637 } 1638 1639 fn C.IsKeyReleased(key int) bool 1640 1641 @[inline] 1642 pub fn is_key_released(key int) bool { 1643 return C.IsKeyReleased(key) 1644 } 1645 1646 fn C.IsKeyUp(key int) bool 1647 1648 @[inline] 1649 pub fn is_key_up(key int) bool { 1650 return C.IsKeyUp(key) 1651 } 1652 1653 fn C.GetKeyPressed() int 1654 1655 @[inline] 1656 pub fn get_key_pressed() int { 1657 return C.GetKeyPressed() 1658 } 1659 1660 fn C.GetCharPressed() int 1661 1662 @[inline] 1663 pub fn get_char_pressed() int { 1664 return C.GetCharPressed() 1665 } 1666 1667 fn C.SetExitKey(key int) 1668 1669 @[inline] 1670 pub fn set_exit_key(key int) { 1671 C.SetExitKey(key) 1672 } 1673 1674 fn C.IsGamepadAvailable(gamepad int) bool 1675 1676 @[inline] 1677 pub fn is_gamepad_available(gamepad int) bool { 1678 return C.IsGamepadAvailable(gamepad) 1679 } 1680 1681 fn C.GetGamepadName(gamepad int) &u8 1682 1683 @[inline] 1684 pub fn get_gamepad_name(gamepad int) string { 1685 cstr := C.GetGamepadName(gamepad) 1686 return unsafe { tos_clone(cstr) } 1687 } 1688 1689 fn C.IsGamepadButtonPressed(gamepad int, button int) bool 1690 1691 @[inline] 1692 pub fn is_gamepad_button_pressed(gamepad int, button int) bool { 1693 return C.IsGamepadButtonPressed(gamepad, button) 1694 } 1695 1696 fn C.IsGamepadButtonDown(gamepad int, button int) bool 1697 1698 @[inline] 1699 pub fn is_gamepad_button_down(gamepad int, button int) bool { 1700 return C.IsGamepadButtonDown(gamepad, button) 1701 } 1702 1703 fn C.IsGamepadButtonReleased(gamepad int, button int) bool 1704 1705 @[inline] 1706 pub fn is_gamepad_button_released(gamepad int, button int) bool { 1707 return C.IsGamepadButtonReleased(gamepad, button) 1708 } 1709 1710 fn C.IsGamepadButtonUp(gamepad int, button int) bool 1711 1712 @[inline] 1713 pub fn is_gamepad_button_up(gamepad int, button int) bool { 1714 return C.IsGamepadButtonUp(gamepad, button) 1715 } 1716 1717 fn C.GetGamepadButtonPressed() int 1718 1719 @[inline] 1720 pub fn get_gamepad_button_pressed() int { 1721 return C.GetGamepadButtonPressed() 1722 } 1723 1724 fn C.GetGamepadAxisCount(gamepad int) int 1725 1726 @[inline] 1727 pub fn get_gamepad_axis_count(gamepad int) int { 1728 return C.GetGamepadAxisCount(gamepad) 1729 } 1730 1731 fn C.GetGamepadAxisMovement(gamepad int, axis int) f32 1732 1733 @[inline] 1734 pub fn get_gamepad_axis_movement(gamepad int, axis int) f32 { 1735 return C.GetGamepadAxisMovement(gamepad, axis) 1736 } 1737 1738 // internal function 1739 //fn C.SetGamepadMappings(mappings string) int 1740 1741 fn C.GetMouseX() int 1742 1743 @[inline] 1744 pub fn get_mouse_x() int { 1745 return C.GetMouseX() 1746 } 1747 1748 fn C.GetMouseY() int 1749 1750 @[inline] 1751 pub fn get_mouse_y() int { 1752 return C.GetMouseY() 1753 } 1754 1755 fn C.GetMousePosition() Vector2 1756 1757 @[inline] 1758 pub fn get_mouse_position() Vector2 { 1759 return C.GetMousePosition() 1760 } 1761 1762 fn C.GetMouseDelta() Vector2 1763 1764 @[inline] 1765 pub fn get_mouse_delta() Vector2 { 1766 return C.GetMouseDelta() 1767 } 1768 1769 fn C.SetMousePosition(x int, y int) 1770 1771 @[inline] 1772 pub fn set_mouse_position(x int, y int) { 1773 C.SetMousePosition(x, y) 1774 } 1775 1776 fn C.SetMouseOffset(offsetx int, offsety int) 1777 1778 @[inline] 1779 pub fn set_mouse_offset(offsetx int, offsety int) { 1780 C.SetMouseOffset(offsetx, offsety) 1781 } 1782 1783 fn C.SetMouseScale(scalex f32, scaley f32) 1784 1785 @[inline] 1786 pub fn set_mouse_scale(scalex f32, scaley f32) { 1787 C.SetMouseScale(scalex, scaley) 1788 } 1789 1790 fn C.GetMouseWheelMove() f32 1791 1792 @[inline] 1793 pub fn get_mouse_wheel_move() f32 { 1794 return C.GetMouseWheelMove() 1795 } 1796 1797 fn C.GetMouseWheelMoveV() Vector2 1798 1799 @[inline] 1800 pub fn get_mouse_wheel_move_v() Vector2 { 1801 return C.GetMouseWheelMoveV() 1802 } 1803 1804 fn C.SetMouseCursor(cursor int) 1805 1806 @[inline] 1807 pub fn set_mouse_cursor(cursor int) { 1808 C.SetMouseCursor(cursor) 1809 } 1810 1811 fn C.GetTouchX() int 1812 1813 @[inline] 1814 pub fn get_touch_x() int { 1815 return C.GetTouchX() 1816 } 1817 1818 fn C.GetTouchY() int 1819 1820 @[inline] 1821 pub fn get_touch_y() int { 1822 return C.GetTouchY() 1823 } 1824 1825 fn C.GetTouchPosition(index int) Vector2 1826 1827 @[inline] 1828 pub fn get_touch_position(index int) Vector2 { 1829 return C.GetTouchPosition(index) 1830 } 1831 1832 fn C.GetTouchPointId(index int) int 1833 1834 @[inline] 1835 pub fn get_touch_point_id(index int) int { 1836 return C.GetTouchPointId(index) 1837 } 1838 1839 fn C.GetTouchPointCount() int 1840 1841 @[inline] 1842 pub fn get_touch_point_count() int { 1843 return C.GetTouchPointCount() 1844 } 1845 1846 fn C.SetGesturesEnabled(flags u32) 1847 1848 @[inline] 1849 pub fn set_gestures_enabled(flags u32) { 1850 C.SetGesturesEnabled(flags) 1851 } 1852 1853 fn C.IsGestureDetected(gesture int) bool 1854 1855 @[inline] 1856 pub fn is_gesture_detected(gesture int) bool { 1857 return C.IsGestureDetected(gesture) 1858 } 1859 1860 fn C.GetGestureDetected() int 1861 1862 @[inline] 1863 pub fn get_gesture_detected() int { 1864 return C.GetGestureDetected() 1865 } 1866 1867 fn C.GetGestureHoldDuration() f32 1868 1869 @[inline] 1870 pub fn get_gesture_hold_duration() f32 { 1871 return C.GetGestureHoldDuration() 1872 } 1873 1874 fn C.GetGestureDragVector() Vector2 1875 1876 @[inline] 1877 pub fn get_gesture_drag_vector() Vector2 { 1878 return C.GetGestureDragVector() 1879 } 1880 1881 fn C.GetGestureDragAngle() f32 1882 1883 @[inline] 1884 pub fn get_gesture_drag_angle() f32 { 1885 return C.GetGestureDragAngle() 1886 } 1887 1888 fn C.GetGesturePinchVector() Vector2 1889 1890 @[inline] 1891 pub fn get_gesture_pinch_vector() Vector2 { 1892 return C.GetGesturePinchVector() 1893 } 1894 1895 fn C.GetGesturePinchAngle() f32 1896 1897 @[inline] 1898 pub fn get_gesture_pinch_angle() f32 { 1899 return C.GetGesturePinchAngle() 1900 } 1901 1902 fn C.UpdateCamera(camera &Camera, mode int) 1903 1904 @[inline] 1905 pub fn update_camera(camera &Camera, mode int) { 1906 C.UpdateCamera(camera, mode) 1907 } 1908 1909 fn C.UpdateCameraPro(camera &Camera, movement Vector3, rotation Vector3, zoom f32) 1910 1911 @[inline] 1912 pub fn update_camera_pro(camera &Camera, movement Vector3, rotation Vector3, zoom f32) { 1913 C.UpdateCameraPro(camera, movement, rotation, zoom) 1914 } 1915 1916 fn C.SetShapesTexture(texture Texture2D, source Rectangle) 1917 1918 @[inline] 1919 pub fn set_shapes_texture(texture Texture2D, source Rectangle) { 1920 C.SetShapesTexture(texture, source) 1921 } 1922 1923 fn C.DrawPixel(posx int, posy int, color Color) 1924 1925 @[inline] 1926 pub fn draw_pixel(posx int, posy int, color Color) { 1927 C.DrawPixel(posx, posy, color) 1928 } 1929 1930 fn C.DrawPixelV(position Vector2, color Color) 1931 1932 @[inline] 1933 pub fn draw_pixel_v(position Vector2, color Color) { 1934 C.DrawPixelV(position, color) 1935 } 1936 1937 fn C.DrawLine(startposx int, startposy int, endposx int, endposy int, color Color) 1938 1939 @[inline] 1940 pub fn draw_line(startposx int, startposy int, endposx int, endposy int, color Color) { 1941 C.DrawLine(startposx, startposy, endposx, endposy, color) 1942 } 1943 1944 fn C.DrawLineV(startpos Vector2, endpos Vector2, color Color) 1945 1946 @[inline] 1947 pub fn draw_line_v(startpos Vector2, endpos Vector2, color Color) { 1948 C.DrawLineV(startpos, endpos, color) 1949 } 1950 1951 fn C.DrawLineEx(startpos Vector2, endpos Vector2, thick f32, color Color) 1952 1953 @[inline] 1954 pub fn draw_line_ex(startpos Vector2, endpos Vector2, thick f32, color Color) { 1955 C.DrawLineEx(startpos, endpos, thick, color) 1956 } 1957 1958 fn C.DrawLineStrip(points &Vector2, pointcount int, color Color) 1959 1960 @[inline] 1961 pub fn draw_line_strip(points []Vector2, color Color) { 1962 C.DrawLineStrip(points.data, points.len, color) 1963 } 1964 1965 fn C.DrawLineBezier(startpos Vector2, endpos Vector2, thick f32, color Color) 1966 1967 @[inline] 1968 pub fn draw_line_bezier(startpos Vector2, endpos Vector2, thick f32, color Color) { 1969 C.DrawLineBezier(startpos, endpos, thick, color) 1970 } 1971 1972 fn C.DrawCircle(centerx int, centery int, radius f32, color Color) 1973 1974 @[inline] 1975 pub fn draw_circle(centerx int, centery int, radius f32, color Color) { 1976 C.DrawCircle(centerx, centery, radius, color) 1977 } 1978 1979 fn C.DrawCircleSector(center Vector2, radius f32, startangle f32, endangle f32, segments int, color Color) 1980 1981 @[inline] 1982 pub fn draw_circle_sector(center Vector2, radius f32, startangle f32, endangle f32, segments int, color Color) { 1983 C.DrawCircleSector(center, radius, startangle, endangle, segments, color) 1984 } 1985 1986 fn C.DrawCircleSectorLines(center Vector2, radius f32, startangle f32, endangle f32, segments int, color Color) 1987 1988 @[inline] 1989 pub fn draw_circle_sector_lines(center Vector2, radius f32, startangle f32, endangle f32, segments int, color Color) { 1990 C.DrawCircleSectorLines(center, radius, startangle, endangle, segments, color) 1991 } 1992 1993 fn C.DrawCircleGradient(centerx int, centery int, radius f32, color1 Color, color2 Color) 1994 1995 @[inline] 1996 pub fn draw_circle_gradient(centerx int, centery int, radius f32, color1 Color, color2 Color) { 1997 C.DrawCircleGradient(centerx, centery, radius, color1, color2) 1998 } 1999 2000 fn C.DrawCircleV(center Vector2, radius f32, color Color) 2001 2002 @[inline] 2003 pub fn draw_circle_v(center Vector2, radius f32, color Color) { 2004 C.DrawCircleV(center, radius, color) 2005 } 2006 2007 fn C.DrawCircleLines(centerx int, centery int, radius f32, color Color) 2008 2009 @[inline] 2010 pub fn draw_circle_lines(centerx int, centery int, radius f32, color Color) { 2011 C.DrawCircleLines(centerx, centery, radius, color) 2012 } 2013 2014 fn C.DrawCircleLinesV(center Vector2, radius f32, color Color) 2015 2016 @[inline] 2017 pub fn draw_circle_lines_v(center Vector2, radius f32, color Color) { 2018 C.DrawCircleLinesV(center, radius, color) 2019 } 2020 2021 fn C.DrawEllipse(centerx int, centery int, radiush f32, radiusv f32, color Color) 2022 2023 @[inline] 2024 pub fn draw_ellipse(centerx int, centery int, radiush f32, radiusv f32, color Color) { 2025 C.DrawEllipse(centerx, centery, radiush, radiusv, color) 2026 } 2027 2028 fn C.DrawEllipseLines(centerx int, centery int, radiush f32, radiusv f32, color Color) 2029 2030 @[inline] 2031 pub fn draw_ellipse_lines(centerx int, centery int, radiush f32, radiusv f32, color Color) { 2032 C.DrawEllipseLines(centerx, centery, radiush, radiusv, color) 2033 } 2034 2035 fn C.DrawRing(center Vector2, innerradius f32, outerradius f32, startangle f32, endangle f32, segments int, color Color) 2036 2037 @[inline] 2038 pub fn draw_ring(center Vector2, innerradius f32, outerradius f32, startangle f32, endangle f32, segments int, color Color) { 2039 C.DrawRing(center, innerradius, outerradius, startangle, endangle, segments, color) 2040 } 2041 2042 fn C.DrawRingLines(center Vector2, innerradius f32, outerradius f32, startangle f32, endangle f32, segments int, color Color) 2043 2044 @[inline] 2045 pub fn draw_ring_lines(center Vector2, innerradius f32, outerradius f32, startangle f32, endangle f32, segments int, color Color) { 2046 C.DrawRingLines(center, innerradius, outerradius, startangle, endangle, segments, color) 2047 } 2048 2049 fn C.DrawRectangle(posx int, posy int, width int, height int, color Color) 2050 2051 @[inline] 2052 pub fn draw_rectangle(posx int, posy int, width int, height int, color Color) { 2053 C.DrawRectangle(posx, posy, width, height, color) 2054 } 2055 2056 fn C.DrawRectangleV(position Vector2, size Vector2, color Color) 2057 2058 @[inline] 2059 pub fn draw_rectangle_v(position Vector2, size Vector2, color Color) { 2060 C.DrawRectangleV(position, size, color) 2061 } 2062 2063 fn C.DrawRectangleRec(rec Rectangle, color Color) 2064 2065 @[inline] 2066 pub fn draw_rectangle_rec(rec Rectangle, color Color) { 2067 C.DrawRectangleRec(rec, color) 2068 } 2069 2070 fn C.DrawRectanglePro(rec Rectangle, origin Vector2, rotation f32, color Color) 2071 2072 @[inline] 2073 pub fn draw_rectangle_pro(rec Rectangle, origin Vector2, rotation f32, color Color) { 2074 C.DrawRectanglePro(rec, origin, rotation, color) 2075 } 2076 2077 fn C.DrawRectangleGradientV(posx int, posy int, width int, height int, color1 Color, color2 Color) 2078 2079 @[inline] 2080 pub fn draw_rectangle_gradient_v(posx int, posy int, width int, height int, color1 Color, color2 Color) { 2081 C.DrawRectangleGradientV(posx, posy, width, height, color1, color2) 2082 } 2083 2084 fn C.DrawRectangleGradientH(posx int, posy int, width int, height int, color1 Color, color2 Color) 2085 2086 @[inline] 2087 pub fn draw_rectangle_gradient_h(posx int, posy int, width int, height int, color1 Color, color2 Color) { 2088 C.DrawRectangleGradientH(posx, posy, width, height, color1, color2) 2089 } 2090 2091 fn C.DrawRectangleGradientEx(rec Rectangle, col1 Color, col2 Color, col3 Color, col4 Color) 2092 2093 @[inline] 2094 pub fn draw_rectangle_gradient_ex(rec Rectangle, col1 Color, col2 Color, col3 Color, col4 Color) { 2095 C.DrawRectangleGradientEx(rec, col1, col2, col3, col4) 2096 } 2097 2098 fn C.DrawRectangleLines(posx int, posy int, width int, height int, color Color) 2099 2100 @[inline] 2101 pub fn draw_rectangle_lines(posx int, posy int, width int, height int, color Color) { 2102 C.DrawRectangleLines(posx, posy, width, height, color) 2103 } 2104 2105 fn C.DrawRectangleLinesEx(rec Rectangle, linethick f32, color Color) 2106 2107 @[inline] 2108 pub fn draw_rectangle_lines_ex(rec Rectangle, linethick f32, color Color) { 2109 C.DrawRectangleLinesEx(rec, linethick, color) 2110 } 2111 2112 fn C.DrawRectangleRounded(rec Rectangle, roundness f32, segments int, color Color) 2113 2114 @[inline] 2115 pub fn draw_rectangle_rounded(rec Rectangle, roundness f32, segments int, color Color) { 2116 C.DrawRectangleRounded(rec, roundness, segments, color) 2117 } 2118 2119 fn C.DrawRectangleRoundedLines(rec Rectangle, roundness f32, segments int, linethick f32, color Color) 2120 2121 @[inline] 2122 pub fn draw_rectangle_rounded_lines(rec Rectangle, roundness f32, segments int, linethick f32, color Color) { 2123 C.DrawRectangleRoundedLines(rec, roundness, segments, linethick, color) 2124 } 2125 2126 fn C.DrawTriangle(v1 Vector2, v2 Vector2, v3 Vector2, color Color) 2127 2128 @[inline] 2129 pub fn draw_triangle(v1 Vector2, v2 Vector2, v3 Vector2, color Color) { 2130 C.DrawTriangle(v1, v2, v3, color) 2131 } 2132 2133 fn C.DrawTriangleLines(v1 Vector2, v2 Vector2, v3 Vector2, color Color) 2134 2135 @[inline] 2136 pub fn draw_triangle_lines(v1 Vector2, v2 Vector2, v3 Vector2, color Color) { 2137 C.DrawTriangleLines(v1, v2, v3, color) 2138 } 2139 2140 fn C.DrawTriangleFan(points &Vector2, pointcount int, color Color) 2141 2142 @[inline] 2143 pub fn draw_triangle_fan(points []Vector2, color Color) { 2144 C.DrawTriangleFan(points.data, points.len, color) 2145 } 2146 2147 fn C.DrawTriangleStrip(points &Vector2, pointcount int, color Color) 2148 2149 @[inline] 2150 pub fn draw_triangle_strip(points []Vector2, color Color) { 2151 C.DrawTriangleStrip(points.data, points.len, color) 2152 } 2153 2154 fn C.DrawPoly(center Vector2, sides int, radius f32, rotation f32, color Color) 2155 2156 @[inline] 2157 pub fn draw_poly(center Vector2, sides int, radius f32, rotation f32, color Color) { 2158 C.DrawPoly(center, sides, radius, rotation, color) 2159 } 2160 2161 fn C.DrawPolyLines(center Vector2, sides int, radius f32, rotation f32, color Color) 2162 2163 @[inline] 2164 pub fn draw_poly_lines(center Vector2, sides int, radius f32, rotation f32, color Color) { 2165 C.DrawPolyLines(center, sides, radius, rotation, color) 2166 } 2167 2168 fn C.DrawPolyLinesEx(center Vector2, sides int, radius f32, rotation f32, linethick f32, color Color) 2169 2170 @[inline] 2171 pub fn draw_poly_lines_ex(center Vector2, sides int, radius f32, rotation f32, linethick f32, color Color) { 2172 C.DrawPolyLinesEx(center, sides, radius, rotation, linethick, color) 2173 } 2174 2175 fn C.DrawSplineLinear(points &Vector2, pointcount int, thick f32, color Color) 2176 2177 @[inline] 2178 pub fn draw_spline_linear(points []Vector2, thick f32, color Color) { 2179 C.DrawSplineLinear(points.data, points.len, thick, color) 2180 } 2181 2182 fn C.DrawSplineBasis(points &Vector2, pointcount int, thick f32, color Color) 2183 2184 @[inline] 2185 pub fn draw_spline_basis(points []Vector2, thick f32, color Color) { 2186 C.DrawSplineBasis(points.data, points.len, thick, color) 2187 } 2188 2189 fn C.DrawSplineCatmullRom(points &Vector2, pointcount int, thick f32, color Color) 2190 2191 @[inline] 2192 pub fn draw_spline_catmull_rom(points []Vector2, thick f32, color Color) { 2193 C.DrawSplineCatmullRom(points.data, points.len, thick, color) 2194 } 2195 2196 fn C.DrawSplineBezierQuadratic(points &Vector2, pointcount int, thick f32, color Color) 2197 2198 @[inline] 2199 pub fn draw_spline_bezier_quadratic(points []Vector2, thick f32, color Color) { 2200 C.DrawSplineBezierQuadratic(points.data, points.len, thick, color) 2201 } 2202 2203 fn C.DrawSplineBezierCubic(points &Vector2, pointcount int, thick f32, color Color) 2204 2205 @[inline] 2206 pub fn draw_spline_bezier_cubic(points []Vector2, thick f32, color Color) { 2207 C.DrawSplineBezierCubic(points.data, points.len, thick, color) 2208 } 2209 2210 fn C.DrawSplineSegmentLinear(p1 Vector2, p2 Vector2, thick f32, color Color) 2211 2212 @[inline] 2213 pub fn draw_spline_segment_linear(p1 Vector2, p2 Vector2, thick f32, color Color) { 2214 C.DrawSplineSegmentLinear(p1, p2, thick, color) 2215 } 2216 2217 fn C.DrawSplineSegmentBasis(p1 Vector2, p2 Vector2, p3 Vector2, p4 Vector2, thick f32, color Color) 2218 2219 @[inline] 2220 pub fn draw_spline_segment_basis(p1 Vector2, p2 Vector2, p3 Vector2, p4 Vector2, thick f32, color Color) { 2221 C.DrawSplineSegmentBasis(p1, p2, p3, p4, thick, color) 2222 } 2223 2224 fn C.DrawSplineSegmentCatmullRom(p1 Vector2, p2 Vector2, p3 Vector2, p4 Vector2, thick f32, color Color) 2225 2226 @[inline] 2227 pub fn draw_spline_segment_catmull_rom(p1 Vector2, p2 Vector2, p3 Vector2, p4 Vector2, thick f32, color Color) { 2228 C.DrawSplineSegmentCatmullRom(p1, p2, p3, p4, thick, color) 2229 } 2230 2231 fn C.DrawSplineSegmentBezierQuadratic(p1 Vector2, c2 Vector2, p3 Vector2, thick f32, color Color) 2232 2233 @[inline] 2234 pub fn draw_spline_segment_bezier_quadratic(p1 Vector2, c2 Vector2, p3 Vector2, thick f32, color Color) { 2235 C.DrawSplineSegmentBezierQuadratic(p1, c2, p3, thick, color) 2236 } 2237 2238 fn C.DrawSplineSegmentBezierCubic(p1 Vector2, c2 Vector2, c3 Vector2, p4 Vector2, thick f32, color Color) 2239 2240 @[inline] 2241 pub fn draw_spline_segment_bezier_cubic(p1 Vector2, c2 Vector2, c3 Vector2, p4 Vector2, thick f32, color Color) { 2242 C.DrawSplineSegmentBezierCubic(p1, c2, c3, p4, thick, color) 2243 } 2244 2245 fn C.GetSplinePointLinear(startpos Vector2, endpos Vector2, t f32) Vector2 2246 2247 @[inline] 2248 pub fn get_spline_point_linear(startpos Vector2, endpos Vector2, t f32) Vector2 { 2249 return C.GetSplinePointLinear(startpos, endpos, t) 2250 } 2251 2252 fn C.GetSplinePointBasis(p1 Vector2, p2 Vector2, p3 Vector2, p4 Vector2, t f32) Vector2 2253 2254 @[inline] 2255 pub fn get_spline_point_basis(p1 Vector2, p2 Vector2, p3 Vector2, p4 Vector2, t f32) Vector2 { 2256 return C.GetSplinePointBasis(p1, p2, p3, p4, t) 2257 } 2258 2259 fn C.GetSplinePointCatmullRom(p1 Vector2, p2 Vector2, p3 Vector2, p4 Vector2, t f32) Vector2 2260 2261 @[inline] 2262 pub fn get_spline_point_catmull_rom(p1 Vector2, p2 Vector2, p3 Vector2, p4 Vector2, t f32) Vector2 { 2263 return C.GetSplinePointCatmullRom(p1, p2, p3, p4, t) 2264 } 2265 2266 fn C.GetSplinePointBezierQuad(p1 Vector2, c2 Vector2, p3 Vector2, t f32) Vector2 2267 2268 @[inline] 2269 pub fn get_spline_point_bezier_quad(p1 Vector2, c2 Vector2, p3 Vector2, t f32) Vector2 { 2270 return C.GetSplinePointBezierQuad(p1, c2, p3, t) 2271 } 2272 2273 fn C.GetSplinePointBezierCubic(p1 Vector2, c2 Vector2, c3 Vector2, p4 Vector2, t f32) Vector2 2274 2275 @[inline] 2276 pub fn get_spline_point_bezier_cubic(p1 Vector2, c2 Vector2, c3 Vector2, p4 Vector2, t f32) Vector2 { 2277 return C.GetSplinePointBezierCubic(p1, c2, c3, p4, t) 2278 } 2279 2280 fn C.GetCollisionRec(rec1 Rectangle, rec2 Rectangle) Rectangle 2281 2282 @[inline] 2283 pub fn get_collision_rec(rec1 Rectangle, rec2 Rectangle) Rectangle { 2284 return C.GetCollisionRec(rec1, rec2) 2285 } 2286 2287 fn C.LoadImage(filename &u8) Image 2288 2289 @[inline] 2290 pub fn load_image(filename string) Image { 2291 return C.LoadImage(filename.str) 2292 } 2293 2294 fn C.LoadImageRaw(filename &i8, width int, height int, format int, headersize int) Image 2295 2296 @[inline] 2297 pub fn load_image_raw(filename string, width int, height int, format int, headersize int) Image { 2298 return C.LoadImageRaw(filename.str, width, height, format, headersize) 2299 } 2300 2301 fn C.LoadImageSvg(filenameorstring &i8, width int, height int) Image 2302 2303 @[inline] 2304 pub fn load_image_svg(filenameorstring string, width int, height int) Image { 2305 return C.LoadImageSvg(filenameorstring.str, width, height) 2306 } 2307 2308 fn C.LoadImageAnim(filename &i8, frames &int) Image 2309 2310 @[inline] 2311 pub fn load_image_anim(filename string, frames &int) Image { 2312 return C.LoadImageAnim(filename.str, frames) 2313 } 2314 2315 fn C.LoadImageFromMemory(filetype &i8, filedata &u8, datasize int) Image 2316 2317 @[inline] 2318 pub fn load_image_from_memory(filetype string, filedata &u8, datasize int) Image { 2319 return C.LoadImageFromMemory(filetype.str, filedata, datasize) 2320 } 2321 2322 fn C.LoadImageFromTexture(texture Texture2D) Image 2323 2324 @[inline] 2325 pub fn load_image_from_texture(texture Texture2D) Image { 2326 return C.LoadImageFromTexture(texture) 2327 } 2328 2329 fn C.LoadImageFromScreen() Image 2330 2331 @[inline] 2332 pub fn load_image_from_screen() Image { 2333 return C.LoadImageFromScreen() 2334 } 2335 2336 fn C.UnloadImage(image Image) 2337 2338 @[inline] 2339 pub fn unload_image(image Image) { 2340 C.UnloadImage(image) 2341 } 2342 2343 fn C.ExportImage(image Image, filename &u8) bool 2344 2345 @[inline] 2346 pub fn export_image(image Image, filename string) bool { 2347 return C.ExportImage(image, filename.str) 2348 } 2349 2350 2351 // TODO: Return []u8 instead of &u8 2352 fn C.ExportImageToMemory(image Image, filetype &u8, filesize &int) &u8 2353 2354 @[inline] 2355 pub fn export_image_to_memory(image Image, filetype string) (&u8, int) { 2356 size := 0 2357 data := C.ExportImageToMemory(image, filetype.str, &size) 2358 2359 return data, size 2360 } 2361 2362 fn C.GenImageColor(width int, height int, color Color) Image 2363 2364 @[inline] 2365 pub fn gen_image_color(width int, height int, color Color) Image { 2366 return C.GenImageColor(width, height, color) 2367 } 2368 2369 fn C.GenImageGradientLinear(width int, height int, direction int, start Color, end Color) Image 2370 2371 @[inline] 2372 pub fn gen_image_gradient_linear(width int, height int, direction int, start Color, end Color) Image { 2373 return C.GenImageGradientLinear(width, height, direction, start, end) 2374 } 2375 2376 fn C.GenImageGradientRadial(width int, height int, density f32, inner Color, outer Color) Image 2377 2378 @[inline] 2379 pub fn gen_image_gradient_radial(width int, height int, density f32, inner Color, outer Color) Image { 2380 return C.GenImageGradientRadial(width, height, density, inner, outer) 2381 } 2382 2383 fn C.GenImageGradientSquare(width int, height int, density f32, inner Color, outer Color) Image 2384 2385 @[inline] 2386 pub fn gen_image_gradient_square(width int, height int, density f32, inner Color, outer Color) Image { 2387 return C.GenImageGradientSquare(width, height, density, inner, outer) 2388 } 2389 2390 fn C.GenImageChecked(width int, height int, checksx int, checksy int, col1 Color, col2 Color) Image 2391 2392 @[inline] 2393 pub fn gen_image_checked(width int, height int, checksx int, checksy int, col1 Color, col2 Color) Image { 2394 return C.GenImageChecked(width, height, checksx, checksy, col1, col2) 2395 } 2396 2397 fn C.GenImageWhiteNoise(width int, height int, factor f32) Image 2398 2399 @[inline] 2400 pub fn gen_image_white_noise(width int, height int, factor f32) Image { 2401 return C.GenImageWhiteNoise(width, height, factor) 2402 } 2403 2404 fn C.GenImagePerlinNoise(width int, height int, offsetx int, offsety int, scale f32) Image 2405 2406 @[inline] 2407 pub fn gen_image_perlin_noise(width int, height int, offsetx int, offsety int, scale f32) Image { 2408 return C.GenImagePerlinNoise(width, height, offsetx, offsety, scale) 2409 } 2410 2411 fn C.GenImageCellular(width int, height int, tilesize int) Image 2412 2413 @[inline] 2414 pub fn gen_image_cellular(width int, height int, tilesize int) Image { 2415 return C.GenImageCellular(width, height, tilesize) 2416 } 2417 2418 fn C.GenImageText(width int, height int, text &i8) Image 2419 2420 @[inline] 2421 pub fn gen_image_text(width int, height int, text string) Image { 2422 return C.GenImageText(width, height, text.str) 2423 } 2424 2425 fn C.ImageCopy(image Image) Image 2426 2427 fn C.ImageFromImage(image Image, rec Rectangle) Image 2428 2429 fn C.ImageText(text &i8, fontsize int, color Color) Image 2430 2431 fn C.ImageTextEx(font Font, text &i8, fontsize f32, spacing f32, tint Color) Image 2432 2433 fn C.ImageFormat(image &Image, newformat int) 2434 2435 fn C.ImageToPOT(image &Image, fill Color) 2436 2437 fn C.ImageCrop(image &Image, crop Rectangle) 2438 2439 fn C.ImageAlphaCrop(image &Image, threshold f32) 2440 2441 fn C.ImageAlphaClear(image &Image, color Color, threshold f32) 2442 2443 fn C.ImageAlphaMask(image &Image, alphamask Image) 2444 2445 fn C.ImageAlphaPremultiply(image &Image) 2446 2447 fn C.ImageBlurGaussian(image &Image, blursize int) 2448 2449 fn C.ImageKernelConvolution(image &Image, kernel &f32, kernelsize int) 2450 2451 fn C.ImageResize(image &Image, newwidth int, newheight int) 2452 2453 fn C.ImageResizeNN(image &Image, newwidth int, newheight int) 2454 2455 fn C.ImageResizeCanvas(image &Image, newwidth int, newheight int, offsetx int, offsety int, fill Color) 2456 2457 fn C.ImageMipmaps(image &Image) 2458 2459 fn C.ImageDither(image &Image, rbpp int, gbpp int, bbpp int, abpp int) 2460 2461 fn C.ImageFlipVertical(image &Image) 2462 2463 fn C.ImageFlipHorizontal(image &Image) 2464 2465 fn C.ImageRotate(image &Image, degrees int) 2466 2467 fn C.ImageRotateCW(image &Image) 2468 2469 fn C.ImageRotateCCW(image &Image) 2470 2471 fn C.ImageColorTint(image &Image, color Color) 2472 2473 fn C.ImageColorInvert(image &Image) 2474 2475 fn C.ImageColorGrayscale(image &Image) 2476 2477 fn C.ImageColorContrast(image &Image, contrast f32) 2478 2479 fn C.ImageColorBrightness(image &Image, brightness int) 2480 2481 fn C.ImageColorReplace(image &Image, color Color, replace Color) 2482 2483 fn C.LoadImageColors(image Image) &Color 2484 2485 fn C.LoadImagePalette(image Image, maxpalettesize int, colorcount &int) &Color 2486 2487 fn C.UnloadImageColors(colors &Color) 2488 2489 fn C.UnloadImagePalette(colors &Color) 2490 2491 fn C.GetImageAlphaBorder(image Image, threshold f32) Rectangle 2492 2493 fn C.GetImageColor(image Image, x int, y int) Color 2494 2495 fn C.ImageClearBackground(dst &Image, color Color) 2496 2497 fn C.ImageDrawPixel(dst &Image, posx int, posy int, color Color) 2498 2499 fn C.ImageDrawPixelV(dst &Image, position Vector2, color Color) 2500 2501 fn C.ImageDrawLine(dst &Image, startposx int, startposy int, endposx int, endposy int, color Color) 2502 2503 fn C.ImageDrawLineV(dst &Image, start Vector2, end Vector2, color Color) 2504 2505 fn C.ImageDrawCircle(dst &Image, centerx int, centery int, radius int, color Color) 2506 2507 fn C.ImageDrawCircleV(dst &Image, center Vector2, radius int, color Color) 2508 2509 fn C.ImageDrawCircleLines(dst &Image, centerx int, centery int, radius int, color Color) 2510 2511 fn C.ImageDrawCircleLinesV(dst &Image, center Vector2, radius int, color Color) 2512 2513 fn C.ImageDrawRectangle(dst &Image, posx int, posy int, width int, height int, color Color) 2514 2515 fn C.ImageDrawRectangleV(dst &Image, position Vector2, size Vector2, color Color) 2516 2517 fn C.ImageDrawRectangleRec(dst &Image, rec Rectangle, color Color) 2518 2519 fn C.ImageDrawRectangleLines(dst &Image, rec Rectangle, thick int, color Color) 2520 2521 fn C.ImageDraw(dst &Image, src Image, srcrec Rectangle, dstrec Rectangle, tint Color) 2522 2523 fn C.ImageDrawText(dst &Image, text &i8, posx int, posy int, fontsize int, color Color) 2524 2525 fn C.ImageDrawTextEx(dst &Image, font Font, text &i8, position Vector2, fontsize f32, spacing f32, tint Color) 2526 2527 fn C.LoadTexture(filename &i8) Texture2D 2528 2529 fn C.LoadTextureFromImage(image Image) Texture2D 2530 2531 fn C.LoadTextureCubemap(image Image, layout int) TextureCubemap 2532 2533 fn C.LoadRenderTexture(width int, height int) RenderTexture2D 2534 2535 fn C.UnloadTexture(texture Texture2D) 2536 2537 fn C.UnloadRenderTexture(target RenderTexture2D) 2538 2539 fn C.UpdateTexture(texture Texture2D, pixels voidptr) 2540 2541 fn C.UpdateTextureRec(texture Texture2D, rec Rectangle, pixels voidptr) 2542 2543 fn C.GenTextureMipmaps(texture &Texture2D) 2544 2545 fn C.SetTextureFilter(texture Texture2D, filter int) 2546 2547 fn C.SetTextureWrap(texture Texture2D, wrap int) 2548 2549 fn C.DrawTexture(texture Texture2D, posx int, posy int, tint Color) 2550 2551 fn C.DrawTextureV(texture Texture2D, position Vector2, tint Color) 2552 2553 fn C.DrawTextureEx(texture Texture2D, position Vector2, rotation f32, scale f32, tint Color) 2554 2555 fn C.DrawTextureRec(texture Texture2D, source Rectangle, position Vector2, tint Color) 2556 2557 fn C.DrawTexturePro(texture Texture2D, source Rectangle, dest Rectangle, origin Vector2, rotation f32, tint Color) 2558 2559 fn C.DrawTextureNPatch(texture Texture2D, npatchinfo NPatchInfo, dest Rectangle, origin Vector2, rotation f32, tint Color) 2560 2561 fn C.Fade(color Color, alpha f32) Color 2562 2563 fn C.ColorToInt(color Color) int 2564 2565 fn C.ColorNormalize(color Color) Vector4 2566 2567 fn C.ColorFromNormalized(normalized Vector4) Color 2568 2569 fn C.ColorToHSV(color Color) Vector3 2570 2571 fn C.ColorFromHSV(hue f32, saturation f32, value f32) Color 2572 2573 fn C.ColorTint(color Color, tint Color) Color 2574 2575 fn C.ColorBrightness(color Color, factor f32) Color 2576 2577 fn C.ColorContrast(color Color, contrast f32) Color 2578 2579 fn C.ColorAlpha(color Color, alpha f32) Color 2580 2581 fn C.ColorAlphaBlend(dst Color, src Color, tint Color) Color 2582 2583 fn C.GetColor(hexvalue u32) Color 2584 2585 fn C.GetPixelColor(srcptr voidptr, format int) Color 2586 2587 fn C.SetPixelColor(dstptr voidptr, color Color, format int) 2588 2589 fn C.GetPixelDataSize(width int, height int, format int) int 2590 2591 fn C.GetFontDefault() Font 2592 2593 fn C.LoadFont(filename &i8) Font 2594 2595 fn C.LoadFontEx(filename &i8, fontsize int, codepoints &int, codepointcount int) Font 2596 2597 fn C.LoadFontFromImage(image Image, key Color, firstchar int) Font 2598 2599 fn C.LoadFontFromMemory(filetype &i8, filedata &u8, datasize int, fontsize int, codepoints &int, codepointcount int) Font 2600 2601 fn C.LoadFontData(filedata &u8, datasize int, fontsize int, codepoints &int, codepointcount int, type_ int) &GlyphInfo 2602 2603 fn C.GenImageFontAtlas(glyphs &GlyphInfo, glyphrecs &&Rectangle, glyphcount int, fontsize int, padding int, packmethod int) Image 2604 2605 fn C.UnloadFontData(glyphs &GlyphInfo, glyphcount int) 2606 2607 fn C.UnloadFont(font Font) 2608 2609 fn C.DrawFPS(posx int, posy int) 2610 2611 fn C.DrawText(text &i8, posx int, posy int, fontsize int, color Color) 2612 2613 @[inline] 2614 pub fn draw_text(text string, posx int, posy int, fontsize int, color Color) { 2615 C.DrawText(text.str, posx, posy, fontsize, color) 2616 } 2617 2618 fn C.DrawTextEx(font Font, text &i8, position Vector2, fontsize f32, spacing f32, tint Color) 2619 2620 @[inline] 2621 pub fn draw_text_ex(font Font, text string, position Vector2, fontsize f32, spacing f32, tint Color) { 2622 C.DrawTextEx(font, text.str, position, fontsize, spacing, tint) 2623 } 2624 2625 fn C.DrawTextPro(font Font, text &i8, position Vector2, origin Vector2, rotation f32, fontsize f32, spacing f32, tint Color) 2626 2627 fn C.DrawTextCodepoint(font Font, codepoint int, position Vector2, fontsize f32, tint Color) 2628 2629 fn C.DrawTextCodepoints(font Font, codepoints &int, codepointcount int, position Vector2, fontsize f32, spacing f32, tint Color) 2630 2631 fn C.SetTextLineSpacing(spacing int) 2632 2633 fn C.MeasureText(text &i8, fontsize int) int 2634 2635 fn C.MeasureTextEx(font Font, text &i8, fontsize f32, spacing f32) Vector2 2636 2637 fn C.GetGlyphIndex(font Font, codepoint int) int 2638 2639 fn C.GetGlyphInfo(font Font, codepoint int) GlyphInfo 2640 2641 fn C.GetGlyphAtlasRec(font Font, codepoint int) Rectangle 2642 2643 fn C.LoadUTF8(codepoints &int, length int) &i8 2644 2645 fn C.UnloadUTF8(text &i8) 2646 2647 fn C.LoadCodepoints(text &i8, count &int) &int 2648 2649 fn C.UnloadCodepoints(codepoints &int) 2650 2651 fn C.GetCodepointCount(text &i8) int 2652 2653 fn C.GetCodepoint(text &i8, codepointsize &int) int 2654 2655 fn C.GetCodepointNext(text &i8, codepointsize &int) int 2656 2657 fn C.GetCodepointPrevious(text &i8, codepointsize &int) int 2658 2659 fn C.CodepointToUTF8(codepoint int, utf8size &int) &i8 2660 2661 fn C.TextCopy(dst &i8, src &i8) int 2662 2663 fn C.TextLength(text &i8) u32 2664 2665 fn C.TextFormat(text ...&i8) &i8 2666 2667 fn C.TextSubtext(text &i8, position int, length int) &i8 2668 2669 fn C.TextReplace(text &i8, replace &i8, by &i8) &i8 2670 2671 fn C.TextInsert(text &i8, insert &i8, position int) &i8 2672 2673 fn C.TextJoin(textlist &&u8, count int, delimiter &i8) &i8 2674 2675 fn C.TextSplit(text &i8, delimiter i8, count &int) &&u8 2676 2677 fn C.TextAppend(text &i8, append &i8, position &int) 2678 2679 fn C.TextFindIndex(text &i8, find &i8) int 2680 2681 fn C.TextToUpper(text &i8) &i8 2682 2683 fn C.TextToLower(text &i8) &i8 2684 2685 fn C.TextToPascal(text &i8) &i8 2686 2687 fn C.TextToInteger(text &i8) int 2688 2689 fn C.TextToFloat(text &i8) f32 2690 2691 fn C.DrawLine3D(startpos Vector3, endpos Vector3, color Color) 2692 2693 fn C.DrawPoint3D(position Vector3, color Color) 2694 2695 fn C.DrawCircle3D(center Vector3, radius f32, rotationaxis Vector3, rotationangle f32, color Color) 2696 2697 fn C.DrawTriangle3D(v1 Vector3, v2 Vector3, v3 Vector3, color Color) 2698 2699 fn C.DrawTriangleStrip3D(points &Vector3, pointcount int, color Color) 2700 2701 fn C.DrawCube(position Vector3, width f32, height f32, length f32, color Color) 2702 2703 fn C.DrawCubeV(position Vector3, size Vector3, color Color) 2704 2705 fn C.DrawCubeWires(position Vector3, width f32, height f32, length f32, color Color) 2706 2707 fn C.DrawCubeWiresV(position Vector3, size Vector3, color Color) 2708 2709 fn C.DrawSphere(centerpos Vector3, radius f32, color Color) 2710 2711 fn C.DrawSphereEx(centerpos Vector3, radius f32, rings int, slices int, color Color) 2712 2713 fn C.DrawSphereWires(centerpos Vector3, radius f32, rings int, slices int, color Color) 2714 2715 fn C.DrawCylinder(position Vector3, radiustop f32, radiusbottom f32, height f32, slices int, color Color) 2716 2717 fn C.DrawCylinderEx(startpos Vector3, endpos Vector3, startradius f32, endradius f32, sides int, color Color) 2718 2719 fn C.DrawCylinderWires(position Vector3, radiustop f32, radiusbottom f32, height f32, slices int, color Color) 2720 2721 fn C.DrawCylinderWiresEx(startpos Vector3, endpos Vector3, startradius f32, endradius f32, sides int, color Color) 2722 2723 fn C.DrawCapsule(startpos Vector3, endpos Vector3, radius f32, slices int, rings int, color Color) 2724 2725 fn C.DrawCapsuleWires(startpos Vector3, endpos Vector3, radius f32, slices int, rings int, color Color) 2726 2727 fn C.DrawPlane(centerpos Vector3, size Vector2, color Color) 2728 2729 fn C.DrawRay(ray Ray, color Color) 2730 2731 fn C.DrawGrid(slices int, spacing f32) 2732 2733 fn C.LoadModel(filename &i8) Model 2734 2735 fn C.LoadModelFromMesh(mesh Mesh) Model 2736 2737 fn C.UnloadModel(model Model) 2738 2739 fn C.GetModelBoundingBox(model Model) BoundingBox 2740 2741 fn C.DrawModel(model Model, position Vector3, scale f32, tint Color) 2742 2743 fn C.DrawModelEx(model Model, position Vector3, rotationaxis Vector3, rotationangle f32, scale Vector3, tint Color) 2744 2745 fn C.DrawModelWires(model Model, position Vector3, scale f32, tint Color) 2746 2747 fn C.DrawModelWiresEx(model Model, position Vector3, rotationaxis Vector3, rotationangle f32, scale Vector3, tint Color) 2748 2749 fn C.DrawBoundingBox(box BoundingBox, color Color) 2750 2751 fn C.DrawBillboard(camera Camera, texture Texture2D, position Vector3, size f32, tint Color) 2752 2753 fn C.DrawBillboardRec(camera Camera, texture Texture2D, source Rectangle, position Vector3, size Vector2, tint Color) 2754 2755 fn C.DrawBillboardPro(camera Camera, texture Texture2D, source Rectangle, position Vector3, up Vector3, size Vector2, origin Vector2, rotation f32, tint Color) 2756 2757 fn C.UploadMesh(mesh &Mesh, dynamic bool) 2758 2759 fn C.UpdateMeshBuffer(mesh Mesh, index int, data voidptr, datasize int, offset int) 2760 2761 fn C.UnloadMesh(mesh Mesh) 2762 2763 fn C.DrawMesh(mesh Mesh, material Material, transform Matrix) 2764 2765 fn C.DrawMeshInstanced(mesh Mesh, material Material, transforms &Matrix, instances int) 2766 2767 fn C.GetMeshBoundingBox(mesh Mesh) BoundingBox 2768 2769 fn C.GenMeshTangents(mesh &Mesh) 2770 2771 fn C.GenMeshPoly(sides int, radius f32) Mesh 2772 2773 fn C.GenMeshPlane(width f32, length f32, resx int, resz int) Mesh 2774 2775 fn C.GenMeshCube(width f32, height f32, length f32) Mesh 2776 2777 fn C.GenMeshSphere(radius f32, rings int, slices int) Mesh 2778 2779 fn C.GenMeshHemiSphere(radius f32, rings int, slices int) Mesh 2780 2781 fn C.GenMeshCylinder(radius f32, height f32, slices int) Mesh 2782 2783 fn C.GenMeshCone(radius f32, height f32, slices int) Mesh 2784 2785 fn C.GenMeshTorus(radius f32, size f32, radseg int, sides int) Mesh 2786 2787 fn C.GenMeshKnot(radius f32, size f32, radseg int, sides int) Mesh 2788 2789 fn C.GenMeshHeightmap(heightmap Image, size Vector3) Mesh 2790 2791 fn C.GenMeshCubicmap(cubicmap Image, cubesize Vector3) Mesh 2792 2793 fn C.LoadMaterials(filename &i8, materialcount &int) &Material 2794 2795 fn C.LoadMaterialDefault() Material 2796 2797 fn C.UnloadMaterial(material Material) 2798 2799 fn C.SetMaterialTexture(material &Material, maptype int, texture Texture2D) 2800 2801 fn C.SetModelMeshMaterial(model &Model, meshid int, materialid int) 2802 2803 fn C.LoadModelAnimations(filename &i8, animcount &int) &ModelAnimation 2804 2805 fn C.UpdateModelAnimation(model Model, anim ModelAnimation, frame int) 2806 2807 fn C.UnloadModelAnimation(anim ModelAnimation) 2808 2809 fn C.UnloadModelAnimations(animations &ModelAnimation, animcount int) 2810 2811 fn C.GetRayCollisionSphere(ray Ray, center Vector3, radius f32) RayCollision 2812 2813 fn C.GetRayCollisionBox(ray Ray, box BoundingBox) RayCollision 2814 2815 fn C.GetRayCollisionMesh(ray Ray, mesh Mesh, transform Matrix) RayCollision 2816 2817 fn C.GetRayCollisionTriangle(ray Ray, p1 Vector3, p2 Vector3, p3 Vector3) RayCollision 2818 2819 fn C.GetRayCollisionQuad(ray Ray, p1 Vector3, p2 Vector3, p3 Vector3, p4 Vector3) RayCollision 2820 2821 fn C.InitAudioDevice() 2822 2823 fn C.CloseAudioDevice() 2824 2825 fn C.SetMasterVolume(volume f32) 2826 2827 fn C.GetMasterVolume() f32 2828 2829 fn C.LoadWave(filename &i8) Wave 2830 2831 fn C.LoadWaveFromMemory(filetype &i8, filedata &u8, datasize int) Wave 2832 2833 fn C.LoadSound(filename &i8) Sound 2834 2835 fn C.LoadSoundFromWave(wave Wave) Sound 2836 2837 fn C.LoadSoundAlias(source Sound) Sound 2838 2839 fn C.UpdateSound(sound Sound, data voidptr, samplecount int) 2840 2841 fn C.UnloadWave(wave Wave) 2842 2843 fn C.UnloadSound(sound Sound) 2844 2845 fn C.UnloadSoundAlias(alias Sound) 2846 2847 fn C.PlaySound(sound Sound) 2848 2849 fn C.StopSound(sound Sound) 2850 2851 fn C.PauseSound(sound Sound) 2852 2853 fn C.ResumeSound(sound Sound) 2854 2855 fn C.SetSoundVolume(sound Sound, volume f32) 2856 2857 fn C.SetSoundPitch(sound Sound, pitch f32) 2858 2859 fn C.SetSoundPan(sound Sound, pan f32) 2860 2861 fn C.WaveCopy(wave Wave) Wave 2862 2863 fn C.WaveCrop(wave &Wave, initsample int, finalsample int) 2864 2865 fn C.WaveFormat(wave &Wave, samplerate int, samplesize int, channels int) 2866 2867 fn C.LoadWaveSamples(wave Wave) &f32 2868 2869 fn C.UnloadWaveSamples(samples &f32) 2870 2871 fn C.LoadMusicStream(filename &i8) Music 2872 2873 fn C.LoadMusicStreamFromMemory(filetype &i8, data &u8, datasize int) Music 2874 2875 fn C.UnloadMusicStream(music Music) 2876 2877 fn C.PlayMusicStream(music Music) 2878 2879 fn C.UpdateMusicStream(music Music) 2880 2881 fn C.StopMusicStream(music Music) 2882 2883 fn C.PauseMusicStream(music Music) 2884 2885 fn C.ResumeMusicStream(music Music) 2886 2887 fn C.SeekMusicStream(music Music, position f32) 2888 2889 fn C.SetMusicVolume(music Music, volume f32) 2890 2891 fn C.SetMusicPitch(music Music, pitch f32) 2892 2893 fn C.SetMusicPan(music Music, pan f32) 2894 2895 fn C.GetMusicTimeLength(music Music) f32 2896 2897 fn C.GetMusicTimePlayed(music Music) f32 2898 2899 fn C.LoadAudioStream(samplerate u32, samplesize u32, channels u32) AudioStream 2900 2901 fn C.UnloadAudioStream(stream AudioStream) 2902 2903 fn C.UpdateAudioStream(stream AudioStream, data voidptr, framecount int) 2904 2905 fn C.PlayAudioStream(stream AudioStream) 2906 2907 fn C.PauseAudioStream(stream AudioStream) 2908 2909 fn C.ResumeAudioStream(stream AudioStream) 2910 2911 fn C.StopAudioStream(stream AudioStream) 2912 2913 fn C.SetAudioStreamVolume(stream AudioStream, volume f32) 2914 2915 fn C.SetAudioStreamPitch(stream AudioStream, pitch f32) 2916 2917 fn C.SetAudioStreamPan(stream AudioStream, pan f32) 2918 2919 fn C.SetAudioStreamBufferSizeDefault(size int) 2920 2921 fn C.SetAudioStreamCallback(stream AudioStream, callback AudioCallback) 2922 2923 fn C.AttachAudioStreamProcessor(stream AudioStream, processor AudioCallback) 2924 2925 fn C.DetachAudioStreamProcessor(stream AudioStream, processor AudioCallback) 2926 2927 fn C.AttachAudioMixedProcessor(processor AudioCallback) 2928 2929 fn C.DetachAudioMixedProcessor(processor AudioCallback)