1use libc::{c_char, c_double, c_float, c_int, c_uchar, c_uint, c_void};
86use va_list::VaList;
87
88use crate::{
89 audio::{AudioCallback, AudioStream, Music, Sound, Wave},
90 camera::Camera2D,
91 color::Color,
92 consts::{
93 ConfigFlag, GamepadAxis, GamepadButton, Gesture, KeyboardKey, MouseButton, MouseCursor,
94 TextureFilter, TextureWrap,
95 },
96 math::{Rectangle, Vector2},
97 texture::{Image, RenderTexture, RenderTexture2D, Texture},
98};
99
100unsafe extern "C" {
102 #[link_name = "InitWindow"]
104 pub fn init_window(width: c_int, height: c_int, title: *const c_char);
105 #[link_name = "CloseWindow"]
107 pub fn close_window();
108 #[link_name = "WindowShouldClose"]
110 pub fn window_should_close() -> bool;
111 #[link_name = "IsWindowReady"]
113 pub fn is_window_ready() -> bool;
114 #[link_name = "IsWindowFullscreen"]
116 pub fn is_window_fullscreen() -> bool;
117 #[link_name = "IsWindowHidden"]
119 pub fn is_window_hidden() -> bool;
120 #[link_name = "IsWindowMinimized"]
122 pub fn is_window_minimized() -> bool;
123 #[link_name = "IsWindowMaximized"]
125 pub fn is_window_maximized() -> bool;
126 #[link_name = "IsWindowFocused"]
128 pub fn is_window_focused() -> bool;
129 #[link_name = "IsWindowResized"]
131 pub fn is_window_resized() -> bool;
132 #[link_name = "IsWindowState"]
145 pub fn is_window_state(flags: ConfigFlag) -> bool;
146 #[link_name = "SetWindowState"]
159 pub fn set_window_state(flags: ConfigFlag);
160 #[link_name = "ClearWindowState"]
173 pub fn clear_window_state(flags: ConfigFlag);
174 #[link_name = "ToggleFullscreen"]
176 pub fn toggle_fullscreen();
177 #[link_name = "ToggleBorderlessWindowed"]
179 pub fn toggle_borderless_windowed();
180 #[link_name = "MaximizeWindow"]
182 pub fn maximize_window();
183 #[link_name = "MinimizeWindow"]
185 pub fn minimize_window();
186 #[link_name = "RestoreWindow"]
188 pub fn restore_window();
189 #[link_name = "SetWindowIcon"]
191 pub fn set_window_icon(image: Image);
192 #[link_name = "SetWindowIcons"]
194 pub fn set_window_icons(images: *const Image, count: c_int);
195 #[link_name = "SetWindowTitle"]
197 pub fn set_window_title(title: *const c_char);
198 #[link_name = "SetWindowPosition"]
200 pub fn set_window_position(x: c_int, y: c_int);
201 #[link_name = "SetWindowMonitor"]
203 pub fn set_window_monitor(monitor: c_int);
204 #[link_name = "SetWindowMinSize"]
206 pub fn set_window_min_size(width: c_int, height: c_int);
207 #[link_name = "SetWindowMaxSize"]
209 pub fn set_window_max_size(width: c_int, height: c_int);
210 #[link_name = "SetWindowSize"]
212 pub fn set_window_size(width: c_int, height: c_int);
213 #[link_name = "SetWindowOpacity"]
215 pub fn set_window_opacity(opacity: c_float);
216 #[link_name = "SetWindowFocused"]
218 pub fn set_window_focused();
219 #[link_name = "GetScreenWidth"]
221 pub fn get_screen_width() -> c_int;
222 #[link_name = "GetScreenHeight"]
224 pub fn get_screen_height() -> c_int;
225 #[link_name = "GetRenderWidth"]
227 pub fn get_render_width() -> c_int;
228 #[link_name = "GetRenderHeight"]
230 pub fn get_render_height() -> c_int;
231 #[link_name = "GetMonitorCount"]
233 pub fn get_monitor_count() -> c_int;
234 #[link_name = "GetCurrentMonitor"]
236 pub fn get_current_monitor() -> c_int;
237 #[link_name = "GetMonitorPosition"]
239 pub fn get_monitor_position(monitor: c_int) -> Vector2;
240 #[link_name = "GetMonitorWidth"]
242 pub fn get_monitor_width(monitor: c_int) -> c_int;
243 #[link_name = "GetMonitorHeight"]
245 pub fn get_monitor_height(monitor: c_int) -> c_int;
246 #[link_name = "GetMonitorPhysicalWidth"]
248 pub fn get_monitor_physical_width(monitor: c_int) -> c_int;
249 #[link_name = "GetMonitorPhysicalHeight"]
251 pub fn get_monitor_physical_height(monitor: c_int) -> c_int;
252 #[link_name = "GetMonitorRefreshRate"]
254 pub fn get_monitor_refresh_rate(monitor: c_int) -> c_int;
255 #[link_name = "GetWindowPosition"]
257 pub fn get_window_position() -> Vector2;
258 #[link_name = "GetWindowScaleDPI"]
260 pub fn get_window_scale_dpi() -> Vector2;
261 #[link_name = "GetMonitorName"]
263 pub fn get_monitor_name(monitor: c_int) -> *const c_char;
264 #[link_name = "SetClipboardText"]
266 pub fn set_clipboard_text(text: *const c_char);
267 #[link_name = "GetClipboardText"]
269 pub fn get_clipboard_text() -> *const c_char;
270 #[link_name = "GetClipboardImage"]
272 pub fn get_clipboard_image() -> Image;
273 #[link_name = "EnableEventWaiting"]
275 pub fn enable_event_waiting();
276 #[link_name = "DisableEventWaiting"]
278 pub fn disable_event_waiting();
279}
280
281unsafe extern "C" {
283 #[link_name = "ShowCursor"]
285 pub fn show_cursor();
286 #[link_name = "HideCursor"]
288 pub fn hide_cursor();
289 #[link_name = "IsCursorHidden"]
291 pub fn is_cursor_hidden() -> bool;
292 #[link_name = "EnableCursor"]
294 pub fn enable_cursor();
295 #[link_name = "DisableCursor"]
297 pub fn disable_cursor();
298 #[link_name = "IsCursorOnScreen"]
300 pub fn is_cursor_on_screen() -> bool;
301}
302
303unsafe extern "C" {
305 #[link_name = "ClearBackground"]
307 pub fn clear_background(color: Color);
308 #[link_name = "BeginDrawing"]
310 pub fn begin_drawing();
311 #[link_name = "EndDrawing"]
313 pub fn end_drawing();
314 #[link_name = "BeginMode2D"]
316 pub fn begin_mode_2d(camera: Camera2D);
317 #[link_name = "EndMode2D"]
319 pub fn end_mode_2d();
320 #[link_name = "BeginTextureMode"]
322 pub fn begin_texture_mode(render_texture: RenderTexture2D);
323 #[link_name = "EndTextureMode"]
325 pub fn end_texture_mode();
326}
327
328unsafe extern "C" {
330 #[link_name = "LoadImageFromMemory"]
332 pub fn load_image_from_memory(
333 file_type: *const c_char,
334 file_data: *const c_uchar,
335 data_size: c_int,
336 ) -> Image;
337}
338
339unsafe extern "C" {
342 #[link_name = "LoadTexture"]
344 pub fn load_texture(path: *const c_char) -> Texture;
345 #[link_name = "LoadTextureFromImage"]
347 pub fn load_texture_from_image(image: Image) -> Texture;
348 #[link_name = "LoadRenderTexture"]
350 pub fn load_render_texture(width: c_int, height: c_int) -> RenderTexture;
351 #[link_name = "IsTextureValid"]
353 pub fn is_texture_valid(texture: Texture) -> bool;
354 #[link_name = "UnloadTexture"]
356 pub fn unload_texture(texture: Texture);
357 #[link_name = "IsRenderTextureValid"]
359 pub fn is_render_texture_valid(target: RenderTexture) -> bool;
360 #[link_name = "UnloadRenderTexture"]
362 pub fn unload_render_texture(render_texture: RenderTexture);
363 #[link_name = "UpdateTexture"]
365 pub fn update_texture(texture: Texture, pixels: *const c_void);
366 #[link_name = "UpdateTextureRec"]
368 pub fn update_texture_rec(texture: Texture, rec: Rectangle, pixels: *const c_void);
369}
370
371unsafe extern "C" {
373 #[link_name = "GenTextureMipmaps"]
375 pub fn gen_texture_mipmaps(texture: *mut Texture);
376 #[link_name = "SetTextureFilter"]
378 pub fn set_texture_filter(texture: Texture, filter: TextureFilter);
379 #[link_name = "SetTextureWrap"]
381 pub fn set_texture_wrap(texture: Texture, wrap: TextureWrap);
382}
383
384unsafe extern "C" {
386 #[link_name = "DrawTexture"]
388 pub fn draw_texture(texture: Texture, pos_x: c_int, pos_y: c_int, tint: Color);
389 #[link_name = "DrawTextureV"]
391 pub fn draw_texture_v(texture: Texture, pos: Vector2, tint: Color);
392 #[link_name = "DrawTextureEx"]
394 pub fn draw_texture_ex(
395 texture: Texture,
396 pos: Vector2,
397 rotation: c_float,
398 scale: c_float,
399 tint: Color,
400 );
401 #[link_name = "DrawTextureRec"]
403 pub fn draw_texture_rec(texture: Texture, source: Rectangle, position: Vector2, tint: Color);
404 #[link_name = "DrawTexturePro"]
406 pub fn draw_texture_pro(
407 texture: Texture,
408 source: Rectangle,
409 dest: Rectangle,
410 origin: Vector2,
411 rotation: c_float,
412 tint: Color,
413 );
414 }
416
417unsafe extern "C" {
419 #[link_name = "DrawFPS"]
421 pub fn draw_fps(pos_x: c_int, pos_y: c_int);
422 #[link_name = "DrawText"]
424 pub fn draw_text(
425 text: *const c_char,
426 pos_x: c_int,
427 pos_y: c_int,
428 font_size: c_int,
429 color: Color,
430 );
431}
432
433unsafe extern "C" {
435 #[link_name = "MeasureText"]
437 pub fn measure_text(text: *const c_char, font_size: c_int) -> c_int;
438}
439
440unsafe extern "C" {
442 #[link_name = "DrawLine"]
444 pub fn draw_line(start_x: c_int, start_y: c_int, end_x: c_int, end_y: c_int, color: Color);
445 #[link_name = "DrawLineV"]
447 pub fn draw_line_v(start: Vector2, end: Vector2, color: Color);
448 #[link_name = "DrawLineEx"]
450 pub fn draw_line_ex(start: Vector2, end: Vector2, thick: c_float, color: Color);
451 #[link_name = "DrawLineStrip"]
453 pub fn draw_line_strip(points: *const Vector2, num_points: c_int, color: Color);
454 #[link_name = "DrawLineBezier"]
456 pub fn draw_line_bezier(start: Vector2, end: Vector2, thick: c_float, color: Color);
457 #[link_name = "DrawCircle"]
459 pub fn draw_circle(center_x: c_int, center_y: c_int, radius: c_float, color: Color);
460 #[link_name = "DrawCircleV"]
462 pub fn draw_circle_v(center: Vector2, radius: c_float, color: Color);
463 #[link_name = "DrawCircleLines"]
465 pub fn draw_circle_lines(center_x: c_int, center_y: c_int, radius: c_float, color: Color);
466 #[link_name = "DrawEllipse"]
468 pub fn draw_ellipse(
469 center_x: c_int,
470 center_y: c_int,
471 radius_x: c_float,
472 radius_y: c_float,
473 color: Color,
474 );
475 #[link_name = "DrawRectangleRec"]
477 pub fn draw_rectangle_rec(rec: Rectangle, color: Color);
478 #[link_name = "DrawRectanglePro"]
480 pub fn draw_rectangle_pro(rec: Rectangle, origin: Vector2, rotation: f32, color: Color);
481 #[link_name = "DrawRectangleLines"]
483 pub fn draw_rectangle_lines(
484 pos_x: c_int,
485 pos_y: c_int,
486 width: c_int,
487 height: c_int,
488 color: Color,
489 );
490 #[link_name = "DrawRectangleLinesEx"]
491 pub fn draw_rectangle_lines_ex(rect: Rectangle, line_thickness: c_float, color: Color);
492 #[link_name = "DrawTriangle"]
493 pub fn draw_triangle(v1: Vector2, v2: Vector2, v3: Vector2, color: Color);
494 #[link_name = "DrawTriangleLines"]
495 pub fn draw_triangle_lines(v1: Vector2, v2: Vector2, v3: Vector2, color: Color);
496}
497
498unsafe extern "C" {
500 #[link_name = "IsKeyPressed"]
502 pub fn is_key_pressed(key: KeyboardKey) -> bool;
503 #[link_name = "IsKeyPressedRepeat"]
505 pub fn is_key_pressed_repeat(key: KeyboardKey) -> bool;
506 #[link_name = "IsKeyDown"]
508 pub fn is_key_down(key: KeyboardKey) -> bool;
509 #[link_name = "IsKeyReleased"]
511 pub fn is_key_released(key: KeyboardKey) -> bool;
512 #[link_name = "IsKeyUp"]
514 pub fn is_key_up(key: KeyboardKey) -> bool;
515 #[link_name = "GetKeyPressed"]
517 pub fn get_key_pressed() -> c_int;
518 #[link_name = "GetCharPressed"]
520 pub fn get_char_pressed() -> c_int;
521 #[link_name = "SetExitKey"]
523 pub fn set_exit_key(key: KeyboardKey);
524}
525
526unsafe extern "C" {
528 #[link_name = "IsGamepadAvailable"]
530 pub fn is_gamepad_available(gamepad: c_int) -> bool;
531 #[link_name = "GetGamepadName"]
533 pub fn get_gamepad_name(gamepad: c_int) -> *const c_char;
534 #[link_name = "IsGamepadButtonPressed"]
536 pub fn is_gamepad_button_pressed(gamepad: c_int, button: GamepadButton) -> bool;
537 #[link_name = "IsGamepadButtonDown"]
539 pub fn is_gamepad_button_down(gamepad: c_int, button: GamepadButton) -> bool;
540 #[link_name = "IsGamepadButtonReleased"]
542 pub fn is_gamepad_button_released(gamepad: c_int, button: GamepadButton) -> bool;
543 #[link_name = "IsGamepadButtonUp"]
545 pub fn is_gamepad_button_up(gamepad: c_int, button: GamepadButton) -> bool;
546 #[link_name = "GetGamepadButtonPressed"]
548 pub fn get_gamepad_button_pressed() -> c_int;
549 #[link_name = "GetGamepadAxisCount"]
551 pub fn get_gamepad_axis_count(gamepad: c_int) -> c_int;
552 #[link_name = "GetGamepadAxisMovement"]
554 pub fn get_gamepad_axis_movement(gamepad: c_int, axis: GamepadAxis) -> c_float;
555 #[link_name = "SetGamepadVibration"]
557 pub fn set_gamepad_vibration(
558 gamepad: c_int,
559 left_motor: c_float,
560 right_motor: c_float,
561 duration: c_float,
562 );
563}
564
565unsafe extern "C" {
567 #[link_name = "IsMouseButtonPressed"]
569 pub fn is_mouse_button_pressed(button: MouseButton) -> bool;
570 #[link_name = "IsMouseButtonDown"]
572 pub fn is_mouse_button_down(button: MouseButton) -> bool;
573 #[link_name = "IsMouseButtonReleased"]
575 pub fn is_mouse_button_released(button: MouseButton) -> bool;
576 #[link_name = "IsMouseButtonUp"]
578 pub fn is_mouse_button_up(button: MouseButton) -> bool;
579 #[link_name = "GetMouseX"]
581 pub fn get_mouse_x() -> c_int;
582 #[link_name = "GetMouseY"]
584 pub fn get_mouse_y() -> c_int;
585 #[link_name = "GetMousePosition"]
587 pub fn get_mouse_position() -> Vector2;
588 #[link_name = "GetMouseDelta"]
590 pub fn get_mouse_delta() -> Vector2;
591 #[link_name = "SetMousePosition"]
593 pub fn set_mouse_position(x: c_int, y: c_int);
594 #[link_name = "SetMouseOffset"]
596 pub fn set_mouse_offset(offset_x: c_int, offset_y: c_int);
597 #[link_name = "SetMouseScale"]
599 pub fn set_mouse_scale(scale_x: c_float, scale_y: c_float);
600 #[link_name = "GetMouseWheelMove"]
602 pub fn get_mouse_wheel_move() -> c_float;
603 #[link_name = "GetMouseWheelMoveV"]
605 pub fn get_mouse_wheel_move_v() -> Vector2;
606 #[link_name = "SetMouseCursor"]
608 pub fn set_mouse_cursor(cursor: MouseCursor);
609}
610
611unsafe extern "C" {
613 #[link_name = "GetTouchX"]
615 pub fn get_touch_x() -> c_int;
616 #[link_name = "GetTouchY"]
618 pub fn get_touch_y() -> c_int;
619 #[link_name = "GetTouchPosition"]
621 pub fn get_touch_position(index: c_int) -> Vector2;
622 #[link_name = "GetTouchPointId"]
624 pub fn get_touch_point_id(index: c_int) -> c_int;
625 #[link_name = "GetTouchPointCount"]
627 pub fn get_touch_point_count() -> c_int;
628}
629unsafe extern "C" {
631 #[link_name = "SetGesturesEnabled"]
633 pub fn set_gestures_enabled(flags: Gesture);
634 #[link_name = "IsGestureDetected"]
636 pub fn is_gesture_detected(gesture: Gesture) -> bool;
637 #[link_name = "GetGestureDetected"]
639 pub fn get_gesture_detected() -> Gesture;
640 #[link_name = "GetGestureHoldDuration"]
642 pub fn get_gesture_hold_duration() -> c_float;
643 #[link_name = "GetGestureDragVector"]
645 pub fn get_gesture_drag_vector() -> Vector2;
646 #[link_name = "GetGestureDragAngle"]
648 pub fn get_gesture_drag_angle() -> c_float;
649 #[link_name = "GetGesturePinchVector"]
651 pub fn get_gesture_pinch_vector() -> Vector2;
652 #[link_name = "GetGesturePinchAngle"]
654 pub fn get_gesture_pinch_angle() -> c_float;
655}
656
657unsafe extern "C" {
659 #[link_name = "SetTargetFPS"]
661 pub fn set_target_fps(fps: c_int);
662 #[link_name = "GetFrameTime"]
664 pub fn get_frame_time() -> c_float;
665 #[link_name = "GetTime"]
667 pub fn get_time() -> c_double;
668 #[link_name = "GetFPS"]
670 pub fn get_fps() -> c_int;
671}
672
673unsafe extern "C" {
675 #[link_name = "TakeScreenshot"]
677 pub fn take_screenshot(file_name: *const c_char);
678 #[link_name = "SetConfigFlags"]
691 pub fn set_config_flags(flags: ConfigFlag);
692 #[link_name = "OpenURL"]
694 pub fn open_url(url: *const c_char);
695}
696
697unsafe extern "C" {
699 #[link_name = "InitAudioDevice"]
701 pub fn init_audio_device();
702 #[link_name = "CloseAudioDevice"]
704 pub fn close_audio_device();
705 #[link_name = "IsAudioDeviceReady"]
707 pub fn is_audio_device_ready() -> bool;
708 #[link_name = "SetMasterVolume"]
710 pub fn set_master_volume(volume: c_float);
711 #[link_name = "GetMasterVolume"]
713 pub fn get_master_volume() -> c_float;
714}
715
716unsafe extern "C" {
718 #[link_name = "LoadWave"]
720 pub fn load_wave(file_name: *const c_char) -> Wave;
721 #[link_name = "LoadWaveFromMemory"]
723 pub fn load_wave_from_memory(
724 file_type: *const c_char,
725 file_data: *const c_uchar,
726 data_size: c_int,
727 ) -> Wave;
728 #[link_name = "IsWaveValid"]
730 pub fn is_wave_valid(wave: Wave) -> bool;
731 #[link_name = "LoadSound"]
733 pub fn load_sound(file_name: *const c_char) -> Sound;
734 #[link_name = "LoadSoundFromWave"]
736 pub fn load_sound_from_wave(wave: Wave) -> Sound;
737 #[link_name = "LoadSoundAlias"]
739 pub fn load_sound_alias(source: Sound) -> Sound;
740 #[link_name = "IsSoundValid"]
742 pub fn is_sound_valid(sound: Sound) -> bool;
743 #[link_name = "UpdateSound"]
745 pub fn update_sound(sound: Sound, data: *const c_void, sample_count: c_int);
746 #[link_name = "UnloadWave"]
748 pub fn unload_wave(wave: Wave);
749 #[link_name = "UnloadSound"]
751 pub fn unload_sound(sound: Sound);
752 #[link_name = "UnloadSoundAlias"]
754 pub fn unload_sound_alias(alias: Sound);
755 #[link_name = "ExportWave"]
757 pub fn export_wave(wave: Wave, file_name: *const c_char) -> bool;
758 #[link_name = "ExportWaveAsCode"]
760 pub fn export_wave_as_code(wave: Wave, file_name: *const c_char) -> bool;
761}
762
763unsafe extern "C" {
765 #[link_name = "PlaySound"]
767 pub fn play_sound(sound: Sound);
768 #[link_name = "StopSound"]
770 pub fn stop_sound(sound: Sound);
771 #[link_name = "PauseSound"]
773 pub fn pause_sound(sound: Sound);
774 #[link_name = "ResumeSound"]
776 pub fn resume_sound(sound: Sound);
777 #[link_name = "IsSoundPlaying"]
779 pub fn is_sound_playing(sound: Sound) -> bool;
780 #[link_name = "SetSoundVolume"]
782 pub fn set_sound_volume(sound: Sound, volume: c_float);
783 #[link_name = "SetSoundPitch"]
785 pub fn set_sound_pitch(sound: Sound, pitch: c_float);
786 #[link_name = "SetSoundPan"]
788 pub fn set_sound_pan(sound: Sound, pan: c_float);
789 #[link_name = "WaveCopy"]
791 pub fn wave_copy(wave: Wave) -> Wave;
792 #[link_name = "WaveCrop"]
794 pub fn wave_crop(wave: *mut Wave, init_frame: c_int, final_frame: c_int);
795 #[link_name = "WaveFormat"]
797 pub fn wave_format(wave: *mut Wave, sample_rate: c_int, sample_size: c_int, channels: c_int);
798 #[link_name = "LoadWaveSamples"]
800 pub fn load_wave_samples(wave: Wave) -> *mut c_float;
801 #[link_name = "UnloadWaveSamples"]
803 pub fn unload_wave_samples(samples: *mut c_float);
804}
805
806unsafe extern "C" {
807 #[link_name = "LoadMusicStream"]
809 pub fn load_music_stream(file_name: *const c_char) -> Music;
810 #[link_name = "LoadMusicStreamFromMemory"]
812 pub fn load_music_stream_from_memory(
813 file_type: *const c_char,
814 data: *const c_uchar,
815 data_size: c_int,
816 ) -> Music;
817 #[link_name = "IsMusicValid"]
819 pub fn is_music_valid(music: Music) -> bool;
820 #[link_name = "UnloadMusicStream"]
822 pub fn unload_music_stream(music: Music);
823 #[link_name = "PlayMusicStream"]
825 pub fn play_music_stream(music: Music);
826 #[link_name = "IsMusicStreamPlaying"]
828 pub fn is_music_stream_playing(music: Music) -> bool;
829 #[link_name = "UpdateMusicStream"]
831 pub fn update_music_stream(music: Music);
832 #[link_name = "StopMusicStream"]
834 pub fn stop_music_stream(music: Music);
835 #[link_name = "PauseMusicStream"]
837 pub fn pause_music_stream(music: Music);
838 #[link_name = "ResumeMusicStream"]
840 pub fn resume_music_stream(music: Music);
841 #[link_name = "SeekMusicStream"]
843 pub fn seek_music_stream(music: Music, position: c_float);
844 #[link_name = "SetMusicVolume"]
846 pub fn set_music_volume(music: Music, volume: c_float);
847 #[link_name = "SetMusicPitch"]
849 pub fn set_music_pitch(music: Music, pitch: c_float);
850 #[link_name = "SetMusicPan"]
852 pub fn set_music_pan(music: Music, pan: c_float);
853 #[link_name = "GetMusicTimeLength"]
855 pub fn get_music_time_length(music: Music) -> c_float;
856 #[link_name = "GetMusicTimePlayed"]
858 pub fn get_music_time_played(music: Music) -> c_float;
859}
860
861unsafe extern "C" {
863 #[link_name = "LoadAudioStream"]
865 pub fn load_audio_stream(
866 sample_rate: c_uint,
867 sample_size: c_uint,
868 channels: c_uint,
869 ) -> AudioStream;
870 #[link_name = "IsAudioStreamValid"]
872 pub fn is_audio_stream_valid(stream: AudioStream) -> bool;
873 #[link_name = "UnloadAudioStream"]
875 pub fn unload_audio_stream(stream: AudioStream);
876 #[link_name = "UpdateAudioStream"]
878 pub fn update_audio_stream(stream: AudioStream, data: *const c_void, frame_count: c_int);
879 #[link_name = "IsAudioStreamProcessed"]
881 pub fn is_audio_stream_processed(stream: AudioStream) -> bool;
882 #[link_name = "PlayAudioStream"]
884 pub fn play_audio_stream(stream: AudioStream);
885 #[link_name = "PauseAudioStream"]
887 pub fn pause_audio_stream(stream: AudioStream);
888 #[link_name = "ResumeAudioStream"]
890 pub fn resume_audio_stream(stream: AudioStream);
891 #[link_name = "IsAudioStreamPlaying"]
893 pub fn is_audio_stream_playing(stream: AudioStream) -> bool;
894 #[link_name = "StopAudioStream"]
896 pub fn stop_audio_stream(stream: AudioStream);
897 #[link_name = "SetAudioStreamVolume"]
899 pub fn set_audio_stream_volume(stream: AudioStream, volume: c_float);
900 #[link_name = "SetAudioStreamPitch"]
902 pub fn set_audio_stream_pitch(stream: AudioStream, pitch: c_float);
903 #[link_name = "SetAudioStreamPan"]
905 pub fn set_audio_stream_pan(stream: AudioStream, pan: c_float);
906 #[link_name = "SetAudioStreamBufferSizeDefault"]
908 pub fn set_audio_stream_buffer_size_default(size: c_int);
909 #[link_name = "SetAudioStreamCallback"]
911 pub fn set_audio_stream_callback(stream: AudioStream, callback: AudioCallback);
912
913 #[link_name = "AttachAudioStreamProcessor"]
915 pub fn attach_audio_stream_processor(stream: AudioStream, processor: AudioCallback);
916 #[link_name = "DetachAudioStreamProcessor"]
918 pub fn detach_audio_stream_processor(stream: AudioStream, processor: AudioCallback);
919 #[link_name = "AttachAudioMixedProcessor"]
921 pub fn attach_audio_mixed_processor(processor: AudioCallback);
922 #[link_name = "DetachAudioMixedProcessor"]
924 pub fn detach_audio_mixed_processor(processor: AudioCallback);
925}
926
927unsafe extern "C" {
929 #[link_name = "CheckCollisionRecs"]
931 pub fn check_collision_recs(rec1: Rectangle, rec2: Rectangle) -> bool;
932 #[link_name = "CheckCollisionCircles"]
934 pub fn check_collision_circles(
935 center1: Vector2,
936 radius1: f32,
937 center2: Vector2,
938 radius2: f32,
939 ) -> bool;
940 #[link_name = "CheckCollisionCircleRec"]
942 pub fn check_collision_circle_rec(center1: Vector2, radius1: c_float, rec: Rectangle) -> bool;
943 #[link_name = "CheckCollisionCircleLine"]
945 pub fn check_collision_circle_line(
946 center: Vector2,
947 radius: f32,
948 p1: Vector2,
949 p2: Vector2,
950 ) -> bool;
951 #[link_name = "CheckCollisionPointRec"]
953 pub fn check_collision_point_rec(point: Vector2, rec: Rectangle) -> bool;
954 #[link_name = "CheckCollisionPointCircle"]
956 pub fn check_collision_point_circle(point: Vector2, center: Vector2, radius: c_float) -> bool;
957 #[link_name = "CheckCollisionPointTriangle"]
959 pub fn check_collision_point_triangle(
960 point: Vector2,
961 p1: Vector2,
962 p2: Vector2,
963 p3: Vector2,
964 ) -> bool;
965 #[link_name = "CheckCollisionPointLine"]
967 pub fn check_collision_point_line(
968 point: Vector2,
969 p1: Vector2,
970 p2: Vector2,
971 threshold: c_int,
972 ) -> bool;
973 #[link_name = "CheckCollisionPointPoly"]
975 pub fn check_collision_point_poly(
976 point: Vector2,
977 p1: *const Vector2,
978 point_count: c_int,
979 ) -> bool;
980 #[link_name = "GetCollisionRec"]
982 pub fn get_collision_rec(rec1: Rectangle, rec2: Rectangle) -> Rectangle;
983}
984
985pub type TraceLogCallback = extern "C" fn(log_level: c_int, text: *const c_char, args: VaList);
987
988unsafe extern "C" {
989 #[link_name = "SetTraceLogCallback"]
990 pub fn set_trace_log_callback(callback: TraceLogCallback);
991}