├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── a_c_wrapper.v ├── audio.v ├── camera.v ├── colors.v ├── drawing.v ├── examples ├── audio │ ├── audio_streaming.v │ └── resources │ │ └── mini1111.xm ├── core │ ├── core_2d_camera.v │ ├── core_basic_window.v │ ├── core_input_keys.v │ ├── core_input_mouse.v │ └── core_input_mouse_wheel.v └── models │ ├── models_load.v │ └── resources │ ├── Suzanne.bin │ ├── Suzanne.gltf │ ├── Suzanne_BaseColor.png │ └── Suzanne_MetallicRoughness.png ├── gamepad.v ├── gestures.v ├── images.v ├── keyboard.v ├── misc.v ├── models.v ├── mouse.v ├── rlgl.v ├── shapes.v ├── storage.v ├── text.v ├── textures.v ├── timing.v ├── tools └── raylib2v.v ├── touch.v ├── v.mod ├── window.v └── z_c_fns.v /.gitignore: -------------------------------------------------------------------------------- 1 | *.tmp.c 2 | examples/core/core_basic_window 3 | examples/core/core_input_keys 4 | examples/core/core_input_mouse 5 | examples/core/core_input_mouse_wheel 6 | examples/core/core_2d_camera 7 | examples/models/models_load 8 | examples/audio/audio_streaming 9 | *~ 10 | fns.txt 11 | tools/raylib2v 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2019 Justin Ryan H. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | V ?= /usr/local/bin/v 2 | RAYLIB_H ?= /v/raylib/src/raylib.h 3 | 4 | EXAMPLES = examples/models/models_load \ 5 | examples/audio/audio_streaming \ 6 | examples/core/core_2d_camera \ 7 | examples/core/core_basic_window \ 8 | examples/core/core_input_keys \ 9 | examples/core/core_input_mouse \ 10 | examples/core/core_input_mouse_wheel 11 | 12 | examples: $(EXAMPLES) 13 | 14 | %: %.v 15 | $(V) -g -keep_c -o $@ $< 16 | 17 | clean: 18 | rm -rf $(EXAMPLES) 19 | 20 | regen: 21 | rm -rf z_c_fns.v 22 | $(V) run tools/raylib2v.v $(RAYLIB_H) > z_c_fns.v 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # V Wrapper for the Raylib C framework, version 2.5.0 2 | 3 | ## Dev Notes 4 | 5 | - Dropped Files and Directory Files are ignored until I get a sensible way to get it to work with `v` 6 | - Ignoring String Manipulation methods in favor for native V string manipulation 7 | -------------------------------------------------------------------------------- /a_c_wrapper.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | #flag linux -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 3 | #include "raylib.h" 4 | 5 | pub struct C.Vector2 { 6 | pub mut: 7 | x f32 8 | y f32 9 | } 10 | 11 | pub struct C.Vector3 { 12 | pub mut: 13 | x f32 14 | y f32 15 | z f32 16 | } 17 | 18 | pub struct C.Vector4 { 19 | pub mut: 20 | x f32 21 | y f32 22 | z f32 23 | w f32 24 | } 25 | type Quaternion C.Vector4 26 | 27 | pub struct C.Matrix { 28 | pub mut: 29 | m0 f32 30 | m1 f32 31 | m2 f32 32 | m3 f32 33 | m4 f32 34 | m5 f32 35 | m6 f32 36 | m7 f32 37 | m8 f32 38 | m9 f32 39 | m10 f32 40 | m11 f32 41 | m12 f32 42 | m13 f32 43 | m14 f32 44 | m15 f32 45 | } 46 | 47 | pub struct C.Image { 48 | pub mut: 49 | data voidptr 50 | width int 51 | height int 52 | mipmaps int 53 | format int 54 | } 55 | 56 | pub struct C.Rectangle { 57 | pub mut: 58 | x f32 59 | y f32 60 | width f32 61 | height f32 62 | } 63 | 64 | pub struct C.Texture2D { 65 | pub mut: 66 | id u32 67 | width int 68 | height int 69 | mipmaps int 70 | format int 71 | } 72 | type Texture Texture2D 73 | type TextureCubemap Texture2D 74 | 75 | pub struct C.RenderTexture2D { 76 | id u32 77 | texture Texture2D 78 | depth Texture2D 79 | depth_texture bool 80 | } 81 | 82 | pub struct C.Color { 83 | pub mut: 84 | r byte 85 | g byte 86 | b byte 87 | a byte 88 | } 89 | 90 | [inline] pub fn (c Color) str() string { 91 | return "Color { r: $c.r, g: $c.g, b: $c.b, a: $c.a }" 92 | } 93 | 94 | pub struct C.CharInfo { 95 | pub mut: 96 | value int 97 | offset_x int 98 | offset_y int 99 | advance_x int 100 | image Image 101 | } 102 | 103 | pub struct C.Font { 104 | pub mut: 105 | base_size int 106 | chars_count int 107 | texture Texture2D 108 | recs &Rectangle 109 | chars &CharInfo 110 | } 111 | 112 | pub struct C.Camera2D { 113 | pub mut: 114 | offset Vector2 115 | target Vector2 116 | rotation f32 117 | zoom f32 118 | } 119 | 120 | pub struct C.Camera3D { 121 | pub mut: 122 | position Vector3 123 | target Vector3 124 | up Vector3 125 | fovy f32 126 | @type int 127 | } 128 | type Camera C.Camera3D 129 | 130 | // Ray type (useful for raycast) 131 | pub struct C.Ray { 132 | position Vector3 133 | direction Vector3 134 | } 135 | 136 | pub struct C.RayHitInfo { 137 | hit bool 138 | distance f32 139 | position Vector3 140 | normal Vector3 141 | } 142 | 143 | pub struct C.BoundingBox { 144 | min Vector3 145 | max Vector3 146 | } 147 | 148 | // N-Patch layout info 149 | pub struct C.NPatchInfo { 150 | source_rec Rectangle 151 | left int 152 | top int 153 | right int 154 | bottom int 155 | @type int 156 | } 157 | 158 | type PRectangle &C.Rectangle 159 | -------------------------------------------------------------------------------- /audio.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // Wave type, defines audio wave data 4 | pub struct C.Wave { 5 | pub mut: 6 | sampleCount u32 7 | sampleRate u32 8 | sampleSize u32 9 | channels u32 10 | data voidptr 11 | } 12 | 13 | // Audio stream type 14 | pub struct C.AudioStream { 15 | pub mut: 16 | sampleRate u32 17 | sampleSize u32 18 | channels u32 19 | buffer &C.rAudioBuffer 20 | } 21 | 22 | pub struct C.Sound { 23 | pub mut: 24 | sampleCount u32 25 | stream AudioStream 26 | } 27 | 28 | pub struct C.Music { 29 | pub mut: 30 | ctxType int 31 | ctxData voidptr 32 | sampleCount u32 33 | loopCount u32 34 | stream AudioStream 35 | } 36 | 37 | // Audio device management functions 38 | // 39 | 40 | // Initialize audio device and context 41 | [inline] pub fn init_audio_device() { 42 | C.InitAudioDevice() 43 | } 44 | 45 | // Close the audio device and context (and music stream) 46 | [inline] pub fn close_audio_device() { 47 | C.CloseAudioDevice() 48 | } 49 | 50 | // Check if audio device is ready 51 | [inline] pub fn is_aduio_device_ready() bool { 52 | return C.IsAudioDeviceReady() 53 | } 54 | 55 | // Set master volume (listener) 56 | [inline] pub fn set_master_volume(volume f32) { 57 | C.SetMasterVolume(volume) 58 | } 59 | 60 | // Wave/Sound loading/unloading functions 61 | // 62 | 63 | 64 | // Load wave data from file 65 | [inline] pub fn load_wave(fileName string) Wave { 66 | return C.LoadWave(fileName.str) 67 | } 68 | 69 | // Load sound from file 70 | [inline] pub fn load_sound(fileName string) Sound { 71 | return C.LoadSound(fileName.str) 72 | } 73 | 74 | // Load sound from wave data 75 | [inline] pub fn load_sound_from_save(wave Wave) Sound { 76 | return C.LoadSoundFromWave(wave) 77 | } 78 | 79 | // Update sound buffer with new data 80 | [inline] pub fn update_sound(sound Sound, data voidptr, samplesCount int) { 81 | C.UpdateSound(sound, data, samplesCount) 82 | } 83 | 84 | // Unload wave data 85 | [inline] pub fn unload_wave(wave Wave) { 86 | C.UnloadWave(wave) 87 | } 88 | 89 | // Unload sound 90 | [inline] pub fn unload_sound(sound Sound) { 91 | C.UnloadSound(sound) 92 | } 93 | 94 | 95 | // Export wave data to file 96 | [inline] pub fn export_wave(wave Wave, fileName string) { 97 | C.ExportWave(wave, fileName.str) 98 | } 99 | 100 | // Export wave sample data to code (.h) 101 | [inline] pub fn export_wave_as_code(wave Wave, fileName string) { 102 | C.ExportWaveAsCode(wave, fileName.str) 103 | } 104 | 105 | 106 | // Wave/Sound management functions 107 | // 108 | 109 | // Play a sound 110 | [inline] pub fn play_sound(sound Sound) { 111 | C.PlaySound(sound) 112 | } 113 | 114 | // Pause a sound 115 | [inline] pub fn pause_sound(sound Sound) { 116 | C.PauseSound(sound) 117 | } 118 | 119 | // Resume a paused sound 120 | [inline] pub fn resume_sound(sound Sound) { 121 | C.ResumeSound(sound) 122 | } 123 | 124 | // Stop playing a sound 125 | [inline] pub fn stop_sound(sound Sound) { 126 | C.StopSound(sound) 127 | } 128 | 129 | // Check if a sound is currently playing 130 | [inline] pub fn is_sound_playing(sound Sound) bool { 131 | return C.IsSoundPlaying(sound) 132 | } 133 | 134 | // Set volume for a sound (1.0 is max level) 135 | [inline] pub fn set_sound_volume(sound Sound, volume f32) { 136 | C.SetSoundVolume(sound, volume) 137 | } 138 | 139 | // Set pitch for a sound (1.0 is base level) 140 | [inline] pub fn set_sound_pitch(sound Sound, pitch f32) { 141 | C.SetSoundPitch(sound, pitch) 142 | } 143 | 144 | // Convert wave data to desired format 145 | [inline] pub fn wave_format(wave &Wave, sampleRate, sampleSize, channels int) { 146 | C.WaveFormat(wave, sampleRate, sampleSize, channels) 147 | } 148 | 149 | // Copy a wave to a new wave 150 | [inline] pub fn wave_copy(wave Wave) Wave { 151 | return C.WaveCopy(wave) 152 | } 153 | 154 | // Crop a wave to defined samples range 155 | [inline] pub fn wave_crop(wave &Wave, initSample int, finalSample int) { 156 | C.WaveCrop(wave, initSample, finalSample) 157 | } 158 | 159 | // Get samples data from wave as a floats array 160 | [inline] pub fn get_wave_data(wave Wave) &f32 { 161 | return C.GetWaveData(wave) 162 | } 163 | 164 | // Music management functions 165 | // 166 | 167 | // Load music stream from file 168 | [inline] pub fn load_music_stream(fileName string) Music { 169 | return C.LoadMusicStream(fileName.str) 170 | } 171 | 172 | // Unload music stream 173 | [inline] pub fn unload_music_stream(music Music) { 174 | C.UnloadMusicStream(music) 175 | } 176 | 177 | // Start music playing 178 | [inline] pub fn play_music_stream(music Music) { 179 | C.PlayMusicStream(music) 180 | } 181 | 182 | // Updates buffers for music streaming 183 | [inline] pub fn update_music_stream(music Music) { 184 | C.UpdateMusicStream(music) 185 | } 186 | 187 | // Stop music playing 188 | [inline] pub fn stop_music_stream(music Music) { 189 | C.StopMusicStream(music) 190 | } 191 | 192 | // Pause music playing 193 | [inline] pub fn pause_music_stream(music Music) { 194 | C.PauseMusicStream(music) 195 | } 196 | 197 | // Resume playing paused music 198 | [inline] pub fn resume_music_stream(music Music) { 199 | C.ResumeMusicStream(music) 200 | } 201 | 202 | // Check if music is playing 203 | [inline] pub fn is_music_playing(music Music) bool { 204 | return C.IsMusicPlaying(music) 205 | } 206 | 207 | // Set volume for music (1.0 is max level) 208 | [inline] pub fn set_music_volume(music Music, volume f32) { 209 | C.SetMusicVolume(music, volume) 210 | } 211 | 212 | // Set pitch for a music (1.0 is base level) 213 | [inline] pub fn set_music_pitch(music Music, pitch f32) { 214 | C.SetMusicPitch(music, pitch) 215 | } 216 | 217 | // Set music loop count (loop repeats) 218 | [inline] pub fn set_music_loop_count(music Music, count int) { 219 | C.SetMusicLoopCount(music, count) 220 | } 221 | 222 | // Get music time length (in seconds) 223 | [inline] pub fn get_music_time_length(music Music) f32 { 224 | return C.GetMusicTimeLength(music) 225 | } 226 | 227 | // Get current music time played (in seconds) 228 | [inline] pub fn get_music_time_played(music Music) f32 { 229 | return C.GetMusicTimePlayed(music) 230 | } 231 | 232 | // AudioStream management functions 233 | // 234 | 235 | // Init audio stream (to stream raw audio pcm data) 236 | [inline] pub fn init_audio_stream(sampleRate, sampleSize, channels u32) AudioStream { 237 | return C.InitAudioStream(sampleRate, sampleSize, channels) 238 | } 239 | 240 | // Update audio stream buffers with data 241 | [inline] pub fn update_audio_stream(stream AudioStream, data voidptr, samplesCount int) { 242 | C.UpdateAudioStream(stream, data, samplesCount) 243 | } 244 | 245 | // Close audio stream and free memory 246 | [inline] pub fn close_audio_stream(stream AudioStream) { 247 | C.CloseAudioStream(stream) 248 | } 249 | 250 | // Check if any audio stream buffers requires refill 251 | // [inline] pub fn is_audio_buffer_processed(stream AudioStream) bool { 252 | // return C.IsAudioStreamProcessed(stream) 253 | // } 254 | 255 | // Play audio stream 256 | [inline] pub fn play_audio_stream(stream AudioStream) { 257 | C.PlayAudioStream(stream) 258 | } 259 | 260 | // Pause audio stream 261 | [inline] pub fn pause_audio_stream(stream AudioStream) { 262 | C.PauseAudioStream(stream) 263 | } 264 | 265 | // Resume audio stream 266 | [inline] pub fn resume_audio_stream(stream AudioStream) { 267 | C.ResumeAudioStream(stream) 268 | } 269 | 270 | // Check if audio stream is playing 271 | [inline] pub fn is_audio_stream_playing(stream AudioStream) bool { 272 | return C.IsAudioStreamPlaying(stream) 273 | } 274 | 275 | // Stop audio stream 276 | [inline] pub fn stop_audio_stream(stream AudioStream) { 277 | C.StopAudioStream(stream) 278 | } 279 | 280 | // Set volume for audio stream (1.0 is max level) 281 | [inline] pub fn set_audio_stream_volume(stream AudioStream, volume f32) { 282 | C.SetAudioStreamVolume(stream, volume) 283 | } 284 | 285 | // Set pitch for audio stream (1.0 is base level) 286 | [inline] pub fn set_audio_stream_pitch(stream AudioStream, pitch f32) { 287 | C.SetAudioStreamPitch(stream, pitch) 288 | } 289 | -------------------------------------------------------------------------------- /camera.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | //------------------------------------------------------------------------------------ 4 | // Camera System Functions (Module: camera) 5 | //------------------------------------------------------------------------------------ 6 | 7 | pub const ( 8 | camera_custom_mode = 0 9 | camera_free_mode = 1 10 | camera_orbital_mode = 2 11 | camera_first_person_mode = 3 12 | camera_third_person_mode = 4 13 | ) 14 | 15 | pub const ( 16 | camera_perspective = 0 17 | camera_orthographic = 1 18 | ) 19 | 20 | // Set camera mode (multiple camera modes available) 21 | [inline] pub fn set_camera_mode(camera Camera3D, mode int) { 22 | C.SetCameraMode(camera, mode) 23 | } 24 | 25 | // Update camera position for selected mode 26 | [inline] pub fn update_camera(camera &Camera3D) { 27 | C.UpdateCamera(camera) 28 | } 29 | 30 | // Set camera pan key to combine with mouse movement (free camera) 31 | [inline] pub fn set_camera_pan_control(panKey int) { 32 | C.SetCameraPanControl(panKey) 33 | } 34 | 35 | // Set camera alt key to combine with mouse movement (free camera) 36 | [inline] pub fn set_camera_alt_control(altKey int) { 37 | C.SetCameraAltControl(altKey) 38 | } 39 | 40 | // Set camera smooth zoom key to combine with mouse (free camera) 41 | [inline] pub fn set_camera_smooth_zoom_control(szKey int) { 42 | C.SetCameraSmoothZoomControl(szKey) 43 | } 44 | 45 | // Set camera move controls (1st person and 3rd person cameras) 46 | [inline] pub fn set_camera_move_controls(frontKey, backKey, rightKey, leftKey, upKey, downKey int) { 47 | C.SetCameraMoveControls(frontKey, backKey, rightKey, leftKey, upKey, downKey) 48 | } 49 | 50 | -------------------------------------------------------------------------------- /colors.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // Color Constants 4 | pub const ( 5 | lightgray = Color{ r: 200, g: 200, b: 200, a: 255 } 6 | gray = Color{ r: 130, g: 130, b: 130, a: 255 } 7 | darkgray = Color{ r: 80, g: 80, b: 80, a: 255 } 8 | yellow = Color{ r: 253, g: 249, b: 0, a: 255 } 9 | gold = Color{ r: 255, g: 203, b: 0, a: 255 } 10 | orange = Color{ r: 255, g: 161, b: 0, a: 255 } 11 | pink = Color{ r: 255, g: 109, b: 194, a: 255 } 12 | red = Color{ r: 230, g: 41, b: 55, a: 255 } 13 | maroon = Color{ r: 190, g: 33, b: 55, a: 255 } 14 | green = Color{ r: 0, g: 228, b: 48, a: 255 } 15 | lime = Color{ r: 0, g: 158, b: 47, a: 255 } 16 | darkgreen = Color{ r: 0, g: 117, b: 44, a: 255 } 17 | skyblue = Color{ r: 102, g: 191, b: 255, a: 255 } 18 | blue = Color{ r: 0, g: 121, b: 241, a: 255 } 19 | darkblue = Color{ r: 0, g: 82, b: 172, a: 255 } 20 | purple = Color{ r: 200, g: 122, b: 255, a: 255 } 21 | violet = Color{ r: 135, g: 60, b: 190, a: 255 } 22 | darkpurple = Color{ r: 112, g: 31, b: 126, a: 255 } 23 | beige = Color{ r: 211, g: 176, b: 131, a: 255 } 24 | brown = Color{ r: 127, g: 106, b: 79, a: 255 } 25 | darkbrown = Color{ r: 76, g: 63, b: 47, a: 255 } 26 | 27 | white = Color{ r: 255, g: 255, b: 255, a: 255 } 28 | black = Color{ r: 0, g: 0, b: 0, a: 255 } 29 | blank = Color{ r: 0, g: 0, b: 0, a: 0 } 30 | magenta = Color{ r: 255, g: 0, b: 255, a: 255 } 31 | raywhite = Color{ r: 245, g: 245, b: 245, a: 255 } 32 | ) 33 | 34 | // Returns hexadecimal value for a Color 35 | [inline] pub fn color_to_int(color Color) int { 36 | return C.ColorToInt(color) 37 | } 38 | 39 | 40 | // Return color normalized as float [0..1] 41 | [inline] pub fn color_normalize(color Color) Vector4 { 42 | return C.ColorNormalize(color) 43 | } 44 | 45 | // Return HSV values for a Color 46 | [inline] pub fn color_to_hsv(color Color) Vector3 { 47 | return C.ColorToHSV(color) 48 | } 49 | 50 | // Return Color from HSV values 51 | [inline] pub fn color_from_hsv(hsv Vector3) Color { 52 | return C.ColorFromHSV(hsv) 53 | } 54 | 55 | // Returns a Color struct from hexadecimal value 56 | [inline] pub fn get_color(hexValue int) Color { 57 | return C.GetColor(hexValue) 58 | } 59 | 60 | // Color fade-in or fade-out, alpha goes from 0.0 to 1.0 61 | [inline] pub fn fade(color Color, alpha f32) Color { 62 | return C.Fade(color, alpha) 63 | } 64 | 65 | 66 | -------------------------------------------------------------------------------- /drawing.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // Drawing-related functions 4 | 5 | [inline] pub fn clear_background(c Color) { 6 | C.ClearBackground(c) 7 | } 8 | 9 | [inline] pub fn begin_drawing() { 10 | C.BeginDrawing() 11 | } 12 | 13 | [inline] pub fn end_drawing() { 14 | C.EndDrawing() 15 | } 16 | 17 | [inline] pub fn begin_mode_2d(camera Camera2D) { 18 | C.BeginMode2D(camera) 19 | } 20 | 21 | [inline] pub fn end_mode_2d() { 22 | C.EndMode2D() 23 | } 24 | 25 | [inline] pub fn begin_mode_3d(camera Camera3D) { 26 | C.BeginMode3D(camera) 27 | } 28 | 29 | [inline] pub fn end_mode_3d() { 30 | C.EndMode3D() 31 | } 32 | 33 | [inline] pub fn begin_texture_mode(target RenderTexture2D) { 34 | C.BeginTextureMode(target) 35 | } 36 | 37 | [inline] pub fn end_texture_mode() { 38 | C.EndTextureMode() 39 | } 40 | 41 | -------------------------------------------------------------------------------- /examples/audio/audio_streaming.v: -------------------------------------------------------------------------------- 1 | module main 2 | 3 | import os 4 | import MajorHard.vraylib 5 | 6 | const ( 7 | screenWidth = 800 8 | screenHeight = 450 9 | maxCircles = 64 10 | ) 11 | 12 | 13 | struct CircleWave { 14 | pub mut: 15 | position Vector2 16 | radius f32 17 | alpha f32 18 | speed f32 19 | color Color 20 | } 21 | 22 | 23 | fn main() { 24 | vraylib.init_window(screenWidth, screenHeight, "vraylib [audio] example - module playing (streaming)") 25 | defer { vraylib.close_window() } 26 | vraylib.init_audio_device() 27 | defer { vraylib.close_audio_device() } 28 | vraylib.set_target_fps(60) 29 | 30 | colors := [ 31 | vraylib.orange, 32 | vraylib.red, 33 | vraylib.gold, 34 | vraylib.lime, 35 | vraylib.blue, 36 | vraylib.violet, 37 | vraylib.brown, 38 | vraylib.lightgray, 39 | vraylib.pink, 40 | vraylib.yellow, 41 | vraylib.green, 42 | vraylib.skyblue, 43 | vraylib.purple, 44 | vraylib.beige 45 | ] 46 | 47 | mut circles := [40]CircleWave 48 | 49 | for i := 0; i <= 40; i++ { 50 | circles[i].alpha = 0.0 51 | circles[i].radius = vraylib.get_random_value(10, 40) 52 | circles[i].position.x = vraylib.get_random_value(int(circles[i].radius), screenWidth - int(circles[i].radius)) 53 | circles[i].position.y = vraylib.get_random_value(int(circles[i].radius), screenHeight - int(circles[i].radius)) 54 | circles[i].speed = f32(vraylib.get_random_value(1, 100))/2000.0 55 | circles[i].color = colors[vraylib.get_random_value(0, 13)] 56 | } 57 | 58 | music := vraylib.load_music_stream(os.resource_abs_path("resources/mini1111.xm")) 59 | defer { vraylib.unload_music_stream(music) } 60 | vraylib.play_music_stream(music) 61 | mut time_played := 0.0 62 | mut pause := false 63 | 64 | for { 65 | if vraylib.window_should_close() { 66 | break 67 | } 68 | vraylib.update_music_stream(music) 69 | if (vraylib.is_key_pressed(vraylib.key_p)) { 70 | pause = !pause 71 | if (pause) { 72 | vraylib.pause_music_stream(music) 73 | } 74 | else { 75 | vraylib.resume_music_stream(music) 76 | } 77 | } 78 | time_played = vraylib.get_music_time_played(music) / vraylib.get_music_time_length(music) * (screenWidth - 40) 79 | for i := 39; i >= 0; i-- { 80 | circles[i].alpha += circles[i].speed 81 | circles[i].radius += circles[i].speed*10.0 82 | 83 | if circles[i].alpha > 1.0 { 84 | circles[i].speed *= -1 85 | } 86 | 87 | if circles[i].alpha <= 0 { 88 | circles[i].alpha = 0.0 89 | circles[i].radius = vraylib.get_random_value(10, 40) 90 | circles[i].position.x = vraylib.get_random_value(int(circles[i].radius), screenWidth - int(circles[i].radius)) 91 | circles[i].position.y = vraylib.get_random_value(int(circles[i].radius), screenHeight - int(circles[i].radius)) 92 | circles[i].speed = f32(vraylib.get_random_value(1, 100))/2000.0 93 | circles[i].color = colors[vraylib.get_random_value(0, 13)] 94 | } 95 | 96 | 97 | } 98 | 99 | 100 | { 101 | vraylib.begin_drawing() 102 | defer { vraylib.end_drawing() } 103 | 104 | for i := 39; i >= 0; i-- { 105 | vraylib.draw_circle_v(circles[i].position, circles[i].radius, vraylib.fade(circles[i].color, circles[i].alpha)) 106 | } 107 | 108 | vraylib.draw_rectangle(20, screenHeight - 20 -12, screenWidth - 40, 12, vraylib.lightgray) 109 | vraylib.draw_rectangle(20, screenHeight - 20 - 12, int(time_played), 12, vraylib.maroon) 110 | vraylib.draw_rectangle_lines(20, screenHeight - 20 - 12, screenWidth - 40, 12, vraylib.gray) 111 | 112 | vraylib.clear_background(vraylib.raywhite) 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /examples/audio/resources/mini1111.xm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MajorHard/vraylib/4ad8fe57bc652c1fac1480043812c00d6f6f9acc/examples/audio/resources/mini1111.xm -------------------------------------------------------------------------------- /examples/core/core_2d_camera.v: -------------------------------------------------------------------------------- 1 | module main 2 | 3 | import MajorHard.vraylib 4 | 5 | const ( 6 | screenWidth = 800 7 | screenHeight = 450 8 | maxBuildings = 100 9 | ) 10 | 11 | 12 | fn main() { 13 | vraylib.init_window(screenWidth, screenHeight, "vraylib [core] example - 2d camera") 14 | defer { vraylib.close_window() } 15 | vraylib.set_target_fps(60) 16 | 17 | mut player := Rectangle{ x: 400, y: 280, width: 40, height: 40 } 18 | mut buildings := []Rectangle 19 | mut building_colors := []Color 20 | 21 | mut spacing := 0 22 | 23 | 24 | for i := 0; i < maxBuildings; i++ { 25 | width := vraylib.get_random_value(50, 200) 26 | height := vraylib.get_random_value(100, 800) 27 | buildings << Rectangle{ 28 | x: -6000 + spacing, 29 | y: screenHeight - 130 - height, 30 | width: width, 31 | height: height 32 | } 33 | building_colors << Color{ 34 | r: vraylib.get_random_value(200, 240), 35 | g: vraylib.get_random_value(200, 240), 36 | b: vraylib.get_random_value(200, 250), 37 | a: 255 38 | } 39 | spacing += width 40 | } 41 | mut camera := Camera2D{ 42 | target: Vector2{ x: player.x + 20, y: player.y + 20 }, 43 | offset: Vector2{ x: screenWidth / 2, y: screenHeight / 2 }, 44 | rotation: 0, 45 | zoom: 1 46 | } 47 | 48 | 49 | for { 50 | if vraylib.window_should_close() { 51 | break 52 | } 53 | 54 | if vraylib.is_key_down(vraylib.key_right) { 55 | player.x += 2 56 | } 57 | else if vraylib.is_key_down(vraylib.key_left) { 58 | player.x -= 2 59 | } 60 | 61 | camera.target = Vector2{ x: player.x + 20, y: player.y + 20 } 62 | 63 | if vraylib.is_key_down(vraylib.key_a) { 64 | camera.rotation-- 65 | } 66 | else if vraylib.is_key_down(vraylib.key_s) { 67 | camera.rotation++ 68 | } 69 | 70 | camera.zoom += f32(vraylib.get_mouse_wheel_move()) * 0.05 71 | 72 | if camera.zoom > 3 { camera.zoom = 3 } 73 | if camera.zoom < 0.1 { camera.zoom = 0.1 } 74 | 75 | if vraylib.is_key_pressed(vraylib.key_r) { 76 | camera.zoom = 1 77 | camera.rotation = 0 78 | } 79 | 80 | 81 | { 82 | vraylib.begin_drawing() 83 | defer { vraylib.end_drawing() } 84 | 85 | vraylib.clear_background(vraylib.raywhite) 86 | { 87 | vraylib.begin_mode_2d(camera) 88 | defer { vraylib.end_mode_2d() } 89 | 90 | for i := 0; i < maxBuildings; i++ { 91 | vraylib.draw_rectangle_rec(buildings[i], building_colors[i]) 92 | i++ 93 | } 94 | vraylib.draw_rectangle(-6000, 320, 13000, 8000, vraylib.darkgray) 95 | vraylib.draw_rectangle_rec(player, vraylib.red) 96 | vraylib.draw_line(int(camera.target.x), -screenHeight*10, int(camera.target.x), screenHeight*10, vraylib.green) 97 | vraylib.draw_line(-screenWidth*10, int(camera.target.y), screenWidth*10, int(camera.target.y), vraylib.green) 98 | } 99 | 100 | vraylib.draw_text("SCREEN AREA", 640, 10, 20, vraylib.red) 101 | vraylib.draw_rectangle(0, 0, screenWidth, 5, vraylib.red) 102 | vraylib.draw_rectangle(0, 5, 5, screenHeight - 10, vraylib.red) 103 | vraylib.draw_rectangle(screenWidth -5, 5, 5, screenHeight - 10, vraylib.red) 104 | vraylib.draw_rectangle(0, screenHeight - 5, screenWidth, 5, vraylib.red) 105 | 106 | vraylib.draw_rectangle(10, 10, 250, 113, vraylib.fade(vraylib.skyblue, 0.5)) 107 | vraylib.draw_rectangle_lines(10, 10, 250, 113, vraylib.blue) 108 | 109 | vraylib.draw_text("Free 2D camera controls:", 20, 20, 10, vraylib.black) 110 | vraylib.draw_text("- Right/Left to move Offset", 40, 40, 10, vraylib.darkgray) 111 | vraylib.draw_text("- Mouse Wheel to Zoom in/out", 20, 60, 10, vraylib.darkgray) 112 | vraylib.draw_text("- A / S to Rotate", 20, 80, 10, vraylib.darkgray) 113 | vraylib.draw_text("- R to reset Zoom and Rotation", 40, 100, 10, vraylib.darkgray) 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /examples/core/core_basic_window.v: -------------------------------------------------------------------------------- 1 | module main 2 | 3 | import MajorHard.vraylib 4 | 5 | const ( 6 | screenWidth = 800 7 | screenHeight = 450 8 | ) 9 | 10 | 11 | fn main() { 12 | vraylib.init_window(screenWidth, screenHeight, "vraylib [core] example - basic window") 13 | defer { vraylib.close_window() } 14 | vraylib.set_target_fps(60) 15 | 16 | for { 17 | if vraylib.window_should_close() { 18 | break 19 | } 20 | { 21 | vraylib.begin_drawing() 22 | defer { vraylib.end_drawing() } 23 | 24 | vraylib.clear_background(vraylib.raywhite) 25 | vraylib.draw_text("Congrats! You created your first window!", 190, 200, 20, vraylib.lightgray) 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /examples/core/core_input_keys.v: -------------------------------------------------------------------------------- 1 | module main 2 | 3 | import MajorHard.vraylib 4 | 5 | const ( 6 | screenWidth = 800 7 | screenHeight = 450 8 | ) 9 | 10 | 11 | fn main() { 12 | vraylib.init_window(screenWidth, screenHeight, "vraylib [core] example - keyboard input") 13 | defer { vraylib.close_window() } 14 | 15 | mut ball_position := Vector2{ x: screenWidth / 2, y: screenHeight / 2 } 16 | 17 | vraylib.set_target_fps(60) 18 | 19 | for { 20 | if vraylib.window_should_close() { 21 | break 22 | } 23 | if (vraylib.is_key_down(vraylib.key_right)) { 24 | ball_position.x += 2 25 | } 26 | if (vraylib.is_key_down(vraylib.key_left)) { 27 | ball_position.x -= 2 28 | } 29 | if (vraylib.is_key_down(vraylib.key_up)) { 30 | ball_position.y -= 2 31 | } 32 | if (vraylib.is_key_down(vraylib.key_down)) { 33 | ball_position.y += 2 34 | } 35 | { 36 | vraylib.begin_drawing() 37 | defer { vraylib.end_drawing() } 38 | 39 | vraylib.clear_background(vraylib.raywhite) 40 | vraylib.draw_text("move the ball with arrow keys", 10, 10, 20, vraylib.darkgray) 41 | vraylib.draw_circle_v(ball_position, 50, vraylib.maroon) 42 | } 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /examples/core/core_input_mouse.v: -------------------------------------------------------------------------------- 1 | module main 2 | 3 | import MajorHard.vraylib 4 | 5 | const ( 6 | screenWidth = 800 7 | screenHeight = 450 8 | ) 9 | 10 | 11 | fn main() { 12 | vraylib.init_window(screenWidth, screenHeight, "vraylib [core] example - mouse input") 13 | defer { vraylib.close_window() } 14 | 15 | mut ball_position := Vector2{ x: -100, y: -100 } 16 | mut ball_color := vraylib.darkblue 17 | 18 | vraylib.set_target_fps(60) 19 | 20 | for { 21 | if vraylib.window_should_close() { 22 | break 23 | } 24 | 25 | ball_position = vraylib.get_mouse_position() 26 | 27 | if (vraylib.is_mouse_button_pressed(vraylib.mouse_left_button)) { 28 | ball_color = vraylib.maroon 29 | } 30 | if (vraylib.is_mouse_button_pressed(vraylib.mouse_middle_button)) { 31 | ball_color = vraylib.lime 32 | } 33 | if (vraylib.is_mouse_button_pressed(vraylib.mouse_right_button)) { 34 | ball_color = vraylib.darkblue 35 | } 36 | 37 | 38 | 39 | { 40 | vraylib.begin_drawing() 41 | defer { vraylib.end_drawing() } 42 | 43 | vraylib.clear_background(vraylib.raywhite) 44 | vraylib.draw_circle_v(ball_position, 50, ball_color) 45 | vraylib.draw_text("move ball with mouse and click mouse button to change color", 10, 10, 20, vraylib.darkgray) 46 | } 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /examples/core/core_input_mouse_wheel.v: -------------------------------------------------------------------------------- 1 | module main 2 | 3 | import MajorHard.vraylib 4 | 5 | const ( 6 | screenWidth = 800 7 | screenHeight = 450 8 | ) 9 | 10 | 11 | fn main() { 12 | vraylib.init_window(screenWidth, screenHeight, "vraylib [core] example - mouse mouse wheel") 13 | defer { vraylib.close_window() } 14 | 15 | mut box_position_y := screenHeight / 2 - 40 16 | scroll_speed := 4 17 | 18 | vraylib.set_target_fps(60) 19 | 20 | for { 21 | if vraylib.window_should_close() { 22 | break 23 | } 24 | box_position_y -= vraylib.get_mouse_wheel_move() * scroll_speed 25 | 26 | 27 | { 28 | vraylib.begin_drawing() 29 | defer { vraylib.end_drawing() } 30 | 31 | vraylib.clear_background(vraylib.raywhite) 32 | vraylib.draw_rectangle(screenWidth / 2 - 40, box_position_y, 80, 80, vraylib.maroon) 33 | 34 | vraylib.draw_text("Use mouse wheel to move cube up and down!", 10, 10, 20, vraylib.gray) 35 | vraylib.draw_text('Box position Y: $box_position_y', 10, 40, 20, vraylib.lightgray) 36 | } 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /examples/models/models_load.v: -------------------------------------------------------------------------------- 1 | module main 2 | 3 | import os 4 | import MajorHard.vraylib 5 | 6 | const ( 7 | screenWidth = 800 8 | screenHeight = 450 9 | ) 10 | 11 | 12 | fn main() { 13 | vraylib.init_window(screenWidth, screenHeight, "vraylib [core] example - basic window") 14 | defer { vraylib.close_window() } 15 | vraylib.set_target_fps(60) 16 | 17 | mut suzanne := vraylib.load_model(os.resource_abs_path("resources/Suzanne.gltf")) 18 | suzanne_albeido := vraylib.load_texture(os.resource_abs_path("resources/Suzanne_BaseColor.png")) 19 | base_materials := suzanne.materials[0].maps[vraylib.diffuse] 20 | suzanne.materials[0].maps[vraylib.diffuse] = MaterialMap{ 21 | texture: suzanne_albeido, 22 | color: base_materials.color, 23 | value: base_materials.value 24 | } 25 | defer { vraylib.unload_model(suzanne) } 26 | defer { vraylib.unload_texture(suzanne_albeido) } 27 | 28 | 29 | camera := Camera3D{ 30 | position: Vector3 { x: 50, y: 50 z: 50 } 31 | target: Vector3{ x: 0, y: 10, z: 0 } 32 | up: Vector3{ x: 0, y: 1, z: 0 } 33 | fovy: 45 34 | @type: vraylib.camera_perspective 35 | } 36 | 37 | vraylib.set_camera_mode(camera, vraylib.camera_free_mode) 38 | 39 | for { 40 | if vraylib.window_should_close() { 41 | break 42 | } 43 | { 44 | vraylib.begin_drawing() 45 | defer { vraylib.end_drawing() } 46 | 47 | vraylib.clear_background(vraylib.raywhite) 48 | { 49 | vraylib.begin_mode_3d(camera) 50 | defer { vraylib.end_mode_3d() } 51 | 52 | vraylib.draw_grid(20, 10) 53 | vraylib.draw_model(suzanne, Vector3{ x: 0, y: 0, z: 0 }, 10, vraylib.lightgray) 54 | } 55 | 56 | vraylib.draw_text("Hello Suzanne", 20, 20, 20, vraylib.lightgray) 57 | } 58 | } 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /examples/models/resources/Suzanne.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MajorHard/vraylib/4ad8fe57bc652c1fac1480043812c00d6f6f9acc/examples/models/resources/Suzanne.bin -------------------------------------------------------------------------------- /examples/models/resources/Suzanne.gltf: -------------------------------------------------------------------------------- 1 | { 2 | "accessors" : [ 3 | { 4 | "bufferView" : 0, 5 | "byteOffset" : 0, 6 | "componentType" : 5123, 7 | "count" : 11808, 8 | "max" : [ 9 | 11807 10 | ], 11 | "min" : [ 12 | 0 13 | ], 14 | "type" : "SCALAR" 15 | }, 16 | { 17 | "bufferView" : 1, 18 | "byteOffset" : 0, 19 | "componentType" : 5126, 20 | "count" : 11808, 21 | "max" : [ 22 | 1.336914, 23 | 0.950195, 24 | 0.825684 25 | ], 26 | "min" : [ 27 | -1.336914, 28 | -0.974609, 29 | -0.800781 30 | ], 31 | "type" : "VEC3" 32 | }, 33 | { 34 | "bufferView" : 2, 35 | "byteOffset" : 0, 36 | "componentType" : 5126, 37 | "count" : 11808, 38 | "max" : [ 39 | 0.996339, 40 | 0.999958, 41 | 0.999929 42 | ], 43 | "min" : [ 44 | -0.996339, 45 | -0.985940, 46 | -0.999994 47 | ], 48 | "type" : "VEC3" 49 | }, 50 | { 51 | "bufferView" : 3, 52 | "byteOffset" : 0, 53 | "componentType" : 5126, 54 | "count" : 11808, 55 | "max" : [ 56 | 0.998570, 57 | 0.999996, 58 | 0.999487, 59 | 1.000000 60 | ], 61 | "min" : [ 62 | -0.999233, 63 | -0.999453, 64 | -0.999812, 65 | 1.000000 66 | ], 67 | "type" : "VEC4" 68 | }, 69 | { 70 | "bufferView" : 4, 71 | "byteOffset" : 0, 72 | "componentType" : 5126, 73 | "count" : 11808, 74 | "max" : [ 75 | 0.999884, 76 | 0.884359 77 | ], 78 | "min" : [ 79 | 0.000116, 80 | 0.000116 81 | ], 82 | "type" : "VEC2" 83 | } 84 | ], 85 | "asset" : { 86 | "generator" : "VKTS glTF 2.0 exporter", 87 | "version" : "2.0" 88 | }, 89 | "bufferViews" : [ 90 | { 91 | "buffer" : 0, 92 | "byteLength" : 23616, 93 | "byteOffset" : 0, 94 | "target" : 34963 95 | }, 96 | { 97 | "buffer" : 0, 98 | "byteLength" : 141696, 99 | "byteOffset" : 23616, 100 | "target" : 34962 101 | }, 102 | { 103 | "buffer" : 0, 104 | "byteLength" : 141696, 105 | "byteOffset" : 165312, 106 | "target" : 34962 107 | }, 108 | { 109 | "buffer" : 0, 110 | "byteLength" : 188928, 111 | "byteOffset" : 307008, 112 | "target" : 34962 113 | }, 114 | { 115 | "buffer" : 0, 116 | "byteLength" : 94464, 117 | "byteOffset" : 495936, 118 | "target" : 34962 119 | } 120 | ], 121 | "buffers" : [ 122 | { 123 | "byteLength" : 590400, 124 | "uri" : "Suzanne.bin" 125 | } 126 | ], 127 | "images" : [ 128 | { 129 | "uri" : "Suzanne_BaseColor.png" 130 | }, 131 | { 132 | "uri" : "Suzanne_MetallicRoughness.png" 133 | } 134 | ], 135 | "materials" : [ 136 | { 137 | "name" : "Suzanne", 138 | "pbrMetallicRoughness" : { 139 | "baseColorTexture" : { 140 | "index" : 0 141 | }, 142 | "metallicRoughnessTexture" : { 143 | "index" : 1 144 | } 145 | } 146 | } 147 | ], 148 | "meshes" : [ 149 | { 150 | "name" : "Suzanne", 151 | "primitives" : [ 152 | { 153 | "attributes" : { 154 | "NORMAL" : 2, 155 | "POSITION" : 1, 156 | "TANGENT" : 3, 157 | "TEXCOORD_0" : 4 158 | }, 159 | "indices" : 0, 160 | "material" : 0, 161 | "mode" : 4 162 | } 163 | ] 164 | } 165 | ], 166 | "nodes" : [ 167 | { 168 | "mesh" : 0, 169 | "name" : "Suzanne" 170 | } 171 | ], 172 | "samplers" : [ 173 | {} 174 | ], 175 | "scene" : 0, 176 | "scenes" : [ 177 | { 178 | "nodes" : [ 179 | 0 180 | ] 181 | } 182 | ], 183 | "textures" : [ 184 | { 185 | "sampler" : 0, 186 | "source" : 0 187 | }, 188 | { 189 | "sampler" : 0, 190 | "source" : 1 191 | } 192 | ] 193 | } 194 | -------------------------------------------------------------------------------- /examples/models/resources/Suzanne_BaseColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MajorHard/vraylib/4ad8fe57bc652c1fac1480043812c00d6f6f9acc/examples/models/resources/Suzanne_BaseColor.png -------------------------------------------------------------------------------- /examples/models/resources/Suzanne_MetallicRoughness.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MajorHard/vraylib/4ad8fe57bc652c1fac1480043812c00d6f6f9acc/examples/models/resources/Suzanne_MetallicRoughness.png -------------------------------------------------------------------------------- /gamepad.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | enum GamepadPlayer { 4 | player1 player2 player3 player4 5 | } 6 | 7 | enum GamepadButton { 8 | unknown 9 | 10 | // This is normally [A,B,X,Y]/[Circle,Triangle,Square,Cross] 11 | // No support for 6 button controllers though.. 12 | left_face_up 13 | left_face_right 14 | left_face_down 15 | left_face_left 16 | 17 | // This is normally a DPAD 18 | right_face_up 19 | right_face_right 20 | right_face_down 21 | right_face_left 22 | 23 | // Triggers 24 | left_trigger_1 25 | left_trigger_2 26 | right_trigger_1 27 | right_trigger_2 28 | 29 | // These are buttons in the center of the gamepad 30 | middle_left //PS3 Select 31 | middle //PS Button/XBOX Button 32 | middle_right //PS3 Start 33 | 34 | // These are the joystick press in buttons 35 | left_thumb 36 | right_thumb 37 | } 38 | 39 | enum GamepadAxis { 40 | // This is here just for error checking 41 | unknown 42 | 43 | // Left stick 44 | left_x 45 | left_y 46 | 47 | // Right stick 48 | right_x 49 | right_y 50 | 51 | // Pressure levels for the back triggers 52 | left_trigger // [1..-1] (pressure-level) 53 | right_trigger // [1..-1] (pressure-level) 54 | } 55 | 56 | 57 | // Input-related functions: gamepads 58 | // 59 | 60 | // Detect if a gamepad is available 61 | [inline] pub fn is_gamepad_available(gamepad int) bool { 62 | return C.IsGamepadAvailable(gamepad) 63 | } 64 | 65 | // Check gamepad name (if available) 66 | [inline] pub fn is_gamepad_name(gamepad int, name string) bool { 67 | return C.IsGamepadName(gamepad, name.str) 68 | } 69 | 70 | // Return gamepad internal name id 71 | [inline] pub fn get_gamepad_name(gamepad int) string { 72 | return string(byteptr(C.GetGamepadName(gamepad))) 73 | } 74 | 75 | // Detect if a gamepad button has been pressed once 76 | [inline] pub fn is_gamepad_button_pressed(gamepad, button int) bool { 77 | return C.IsGamepadButtonPressed(gamepad, button) 78 | } 79 | 80 | // Detect if a gamepad button is being pressed 81 | [inline] pub fn is_gamepad_button_down(gamepad, button int) bool { 82 | return C.IsGamepadButtonDown(gamepad, button) 83 | } 84 | 85 | // Detect if a gamepad button has been released once 86 | [inline] pub fn is_gamepad_button_releaed(gamepad, button int) bool { 87 | return C.IsGamepadButtonReleased(gamepad, button) 88 | } 89 | 90 | // Detect if a gamepad button is NOT being pressed 91 | [inline] pub fn is_gamepad_button_up(gamepad, button int) bool { 92 | return C.IsGamepadButtonUp(gamepad, button) 93 | } 94 | 95 | // Get the last gamepad button pressed 96 | [inline] pub fn get_gamepad_button_pressed() int { 97 | return C.GetGamepadButtonPressed() 98 | } 99 | 100 | // Return gamepad axis count for a gamepad 101 | [inline] pub fn get_gamepad_axis_count(gamepad int) int { 102 | return C.GetGamepadAxisCount(gamepad) 103 | } 104 | 105 | // Return axis movement value for a gamepad axis 106 | [inline] pub fn get_gamepad_axis_movement(gamepad, axis int) f32 { 107 | return C.GetGamepadAxisMovement(gamepad, axis) 108 | } 109 | 110 | -------------------------------------------------------------------------------- /gestures.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | //------------------------------------------------------------------------------------ 4 | // Gestures and Touch Handling Functions (Module: gestures) 5 | //------------------------------------------------------------------------------------ 6 | 7 | // Enable a set of gestures using flags 8 | [inline] pub fn set_gestures_enabled(gestureFlags u32) { 9 | C.SetGesturesEnabled(gestureFlags) 10 | } 11 | 12 | // Check if a gesture have been detected 13 | [inline] pub fn is_gesture_detected(gesture int) bool { 14 | return C.IsGestureDetected(gesture) 15 | } 16 | 17 | // Get latest detected gesture 18 | [inline] pub fn get_gesture_detected() int { 19 | return C.GetGestureDetected() 20 | } 21 | 22 | // Get touch points count 23 | [inline] pub fn get_touch_points_count() int { 24 | return C.GetTouchPointsCount() 25 | } 26 | 27 | // Get gesture hold time in milliseconds 28 | [inline] pub fn get_gesture_hold_duration() f32 { 29 | return C.GetGestureHoldDuration() 30 | } 31 | // Get gesture drag vector 32 | [inline] pub fn get_gesture_drag_vector() Vector2 { 33 | return C.GetGestureDragVector() 34 | } 35 | 36 | // Get gesture drag angle 37 | [inline] pub fn get_desture_drag_angle() f32 { 38 | return C.GetGestureDragAngle() 39 | } 40 | 41 | // Get gesture pinch delta 42 | [inline] pub fn get_gesture_pinch_vector() Vector2 { 43 | return C.GetGesturePinchVector() 44 | } 45 | 46 | // Get gesture pinch angle 47 | [inline] pub fn get_gesture_pinch_angle() f32 { 48 | return C.GetGesturePinchAngle() 49 | } 50 | 51 | -------------------------------------------------------------------------------- /images.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // Image manipulation functions 4 | 5 | // Create an image duplicate (useful for transformations) 6 | [inline] pub fn image_copy(image Image) Image { 7 | return C.ImageCopy(image) 8 | } 9 | 10 | // Convert image to POT (power-of-two) 11 | [inline] pub fn image_to_pot(image &Image, fillColor Color) { 12 | C.ImageToPOT(image, fillColor) 13 | } 14 | 15 | // Convert image data to desired format 16 | [inline] pub fn image_format(image &Image, newFormat int) { 17 | C.ImageFormat(image, newFormat) 18 | } 19 | 20 | // Apply alpha mask to image 21 | [inline] pub fn image_alpha_mask(image &Image, alphaMask Image) { 22 | C.ImageAlphaMask(image, alphaMask) 23 | } 24 | 25 | // Clear alpha channel to desired color 26 | [inline] pub fn image_alpha_clear(image &Image, color Color, threshold f32) { 27 | C.ImageAlphaClear(image, color, threshold) 28 | } 29 | 30 | // Crop image depending on alpha value 31 | [inline] pub fn image_alpha_crop(image &Image, threshold f32) { 32 | C.ImageAlphaCrop(image, threshold) 33 | } 34 | 35 | // Premultiply alpha channe 36 | [inline] pub fn image_alpha_premultiply(image &Image) { 37 | C.ImageAlphaPremultiply(image) 38 | } 39 | 40 | // Crop an image to a defined rectangle 41 | [inline] pub fn image_crop(image &Image, crop Rectangle) { 42 | C.ImageCrop(image, crop) 43 | } 44 | 45 | // Resize image (Bicubic scaling algorithm) 46 | [inline] pub fn image_resize(image &Image, newWidth, newHeight int) { 47 | C.ImageResize(image, newWidth, newHeight) 48 | } 49 | 50 | // Resize image (Nearest-Neighbor scaling algorithm) 51 | [inline] pub fn image_resize_nn(image &Image, newWidth, newHeight int) { 52 | C.ImageResizeNN(image, newWidth, newHeight) 53 | } 54 | 55 | // Resize canvas and fill with color 56 | [inline] pub fn image_resize_canvas(image &Image, newWidth, newHeight, offsetX, offsetY int, color Color) { 57 | C.ImageResizeCanvas(image, newWidth, newHeight, offsetX, offsetY, color) 58 | } 59 | 60 | // Generate all mipmap levels for a provided image 61 | [inline] pub fn image_mipmaps(image &Image) { 62 | C.ImageMipmaps(image) 63 | } 64 | 65 | // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) 66 | [inline] pub fn image_dither(image &Image, rBpp, gBpp, bBpp, aBpp int) { 67 | C.ImageDither(image, rBpp, gBpp, bBpp, aBpp) 68 | } 69 | 70 | // Extract color palette from image to maximum size (memory should be freed) 71 | [inline] pub fn image_extract_palette(image Image, maxPaletteSize, extractCount &int) &Color { 72 | return C.ImageExtractPalette(image, *maxPaletteSize, extractCount) 73 | } 74 | 75 | // Create an image from text (default font) 76 | [inline] pub fn image_text(text string, fontSize int, color Color) Image { 77 | return C.ImageText(text.str, fontSize, color) 78 | } 79 | 80 | // Create an image from text (custom sprite font) 81 | [inline] pub fn image_text_ex(font Font, text string, fontSize, spacing f32, tint Color) Image { 82 | return C.ImageTextEx(font, text.str, fontSize, spacing, tint) 83 | } 84 | 85 | // TODO: Potential TCC bug 86 | // Draw a source image within a destination image 87 | // [inline] pub fn image_draw(dst &Image, src Image, srcRec, dstRec Rectangle) { 88 | // C.ImageDraw(dst, src, srcRec, dstRec) 89 | // } 90 | 91 | // Draw rectangle within an image 92 | [inline] pub fn image_draw_rectangle(dst &Image, rec Rectangle, color Color) { 93 | C.ImageDrawRectangle(dst, rec, color) 94 | } 95 | 96 | // Draw rectangle lines within an image 97 | [inline] pub fn image_draw_rectangle_lines(dst &Image, rec Rectangle, thick int, color Color) { 98 | C.ImageDrawRectangleLines(dst, rec, thick, color) 99 | } 100 | 101 | // Draw text (default font) within an image (destination) 102 | [inline] pub fn image_draw_text(dst &Image, position Vector2, text string, fontSize int, color Color) { 103 | C.ImageDrawText(dst, position, text.str, fontSize, color) 104 | } 105 | 106 | // Draw text (custom sprite font) within an image (destination) 107 | [inline] pub fn image_draw_text_ex(dst &Image, position Vector2, font Font, text string, fontSize, spacing f32, color Color) { 108 | C.ImageDrawTextEx(dst, position, font, text.str, fontSize, spacing, color) 109 | } 110 | 111 | // Flip image vertically 112 | [inline] pub fn image_flip_vertical(image &Image) { 113 | C.ImageFlipVertical(image) 114 | } 115 | 116 | // Flip image horizontally 117 | [inline] pub fn image_flip_horizontal(image &Image) { 118 | C.ImageFlipHorizontal(image) 119 | } 120 | 121 | // Rotate image clockwise 90deg 122 | [inline] pub fn image_rotate_cw(image &Image) { 123 | C.ImageRotateCW(image) 124 | } 125 | 126 | // Rotate image counter-clockwise 90deg 127 | [inline] pub fn image_rotate_ccw(image &Image) { 128 | C.ImageRotateCCW(image) 129 | } 130 | 131 | // Modify image color: tint 132 | [inline] pub fn image_color_tint(image &Image, color Color) { 133 | C.ImageColorTint(image, color) 134 | } 135 | 136 | // Modify image color: invert 137 | [inline] pub fn image_color_invert(image &Image) { 138 | C.ImageColorInvert(image) 139 | } 140 | 141 | // Modify image color: grayscale 142 | [inline] pub fn image_color_grayscale(image &Image) { 143 | C.ImageColorGrayscale(image) 144 | } 145 | 146 | // Modify image color: contrast (-100 to 100) 147 | [inline] pub fn image_color_contrast(image &Image, contrast f32) { 148 | C.ImageColorContrast(image, contrast) 149 | } 150 | 151 | // Modify image color: brightness (-255 to 255) 152 | [inline] pub fn image_color_brightness(image &Image, brightness int) { 153 | C.ImageColorBrightness(image, brightness) 154 | } 155 | 156 | // Modify image color: replace color 157 | [inline] pub fn image_color_replace(image &Image, color, replace Color) { 158 | C.ImageColorReplace(image, color, replace) 159 | } 160 | 161 | // // Image generation functions 162 | // 163 | 164 | // Generate image: plain color 165 | [inline] pub fn gen_image_color(width, height int, color Color) Image { 166 | return C.GenImageColor(width, height, color) 167 | } 168 | 169 | // Generate image: vertical gradient 170 | [inline] pub fn gen_image_gradient_v(width, height int, top, bottom Color) Image { 171 | return C.GenImageGradientV(width, height, top, bottom) 172 | } 173 | 174 | // Generate image: horizontal gradient 175 | [inline] pub fn get_image_gradient_h(width, height int, left, right Color) Image { 176 | return C.GenImageGradientH(width, height, left, right) 177 | } 178 | 179 | // Generate image: radial gradient 180 | [inline] pub fn get_image_gradient_radial(width, height int, density f32, inner, outer Color) Image { 181 | return C.GenImageGradientRadial(width, height, density, inner, outer) 182 | } 183 | 184 | // Generate image: checked 185 | [inline] pub fn get_image_checked(width, height, checksX, checksY int, color1, color2 Color) Image { 186 | return C.GenImageChecked(width, height, checksX, checksY, color1, color2) 187 | } 188 | 189 | // Generate image: white noise 190 | [inline] pub fn gen_image_white_noise(width, height int, factor f32) Image { 191 | return C.GenImageWhiteNoise(width, height, factor) 192 | } 193 | 194 | // Generate image: perlin noise 195 | [inline] pub fn gen_image_perlin_noise(width, height, offsetX, offsetY, scale f32) Image { 196 | return C.GenImagePerlinNoise(width, height, offsetX, offsetY, scale) 197 | } 198 | 199 | // Generate image: cellular algorithm. Bigger tileSize means bigger cells 200 | [inline] pub fn gen_image_cellular(width, height, tileSize int) Image { 201 | return C.GenImageCellular(width, height, tileSize) 202 | } 203 | -------------------------------------------------------------------------------- /keyboard.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // Input-related functions: key 4 | 5 | // Key Constants 6 | pub const( 7 | key_apostrophe = 39 8 | key_comma = 44 9 | key_minus = 45 10 | key_period = 46 11 | key_slash = 47 12 | key_zero = 48 13 | key_one = 49 14 | key_two = 50 15 | key_three = 51 16 | key_four = 52 17 | key_five = 53 18 | key_six = 54 19 | key_seven = 55 20 | key_eight = 56 21 | key_nine = 57 22 | key_semicolon = 59 23 | key_equal = 61 24 | key_a = 65 25 | key_b = 66 26 | key_c = 67 27 | key_d = 68 28 | key_e = 69 29 | key_f = 70 30 | key_g = 71 31 | key_h = 72 32 | key_i = 73 33 | key_j = 74 34 | key_k = 75 35 | key_l = 76 36 | key_m = 77 37 | key_n = 78 38 | key_o = 79 39 | key_p = 80 40 | key_q = 81 41 | key_r = 82 42 | key_s = 83 43 | key_t = 84 44 | key_u = 85 45 | key_v = 86 46 | key_w = 87 47 | key_x = 88 48 | key_y = 89 49 | key_z = 90 50 | 51 | // Function keys 52 | key_space = 32 53 | key_escape = 256 54 | key_enter = 257 55 | key_tab = 258 56 | key_backspace = 259 57 | key_insert = 260 58 | key_delete = 261 59 | key_right = 262 60 | key_left = 263 61 | key_down = 264 62 | key_up = 265 63 | key_page_up = 266 64 | key_page_down = 267 65 | key_home = 268 66 | key_end = 269 67 | key_caps_lock = 280 68 | key_scroll_lock = 281 69 | key_num_lock = 282 70 | key_print_screen = 283 71 | key_pause = 284 72 | key_f1 = 290 73 | key_f2 = 291 74 | key_f3 = 292 75 | key_f4 = 293 76 | key_f5 = 294 77 | key_f6 = 295 78 | key_f7 = 296 79 | key_f8 = 297 80 | key_f9 = 298 81 | key_f10 = 299 82 | key_f11 = 300 83 | key_f12 = 301 84 | key_left_shift = 340 85 | key_left_control = 341 86 | key_left_alt = 342 87 | key_left_super = 343 88 | key_right_shift = 344 89 | key_right_control = 345 90 | key_right_alt = 346 91 | key_right_super = 347 92 | key_kb_menu = 348 93 | key_left_bracket = 91 94 | key_backslash = 92 95 | key_right_bracket = 93 96 | key_grave = 96 97 | 98 | // Keypad keys 99 | key_kp_0 = 320 100 | key_kp_1 = 321 101 | key_kp_2 = 322 102 | key_kp_3 = 323 103 | key_kp_4 = 324 104 | key_kp_5 = 325 105 | key_kp_6 = 326 106 | key_kp_7 = 327 107 | key_kp_8 = 328 108 | key_kp_9 = 329 109 | key_kp_decimal = 330 110 | key_kp_divide = 331 111 | key_kp_multiply = 332 112 | key_kp_subtract = 333 113 | key_kp_add = 334 114 | key_kp_enter = 335 115 | key_kp_equal = 336 116 | 117 | // Android Button 118 | key_back = 4 119 | key_menu = 82 120 | key_volume_up = 24 121 | key_volume_down = 25 122 | ) 123 | 124 | [inline] pub fn is_key_down(key int) bool { 125 | return C.IsKeyDown(key) 126 | } 127 | 128 | [inline] pub fn is_key_pressed(key int) bool { 129 | return C.IsKeyPressed(key) 130 | } 131 | 132 | [inline] pub fn is_key_released(key int) bool { 133 | return C.IsKeyReleased(key) 134 | } 135 | 136 | [inline] pub fn is_key_up(key int) bool { 137 | return C.IsKeyUp(key) 138 | } 139 | 140 | [inline] pub fn get_key_pressed() int { 141 | return C.GetKeyPressed() 142 | } 143 | 144 | [inline] pub fn set_exit_key(key int) { 145 | C.SetExitKey(key) 146 | } 147 | 148 | -------------------------------------------------------------------------------- /misc.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // Screen-space-related functions 4 | 5 | // Returns a ray trace from mouse position 6 | [inline] pub fn get_mouse_ray(mousePosition Vector2, camera Camera3D) Ray { 7 | return C.GetMouseRay(mousePosition, camera) 8 | } 9 | // Returns the screen space position for a 3d world space position 10 | [inline] pub fn get_world_to_screen(position Vector3, camera Camera3D) Vector2 { 11 | return C.GetWorldToScreen(position, camera) 12 | } 13 | // Returns camera transform matrix (view matrix) 14 | [inline] pub fn get_camera_matrix(camera Camera3D) Matrix { 15 | return C.GetCameraMatrix(camera) 16 | } 17 | 18 | 19 | // Misc. functions 20 | [inline] pub fn set_config_flags(flags u32) { 21 | C.SetConfigFlags(flags) 22 | } 23 | 24 | [inline] pub fn set_trace_log_level(logType int) { 25 | C.SetTraceLogLevel(logType) 26 | } 27 | 28 | [inline] pub fn set_trace_log_exit(logType int) { 29 | C.SetTraceLogExit(logType) 30 | } 31 | 32 | [inline] pub fn trace_log(logType int, text string) { 33 | C.TraceLog(logType, text.str) 34 | } 35 | 36 | [inline] pub fn take_screenshot(filename string) { 37 | C.TakeScreenshot(filename.str) 38 | } 39 | 40 | [inline] pub fn get_random_value(min, max int) int { 41 | return C.GetRandomValue(min, max) 42 | } 43 | 44 | // Files management functions 45 | 46 | // Check if file exists 47 | [inline] pub fn file_exists(fileName string) bool { 48 | return C.FileExists(fileName.str) 49 | } 50 | 51 | // Check file extension 52 | [inline] pub fn is_file_extension(fileName string, ext string) bool { 53 | return C.IsFileExtension(fileName.str, ext.str) 54 | } 55 | 56 | // Get filename extension 57 | [inline] pub fn get_extension(fileName string) string { 58 | return string(byteptr(C.GetExtension(fileName.str))) 59 | } 60 | 61 | // Get filename 62 | [inline] pub fn get_file_name(fileName string) string { 63 | return string(byteptr(C.GetFileName(fileName.str))) 64 | } 65 | 66 | // Get full path of directory of filename 67 | [inline] pub fn get_directory_path(fileName string) string { 68 | return string(byteptr(C.GetDirectoryPath(fileName.str))) 69 | } 70 | 71 | // Get current working directory 72 | [inline] pub fn get_working_directory() string { 73 | return string(byteptr(C.GetWorkingDirectory())) 74 | } 75 | 76 | // Change working directory, returns true if success 77 | [inline] pub fn change_directory(dir string) bool { 78 | return C.ChangeDirectory(dir.str) 79 | } 80 | 81 | // Get file modification time (last write time) 82 | [inline] pub fn get_file_mod_time(fileName string) i64 { 83 | return C.GetFileModTime(fileName.str) 84 | } 85 | 86 | 87 | -------------------------------------------------------------------------------- /models.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // Vertex data definning a mesh 4 | // NOTE: Data stored in CPU memory (and GPU) 5 | pub struct C.Mesh { 6 | pub mut: 7 | vertexCount int 8 | triangleCount int 9 | 10 | vertices &f32 11 | texcoords &f32 12 | texcoords2 &f32 13 | normals &f32 14 | tangents &f32 15 | colors &byte 16 | indices &u16 17 | 18 | animVertices &f32 19 | animNormals &f32 20 | boneIds &f32 21 | boneWeights &f32 22 | 23 | vaoId u32 24 | vboId &u32 25 | } 26 | 27 | // Shader type (generic) 28 | // Material texture map 29 | pub struct C.MaterialMap { 30 | pub mut: 31 | texture Texture2D 32 | color Color 33 | value f32 34 | } 35 | 36 | // Material type (generic) 37 | pub struct C.Material { 38 | pub mut: 39 | shader Shader 40 | maps &MaterialMap 41 | params &f32 42 | } 43 | 44 | // Transformation properties 45 | pub struct C.Transform { 46 | pub mut: 47 | translation Vector3 48 | rotation Quaternion 49 | scale Vector3 50 | } 51 | 52 | // Bone information 53 | pub struct C.BoneInfo { 54 | pub mut: 55 | name[32] byte 56 | parent int 57 | } 58 | type BoneInfo C.BoneInfo 59 | 60 | // Model type 61 | pub struct C.Model { 62 | pub mut: 63 | transform Matrix 64 | meshCount int 65 | meshes &Mesh 66 | 67 | materialCount int 68 | materials &Material 69 | meshMaterial &int 70 | 71 | boneCount int 72 | bones &BoneInfo 73 | bindPose &Transform 74 | } 75 | 76 | // Model Animation 77 | pub struct C.ModelAnimation { 78 | pub mut: 79 | boneCount int 80 | bones &BoneInfo 81 | 82 | fameCount int 83 | framePoses &Transform 84 | } 85 | 86 | // Basic geometric 3D shapes drawing functions 87 | // 88 | 89 | // Draw a line in 3D world space 90 | [inline] pub fn draw_line_3d(startPos, endPos Vector3, color Color) { 91 | C.DrawLine3D(startPos, endPos, color) 92 | } 93 | 94 | // Draw a circle in 3D world space 95 | [inline] pub fn draw_circle_3d(center Vector3, radius f32, rotationAxis Vector3, rotationAngle f32, color Color) { 96 | C.DrawCircle3D(center, radius, rotationAxis, rotationAngle, color) 97 | } 98 | 99 | // Draw cube 100 | [inline] pub fn draw_cube(position Vector3, width, height, length f32, color Color) { 101 | C.DrawCube(position, width, height, length, color) 102 | } 103 | 104 | // Draw cube (Vector version) 105 | [inline] pub fn draw_cube_v(position, size Vector3, color Color) { 106 | // void DrawCubeV(Vector3 position, Vector3 size, Color color); 107 | } 108 | 109 | // Draw cube wires 110 | [inline] pub fn draw_cube_wires(position Vector3, width, height, length f32, color Color) { 111 | // void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); 112 | } 113 | 114 | // Draw cube wires (Vector version) 115 | [inline] pub fn draw_cube_wires_v(position, size Vector3, color Color) { 116 | // void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); 117 | } 118 | 119 | // Draw cube textured 120 | [inline] pub fn draw_cube_texture(texture Texture2D, position Vector3, width, height, length f32, color Color) { 121 | C.DrawCubeTexture(texture, position, width, height, length, color) 122 | } 123 | 124 | // Draw sphere 125 | [inline] pub fn draw_sphere(centerPos Vector3, radius f32, color Color) { 126 | C.DrawSphere(centerPos, radius, color) 127 | } 128 | 129 | // Draw sphere with extended parameters 130 | [inline] pub fn draw_sphere_ex(centerPos Vector3, radius f32, rings, slices int, color Color) { 131 | C.DrawSphereEx(centerPos, radius, rings, slices, color) 132 | } 133 | 134 | // Draw sphere wires 135 | [inline] pub fn draw_sphere_wires(centerPos Vector3, radius f32, rings, slices int, color Color) { 136 | C.DrawSphereWires(centerPos, radius, rings, slices, color) 137 | } 138 | 139 | // Draw a cylinder/cone 140 | [inline] pub fn draw_cylinder(position Vector3, radiusTop, radiusBottom, height f32, slices int, color Color) { 141 | C.DrawCylinder(position, radiusTop, radiusBottom, height, slices, color) 142 | } 143 | 144 | // Draw a cylinder/cone wires 145 | [inline] pub fn draw_cylinder_wires(position Vector3, radiusTop, radiusBottom, height f32, slices int, color Color) { 146 | C.DrawCylinderWires(position, radiusTop, radiusBottom, height, slices, color) 147 | } 148 | 149 | // Draw a plane XZ 150 | [inline] pub fn draw_plane(centerPos Vector3, size Vector2, color Color) { 151 | C.DrawPlane(centerPos, size, color) 152 | } 153 | 154 | // Draw a ray line 155 | [inline] pub fn draw_ray(ray Ray, color Color) { 156 | C.DrawRay(ray, color) 157 | } 158 | 159 | // Draw a grid (centered at (0, 0, 0)) 160 | [inline] pub fn draw_grid(slices int, spacing f32) { 161 | C.DrawGrid(slices, spacing) 162 | } 163 | 164 | // Draw simple gizmo 165 | [inline] pub fn draw_gizmo(position Vector3) { 166 | C.DrawGizmo(position) 167 | } 168 | 169 | // Model loading/unloading functions 170 | 171 | // Load model from files (meshes and materials) 172 | [inline] pub fn load_model(fileName string) Model { 173 | return C.LoadModel(fileName.str) 174 | } 175 | 176 | // Load model from generated mesh (default material) 177 | [inline] pub fn load_model_from_mesh(mesh Mesh) Model { 178 | return C.LoadModelFromMesh(mesh) 179 | } 180 | // Unload model from memory (RAM and/or VRAM) 181 | [inline] pub fn unload_model(model Model) { 182 | C.UnloadModel(model) 183 | } 184 | 185 | // // Mesh loading/unloading functions 186 | // 187 | 188 | // Load meshes from model file 189 | [inline] pub fn load_meshes(fileName string, meshCount &int) &Mesh { 190 | return C.LoadMeshes(fileName.str, meshCount) 191 | } 192 | 193 | // Export mesh data to file 194 | [inline] pub fn export_mesh(mesh Mesh, fileName string) { 195 | C.ExportMesh(mesh, fileName.str) 196 | } 197 | 198 | // Unload mesh from memory (RAM and/or VRAM) 199 | [inline] pub fn unload_mesh(mesh Mesh) { 200 | C.UnloadMesh(mesh) 201 | } 202 | 203 | 204 | // Material loading/unloading functions 205 | // 206 | 207 | // Load materials from model file 208 | [inline] pub fn load_materials(fileName string, materialCount &int) &Material { 209 | return C.LoadMaterials(fileName.str, materialCount) 210 | } 211 | 212 | // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) 213 | [inline] pub fn load_material_default() Material { 214 | return C.LoadMaterialDefault() 215 | } 216 | 217 | // Unload material from GPU memory (VRAM) 218 | [inline] pub fn unload_material(material Material) { 219 | C.UnloadMaterial(material) 220 | } 221 | 222 | // Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) 223 | [inline] pub fn set_material_texture(material &Material, mapType int, texture Texture2D) { 224 | C.SetMaterialTexture(material, mapType, texture) 225 | } 226 | 227 | // Set material for a mesh 228 | [inline] pub fn set_model_mesh_material(model &Model, meshId, materialId int) { 229 | C.SetModelMeshMaterial(model, meshId, materialId) 230 | } 231 | 232 | 233 | // Model animations loading/unloading functions 234 | // 235 | 236 | // Load model animations from file 237 | [inline] pub fn load_model_animations(fileName string, animsCount &int) &ModelAnimation { 238 | return C.LoadModelAnimations(fileName.str, animsCount) 239 | } 240 | 241 | // Update model animation pose 242 | [inline] pub fn update_model_animation(model Model, anim ModelAnimation, frame int) { 243 | C.UpdateModelAnimation(model, anim, frame) 244 | } 245 | 246 | // Unload animation data 247 | [inline] pub fn unload_model_animation(anim ModelAnimation) { 248 | C.UnloadModelAnimation(anim) 249 | } 250 | 251 | // Check model animation skeleton match 252 | [inline] pub fn is_model_animation_valid(model Model, anim ModelAnimation) bool { 253 | return C.IsModelAnimationValid(model, anim) 254 | } 255 | 256 | 257 | // Mesh generation functions 258 | // 259 | 260 | // Generate polygonal mesh 261 | [inline] pub fn gen_mesh_poly(sides int, radius f32) { 262 | C.GenMeshPoly(sides, radius) 263 | } 264 | 265 | // Generate plane mesh (with subdivisions) 266 | [inline] pub fn gen_mesh_plane(width, length, f32, resX, resZ int) Mesh { 267 | return C.GenMeshPlane(width, length, resX, resZ) 268 | } 269 | 270 | // Generate cuboid mesh 271 | [inline] pub fn gen_mesh_cube(width, height, length f32) Mesh { 272 | return C.GenMeshCube(width, height, length) 273 | } 274 | 275 | // Generate sphere mesh (standard sphere) 276 | [inline] pub fn gen_mesh_sphere(radius f32, rings, slices int) Mesh { 277 | return C.GenMeshSphere(radius, rings, slices) 278 | } 279 | 280 | // Generate half-sphere mesh (no bottom cap) 281 | [inline] pub fn gen_mesh_hemi_sphere(radius f32, rings, slices int) Mesh { 282 | return C.GenMeshHemiSphere(radius, rings, slices) 283 | } 284 | 285 | // Generate cylinder mesh 286 | [inline] pub fn gen_mesh_cylinder(radius, height f32, slices int) Mesh { 287 | return C.GenMeshCylinder(radius, height, slices) 288 | } 289 | 290 | // Generate torus mesh 291 | [inline] pub fn gen_mesh_torus(radius, size f32, radSeg, sides int) Mesh { 292 | return C.GenMeshTorus(radius, size, radSeg, sides) 293 | } 294 | 295 | // Generate trefoil knot mesh 296 | [inline] pub fn gen_mesh_knot(radius, size f32, radSeg, sides int) Mesh { 297 | return C.GenMeshKnot(radius, size, radSeg, sides) 298 | } 299 | 300 | // Generate heightmap mesh from image data 301 | [inline] pub fn gen_mesh_height_map(heightmap Image, size Vector3) Mesh { 302 | return C.GenMeshHeightmap(heightmap, size) 303 | } 304 | 305 | // Generate cubes-based map mesh from image data 306 | [inline] pub fn gen_mesh_cubicmap(cubicmap Image, cubeSize Vector3) Mesh { 307 | return C.GenMeshCubicmap(cubicmap, cubeSize) 308 | } 309 | 310 | 311 | // Mesh manipulation functions 312 | // 313 | 314 | // Compute mesh bounding box limits 315 | [inline] pub fn mesh_bounding_box(mesh Mesh) BoundingBox { 316 | return C.MeshBoundingBox(mesh) 317 | } 318 | 319 | // Compute mesh tangents 320 | [inline] pub fn mesh_tangents(mesh &Mesh) { 321 | C.MeshTangents(mesh) 322 | } 323 | 324 | // Compute mesh binormals 325 | [inline] pub fn mesh_binormals(mesh &Mesh) { 326 | C.MeshBinormals(mesh) 327 | } 328 | 329 | // Model drawing functions 330 | [inline] pub fn draw_model(model Model, position Vector3, scale f32, tint Color) { 331 | C.DrawModel(model, position, scale, tint) 332 | } 333 | 334 | // Draw a model with extended parameters 335 | [inline] pub fn draw_model_ex(model Model, position, rotationAxis Vector3, rotationAngle f32, scale Vector3, tint Color) { 336 | C.DrawModelEx(model, position, rotationAxis, rotationAngle, scale, tint) 337 | } 338 | 339 | // Draw a model wires (with texture if set) 340 | [inline] pub fn draw_model_wires(model Model, position Vector3, scale f32, tint Color) { 341 | C.DrawModelWires(model, position, scale, tint) 342 | } 343 | 344 | // Draw a model wires (with texture if set) with extended parameters 345 | [inline] pub fn draw_model_wires_ex(model Model, position, rotationAxis Vector3, rotationAngle f32, scale Vector3, tint Color) { 346 | C.DrawModelWiresEx(model, position, rotationAxis, rotationAngle, scale, tint) 347 | } 348 | 349 | // Draw bounding box (wires) 350 | [inline] pub fn draw_bounding_box(box BoundingBox, color Color) { 351 | C.DrawBoundingBox(box, color) 352 | } 353 | 354 | // Draw a billboard texture 355 | [inline] pub fn draw_billboard(camera Camera3D, texture Texture2D, center Vector3, size f32, tint Color) { 356 | C.DrawBillboard(camera, texture, center, size, tint) 357 | } 358 | 359 | // Draw a billboard texture defined by sourceRec 360 | [inline] pub fn draw_billboard_rec(camera Camera3D, texture Texture2D, sourceRec Rectangle, center Vector3, size f32, tint Color) { 361 | C.DrawBillboardRec(camera, texture, sourceRec, center, size, tint) 362 | } 363 | 364 | // Collision detection functions 365 | // 366 | 367 | // Detect collision between two spheres 368 | [inline] pub fn check_collision_spheres(centerA Vector3, radiusA f32, centerB Vector3, radiusB f32) bool { 369 | return C.CheckCollisionSpheres(centerA, radiusA, centerB, radiusB) 370 | } 371 | 372 | // Detect collision between two bounding boxes 373 | [inline] pub fn check_collision_boxes(box1, box2 BoundingBox) bool { 374 | return C.CheckCollisionBoxes(box1, box2) 375 | } 376 | 377 | // Detect collision between box and sphere 378 | [inline] pub fn check_collision_box_sphere(box BoundingBox, centerSphere Vector3, radiusSphere f32) bool { 379 | return C.CheckCollisionBoxSphere(box, centerSphere, radiusSphere) 380 | } 381 | 382 | // Detect collision between ray and sphere 383 | [inline] pub fn check_collision_ray_sphere(ray Ray, spherePosition Vector3, sphereRadius f32) bool { 384 | return C.CheckCollisionRaySphere(ray, spherePosition, sphereRadius) 385 | } 386 | 387 | // Detect collision between ray and sphere, returns collision point 388 | [inline] pub fn check_collision_ray_sphere_ex(ray Ray, spherePosition Vector3, sphereRadius f32, collisionPoint &Vector3) bool { 389 | return C.CheckCollisionRaySphereEx(ray, spherePosition, sphereRadius, collisionPoint) 390 | } 391 | 392 | // Detect collision between ray and box 393 | [inline] pub fn check_collision_ray_box(ray Ray, box BoundingBox) bool { 394 | return C.CheckCollisionRayBox(ray, box) 395 | } 396 | 397 | // Get collision info between ray and model 398 | [inline] pub fn get_collision_ray_model(ray Ray, model Model) RayHitInfo { 399 | return C.GetCollisionRayModel(ray, model) 400 | } 401 | 402 | // Get collision info between ray and triangle 403 | [inline] pub fn get_collision_ray_triangle(ray Ray, p1, p2, p3 Vector3) RayHitInfo { 404 | return C.GetCollisionRayTriangle(ray, p1, p2, p3) 405 | } 406 | 407 | // Get collision info between ray and ground plane (Y-normal plane) 408 | [inline] pub fn get_collision_ray_ground(ray Ray, groundHeight f32) RayHitInfo { 409 | return C.GetCollisionRayGround(ray, groundHeight) 410 | } 411 | -------------------------------------------------------------------------------- /mouse.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // Input-related functions: mouse 4 | 5 | pub const ( 6 | mouse_left_button = 0 7 | mouse_right_button = 1 8 | mouse_middle_button = 2 9 | ) 10 | 11 | [inline] pub fn is_mouse_button_pressed(button int) bool { 12 | return C.IsMouseButtonPressed(button) 13 | } 14 | 15 | [inline] pub fn is_mouse_button_down(button int) bool { 16 | return C.IsMouseButtonDown(button) 17 | } 18 | 19 | [inline] pub fn is_mouse_button_released(button int) bool { 20 | return C.IsMouseButtonReleased(button) 21 | } 22 | 23 | [inline] pub fn is_mouse_button_up(button int) bool { 24 | return C.IsMouseButtonUp(button) 25 | } 26 | 27 | 28 | [inline] pub fn get_mouse_x() int { 29 | return C.GetMouseX() 30 | } 31 | 32 | [inline] pub fn get_mouse_y() int { 33 | return C.GetMouseY() 34 | } 35 | 36 | [inline] pub fn get_mouse_position() Vector2 { 37 | return C.GetMousePosition() 38 | } 39 | 40 | [inline] pub fn set_mouse_position(x, y int) { 41 | C.SetMousePosition(x, y) 42 | } 43 | 44 | [inline] pub fn set_mouse_offset(offsetX, offsetY int) { 45 | C.SetMouseOffset(offsetX, offsetY) 46 | } 47 | 48 | [inline] pub fn set_mouse_scale(scaleX, scaleY f32) { 49 | C.SetMouseScale(scaleX, scaleY) 50 | } 51 | 52 | [inline] pub fn get_mouse_wheel_move() int { 53 | return C.GetMouseWheelMove() 54 | } 55 | 56 | -------------------------------------------------------------------------------- /rlgl.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | pub struct C.Shader { 4 | pub mut: 5 | id u32 6 | locs &u32 7 | } 8 | 9 | pub struct C.VrDeviceInfo { 10 | pub mut: 11 | hResolution int 12 | vResolution int 13 | hScreenSize f32 14 | vScreenSize f32 15 | vScreenCenter f32 16 | eyeToScreenDistance f32 17 | lensSeparationDistance f32 18 | interpupillaryDistance f32 19 | lensDistortionValues [4]f32 20 | chromaAbCorrection [4]f32 21 | } 22 | 23 | 24 | pub const ( 25 | albedo = 0 26 | diffuse = 0 27 | metalness = 1 28 | normal = 2 29 | roughness = 4 30 | occlusion = 5 31 | emission = 6 32 | height = 7 33 | cubemap = 8 34 | irradiance = 9 35 | prefilter = 10 36 | brdf = 11 37 | ) 38 | 39 | // // Shader loading/unloading functions 40 | // 41 | 42 | // Load chars array from text file 43 | [inline] pub fn load_text(fileName string) string { 44 | return string(byteptr(fileName.str)) 45 | } 46 | 47 | // Load shader from files and bind default locations 48 | [inline] pub fn load_shader(vsFileName, fsFileName string) Shader { 49 | return C.LoadShader(vsFileName.str, fsFileName.str) 50 | } 51 | 52 | // Load shader from code strings and bind default locations 53 | [inline] pub fn load_shader_code(vsCode string, fsCode string) Shader { 54 | return C.LoadShaderCode(vsCode.str, fsCode.str) 55 | } 56 | 57 | // Unload shader from GPU memory (VRAM) 58 | [inline] pub fn unload_shader(shader Shader) { 59 | C.UnloadShader(shader) 60 | } 61 | 62 | // Get default shader 63 | [inline] pub fn get_shader_default() Shader { 64 | return C.GetShaderDefault() 65 | } 66 | 67 | // Get default texture 68 | [inline] pub fn get_texture_default() Texture2D { 69 | return C.GetTextureDefault() 70 | } 71 | 72 | // Shader configuration functions 73 | 74 | // Get shader uniform location 75 | [inline] pub fn get_shader_location(shader Shader, uniformName string) int { 76 | return C.GetShaderLocation(shader, uniformName.str) 77 | } 78 | 79 | // Set shader uniform value 80 | [inline] pub fn set_shader_value(shader Shader, uniformLoc int, value voidptr, uniformType int) { 81 | C.SetShaderValue(shader, uniformLoc, value, uniformType) 82 | } 83 | 84 | // Set shader uniform value vector 85 | [inline] pub fn set_shader_value_v(shader Shader, uniformLoc int, value voidptr, uniformType, count int) { 86 | C.SetShaderValueV(shader, uniformLoc, value, uniformType, count) 87 | } 88 | 89 | // Set shader uniform value (matrix 4x4) 90 | [inline] pub fn set_shader_value_matrix(shader Shader, uniformLoc int, mat Matrix) { 91 | C.SetShaderValueMatrix(shader, uniformLoc, mat) 92 | } 93 | 94 | // Set shader uniform value for texture 95 | [inline] pub fn set_shader_value_texture(shader Shader, uniformLoc int, texture Texture2D) { 96 | C.SetShaderValueTexture(shader, uniformLoc, texture) 97 | } 98 | 99 | // Set a custom projection matrix (replaces internal projection matrix) 100 | [inline] pub fn set_matrix_projection(proj Matrix) { 101 | C.SetMatrixProjection(proj) 102 | } 103 | 104 | // Set a custom modelview matrix (replaces internal modelview matrix) 105 | [inline] pub fn set_matrix_modelview(view Matrix) { 106 | C.SetMatrixModelview(view) 107 | } 108 | 109 | // Get internal modelview matrix 110 | [inline] pub fn get_matrix_model_view() Matrix { 111 | return C.GetMatrixModelview() 112 | } 113 | 114 | 115 | // Shading begin/end functions 116 | // 117 | 118 | // Begin custom shader drawing 119 | [inline] pub fn begin_shader_mode(shader Shader) { 120 | C.BeginShaderMode(shader) 121 | } 122 | 123 | // End custom shader drawing (use default shader) 124 | [inline] pub fn end_shader_model() { 125 | C.EndShaderMode() 126 | } 127 | 128 | // Begin blending mode (alpha, additive, multiplied) 129 | [inline] pub fn begin_blend_mode(mode int) { 130 | C.BeginBlendMode(mode) 131 | } 132 | 133 | // End blending mode (reset to default: alpha blending) 134 | [inline] pub fn end_blend_mode() { 135 | C.EndBlendMode() 136 | } 137 | 138 | // Begin scissor mode (define screen area for following drawing) 139 | [inline] pub fn begin_scissor_mode(x, y, width, height int) { 140 | C.BeginScissorMode(x, y, width, height) 141 | } 142 | 143 | // End scissor mode 144 | [inline] pub fn end_scissor_mode() { 145 | C.EndScissorMode() 146 | } 147 | 148 | // VR control functions 149 | // 150 | 151 | // Init VR simulator for selected device parameters 152 | [inline] pub fn init_vr_simulator() { 153 | C.InitVrSimulator() 154 | } 155 | 156 | // Close VR simulator for current device 157 | [inline] pub fn close_vr_simulator() { 158 | C.CloseVrSimulator() 159 | } 160 | 161 | // Update VR tracking (position and orientation) and camera 162 | [inline] pub fn update_vr_tracking(camera &Camera3D) { 163 | C.UpdateVrTracking(camera) 164 | } 165 | 166 | // Set stereo rendering configuration parameters 167 | [inline] pub fn set_vr_configuration(info VrDeviceInfo, distortion Shader) { 168 | C.SetVrConfiguration(info, distortion) 169 | } 170 | 171 | // Detect if VR simulator is ready 172 | [inline] pub fn is_vr_simulator_ready() bool { 173 | return C.IsVrSimulatorReady() 174 | } 175 | 176 | // Enable/Disable VR experience 177 | [inline] pub fn toggle_vr_mode() { 178 | C.ToggleVrMode() 179 | } 180 | 181 | // Begin VR simulator stereo rendering 182 | [inline] pub fn begin_vr_drawing() { 183 | C.BeginVrDrawing() 184 | } 185 | 186 | // End VR simulator stereo rendering 187 | [inline] pub fn end_vr_drawing() { 188 | C.EndVrDrawing() 189 | } 190 | -------------------------------------------------------------------------------- /shapes.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // -------------------------------------------------------- 4 | // Module: Shapes 5 | // -------------------------------------------------------- 6 | 7 | // Shape Drawing Functions 8 | // Basic shapes drawing functions 9 | [inline] pub fn draw_pixel(posX, posY int, color Color) { 10 | C.DrawPixel(posX, posY, color) 11 | } 12 | 13 | [inline] pub fn draw_pixel_v(position Vector2, color Color) { 14 | C.DrawPixelV(position, color) 15 | } 16 | 17 | [inline] pub fn draw_line(startPosX, startPosY, endPosX, endPosY int, color Color) { 18 | C.DrawLine(startPosX, startPosY, endPosX, endPosY, color) 19 | } 20 | 21 | [inline] pub fn draw_line_v(startPos, endPos Vector2, color Color) { 22 | C.DrawLineV(startPos, endPos, color) 23 | } 24 | 25 | [inline] pub fn draw_line_ex(startPos, endPos Vector2, thick f32, color Color) { 26 | C.DrawLineEx(startPos, endPos, thick, color) 27 | } 28 | 29 | [inline] pub fn draw_line_bezier(startPos, endPos Vector2, thick f32, color Color) { 30 | C.DrawLineBezier(startPos, endPos, thick, color) 31 | } 32 | 33 | [inline] pub fn draw_line_strip(points &Vector2, numPoints int, color Color) { 34 | C.DrawLineStrip(points, numPoints, color) 35 | } 36 | 37 | [inline] pub fn draw_circle(centerX, centerY int, radius f32, color Color) { 38 | C.DrawCircle(centerX, centerY, radius, color) 39 | } 40 | 41 | [inline] pub fn draw_circle_sector(center Vector2, radius f32, startAngle, endAngle, segments int, color Color) { 42 | C.DrawCircleSector(center, radius, startAngle, endAngle, segments, color) 43 | } 44 | 45 | [inline] pub fn draw_circle_sector_lines(center Vector2, radius f32, startAngle, endAngle, segments int, color Color) { 46 | C.DrawCircleSectorLines(center, radius, startAngle, endAngle, segments, color) 47 | } 48 | 49 | [inline] pub fn draw_circle_gradient(centerX, centerY int, radius f32, color1, color2 Color) { 50 | C.DrawCircleGradient(centerX, centerY, radius, color1, color2) 51 | } 52 | 53 | [inline] pub fn draw_circle_v(center Vector2, radius f32, color Color) { 54 | C.DrawCircleV(center, radius, color) 55 | } 56 | 57 | [inline] pub fn draw_circle_lines(centerX, centerY int, radius f32, color Color) { 58 | C.DrawCircleLines(centerX, centerY, radius, color) 59 | } 60 | 61 | [inline] pub fn draw_ring(center Vector2, innerRadius, outerRadius f32, startAngle, endAngle, segments int, color Color) { 62 | C.DrawRing(center, innerRadius, outerRadius, startAngle, endAngle, segments, color) 63 | } 64 | 65 | [inline] pub fn draw_ring_lines(center Vector2, innerRadius, outerRadius f32, startAngle, endAngle, segments int, color Color) { 66 | C.DrawRingLines(center, innerRadius, outerRadius, startAngle, endAngle, segments, color) 67 | } 68 | 69 | [inline] pub fn draw_rectangle(posX, posY, width, height int, color Color) { 70 | C.DrawRectangle(posX, posY, width, height, color) 71 | } 72 | 73 | [inline] pub fn draw_rectangle_v(position, size Vector2, color Color) { 74 | C.DrawRectangleV(position, size, color) 75 | } 76 | 77 | [inline] pub fn draw_rectangle_rec(rec Rectangle, color Color) { 78 | C.DrawRectangleRec(rec, color) 79 | } 80 | 81 | [inline] pub fn draw_rectangle_pro(rec Rectangle, origin Vector2, rotation f32, color Color) { 82 | C.DrawRectanglePro(rec, origin, rotation, color) 83 | } 84 | 85 | [inline] pub fn draw_rectangle_gradient_v(posX, posY, width, height int, color1, color2 Color) { 86 | C.DrawRectangleGradientV(posX, posY, width, height, color1, color2) 87 | } 88 | 89 | [inline] pub fn draw_rectangle_gradient_h(posX, posY, width, height int, color1, color2 Color) { 90 | C.DrawRectangleGradientH(posX, posY, width, height, color1, color2) 91 | } 92 | 93 | [inline] pub fn draw_rectangle_gradient_ex(rec Rectangle, col1, col2, col3, col4 Color) { 94 | C.DrawRectangleGradientEx(rec, col1, col2, col3, col4) 95 | } 96 | 97 | [inline] pub fn draw_rectangle_lines(posX, posY, width, height int, color Color) { 98 | C.DrawRectangleLines(posX, posY, width, height, color) 99 | } 100 | 101 | [inline] pub fn draw_rectangle_lines_ex(rec Rectangle, lineThick int, color Color) { 102 | C.DrawRectangleLinesEx(rec, lineThick, color) 103 | } 104 | 105 | [inline] pub fn draw_rectangle_rounded(rec Rectangle, roundness f32, segments int, color Color) { 106 | C.DrawRectangleRounded(rec, roundness, segments, color) 107 | } 108 | 109 | [inline] pub fn draw_rectangle_rounded_lines(rec Rectangle, roundness f32, segments, lineThick int, color Color) { 110 | C.DrawRectangleRoundedLines(rec, roundness, segments, lineThick, color) 111 | } 112 | 113 | [inline] pub fn draw_triangle(v1, v2, v3 Vector2, color Color) { 114 | C.DrawTriangle(v1, v2, v3, color) 115 | } 116 | 117 | [inline] pub fn draw_triangle_lines(v1, v2, v3 Vector2, color Color) { 118 | C.DrawTriangleLines(v1, v2, v3, color) 119 | } 120 | 121 | [inline] pub fn draw_triangle_fan(points &Vector2, numPoints int, color Color) { 122 | C.DrawTriangleFan(points, numPoints, color) 123 | } 124 | 125 | [inline] pub fn draw_poly(center Vector2, sides int, radius, rotation f32, color Color) { 126 | C.DrawPoly(center, sides, radius, rotation, color) 127 | } 128 | 129 | [inline] pub fn set_shapes_texture(texture Texture2D, source Rectangle) { 130 | C.SetShapesTexture(texture, source) 131 | } 132 | 133 | // Basic Shapes Collision Detection Functions 134 | [inline] pub fn check_collision_recs(rec1, rec2 Rectangle) bool { 135 | return C.CheckCollisionRecs(rec1, rec2) 136 | } 137 | 138 | [inline] pub fn check_collision_circles(center1 Vector2, radius1 f32, center2 Vector2, radius2 f32) bool { 139 | return C.CheckCollisionCircles(center1, radius1, center2, radius2) 140 | } 141 | 142 | [inline] pub fn check_collision_circle_rec(center Vector2, radius f32, rec Rectangle) bool { 143 | return C.CheckCollisionCircleRec(center, radius, rec) 144 | } 145 | 146 | 147 | [inline] pub fn get_collision_rec(rec1, rec2 Rectangle) Rectangle { 148 | return C.GetCollisionRec(rec1, rec2) 149 | } 150 | 151 | [inline] pub fn check_collision_point_rec(point Vector2, rec Rectangle) bool { 152 | return C.CheckCollisionPointRec(point, rec) 153 | } 154 | 155 | [inline] pub fn check_collision_point_circle(point, center Vector2, radius f32) bool { 156 | return C.CheckCollisionPointCircle(point, center, radius) 157 | } 158 | 159 | [inline] pub fn check_collision_point_triangle(point, p1, p2, p3 Vector2) bool { 160 | return C.CheckCollisionPointTriangle(point, p1, p2, p3) 161 | } 162 | 163 | -------------------------------------------------------------------------------- /storage.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // Persistent storage management 4 | 5 | // Save integer value to storage file (to defined position) 6 | [inline] pub fn storage_save_value(position, value int) { 7 | C.StorageSaveValue(position, value) 8 | } 9 | 10 | // Load integer value from storage file (from defined position) 11 | [inline] pub fn storage_load_value(position int) int { 12 | return C.StorageLoadValue(position) 13 | } 14 | 15 | [inline] pub fn open_url(url string) { 16 | C.OpenURL(url.str) 17 | } 18 | -------------------------------------------------------------------------------- /text.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | /// -------------------------------------------- 4 | /// Module - Text 5 | /// -------------------------------------------- 6 | 7 | // Get the default Font 8 | [inline] pub fn get_font_defauilt() Font { 9 | return C.GetFontDefault() 10 | } 11 | 12 | // Load font from file into GPU memory (VRAM) 13 | [inline] pub fn load_font(fileName string) Font { 14 | return C.LoadFont(fileName.str) 15 | } 16 | 17 | // Load font from file with extended parameters 18 | [inline] pub fn load_font_ex(fileName string, fontSize int, fontChars &int, charsCount int) Font { 19 | return C.LoadFontEx(fileName.str, fontSize, fontChars, charsCount) 20 | } 21 | 22 | // Load font from Image (XNA style) 23 | [inline] pub fn load_font_from_image(image Image, key Color, firstChar int) Font { 24 | return C.LoadFontFromImage(image, key, firstChar) 25 | } 26 | 27 | // Load font data for further use 28 | [inline] pub fn load_font_data(fileName string, fontSize int, fontChars &int, charsCount, @type int) &CharInfo { 29 | return C.LoadFontData(fileName.str, fontSize, fontChars, charsCount, @type) 30 | } 31 | 32 | // Unload Font 33 | [inline] pub fn unload_font(font Font) { 34 | C.UnloadFont(font) 35 | } 36 | 37 | 38 | // Text Drawing Functions 39 | // 40 | 41 | [inline] pub fn draw_fps(posX, posY int) { 42 | C.DrawFPS(posX, posY) 43 | } 44 | 45 | [inline] pub fn draw_text(text string, posX, posY, fontSize int, color Color) { 46 | C.DrawText(text.str, posX, posY, fontSize, color) 47 | } 48 | 49 | [inline] pub fn (f Font) draw_text_ex(text string, position Vector2, fontSize, spacing f32, tint Color) { 50 | C.DrawTextEx(f, text.str, position, fontSize, spacing, tint) 51 | } 52 | 53 | [inline] pub fn (f Font) draw_text_rec( 54 | text string, 55 | rec Rectangle, 56 | fontSize, spacing f32, 57 | wordWrap bool, 58 | tint Color) { 59 | C.DrawTextRec(f, text.str, rec, fontSize, spacing, wordWrap, tint) 60 | } 61 | 62 | [inline] pub fn (f Font) draw_text_rec_ex( 63 | text string, 64 | rec Rectangle 65 | fontSize, spacing f32 66 | wordWrap bool, 67 | tint Color, 68 | selectStart, selectLength int, 69 | selectText, selectBack Color) { 70 | C.DrawTextRecEx(f, text.str, rec, fontSize, spacing, wordWrap, tint, selectStart, selectLength, selectText, selectBack) 71 | } 72 | 73 | 74 | // Text misc. functions 75 | // 76 | 77 | // Measure string width for default font 78 | [inline] pub fn measure_text(text string, fontSize int) int { 79 | return C.MeasureText(text.str, fontSize) 80 | } 81 | // Measure string size for Font 82 | [inline] pub fn measure_text_ex(font Font, text string, fontSize, spacing f32) Vector2 { 83 | return C.MeasureTextEx(font, text.str, fontSize, spacing) 84 | } 85 | // Get index position for a unicode character on font 86 | [inline] pub fn get_glyph_index(font Font, character int) int { 87 | return C.GetGlyphIndex(font, character) 88 | } 89 | -------------------------------------------------------------------------------- /textures.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // ------------------------------------------------- 4 | // Module - Textures 5 | // ------------------------------------------------- 6 | 7 | // Image/Texture2D data loading/unloading/saving functions 8 | 9 | // Load image from file into CPU memory (RAM) 10 | [inline] pub fn load_image(fileName string) Image { 11 | return C.LoadImage(fileName.str) 12 | } 13 | 14 | // Load image from Color array data (RGBA - 32bit) 15 | [inline] pub fn load_image_ex(pixel &Color, width, height int) Image { 16 | return C.LoadImageEx(pixel, width, height) 17 | 18 | } 19 | 20 | // Load image from raw data with parameters 21 | [inline] pub fn load_image_proc(data voidptr, width, height, format int) Image { 22 | return C.LoadImagePro(data, width, height, format) 23 | } 24 | 25 | // Load image from RAW file data 26 | [inline] pub fn load_image_raw(fileName string, width, height, format, headerSize int) Image { 27 | return C.LoadImageRaw(fileName.str, width, height, format, headerSize) 28 | } 29 | 30 | // Export image data to file 31 | [inline] pub fn export_image(image Image, fileName string) { 32 | C.ExportImage(image, fileName.str) 33 | } 34 | 35 | // Export image as code file defining an array of bytes 36 | [inline] pub fn export_image_as_code(image Image, fileName string) { 37 | C.ExportImageAsCode(image, fileName.str) 38 | } 39 | 40 | // Load texture from file into GPU memory (VRAM) 41 | [inline] pub fn load_texture(fileName string) Texture2D { 42 | return C.LoadTexture(fileName.str) 43 | } 44 | 45 | // Load texture from image data 46 | [inline] pub fn load_texture_from_image(image Image) Texture2D { 47 | return C.LoadTextureFromImage(image) 48 | } 49 | 50 | // Load cubemap from image, multiple image cubemap layouts supported 51 | // [inline] pub fn load_texture_cubemap(image Image, layoutType int) TextureCubemap { 52 | // return C.TextureCubemap(image, layoutType) 53 | // } 54 | 55 | // Load texture for rendering (framebuffer) 56 | [inline] pub fn load_render_texture(width, height int) RenderTexture2D { 57 | return C.LoadRenderTexture(width, height) 58 | } 59 | 60 | // Unload image from CPU memory (RAM) 61 | [inline] pub fn unload_image(image Image) { 62 | C.UnloadImage(image) 63 | } 64 | 65 | // Unload texture from GPU memory (VRAM) 66 | [inline] pub fn unload_texture(texture Texture2D) { 67 | C.UnloadTexture(texture) 68 | } 69 | 70 | // Unload render texture from GPU memory (VRAM) 71 | [inline] pub fn unload_render_texture(target RenderTexture2D) { 72 | C.UnloadRenderTexture(target) 73 | } 74 | 75 | // Color *GetImageData(Image image); // Get pixel data from image as a Color struct array 76 | // Vector4 *GetImageDataNormalized(Image image); // Get pixel data from image as Vector4 array (float normalized) 77 | 78 | // Get pixel data size in bytes (image or texture) 79 | [inline] pub fn get_pixel_data_size(width, height, format int) int { 80 | return C.GetPixelDataSize(width, height, format) 81 | } 82 | 83 | // Get pixel data from GPU texture and return an Image 84 | [inline] pub fn get_texture_data(texture Texture2D) Image { 85 | return C.GetTextureData(texture) 86 | } 87 | 88 | // Get pixel data from screen buffer and return an Image (screenshot) 89 | [inline] pub fn get_screen_data() Image { 90 | return C.GetScreenData() 91 | } 92 | 93 | // Update GPU texture with new data 94 | [inline] pub fn update_texture(texture Texture2D, pixels voidptr) { 95 | C.UpdateTexture(texture, pixels) 96 | } 97 | 98 | 99 | //////////////////////////////////////////////////////////////////////////////// 100 | 101 | // Texture2D configuration functions 102 | // 103 | 104 | // Generate GPU mipmaps for a texture 105 | [inline] pub fn gen_texture_mipmaps(texture &Texture2D) { 106 | C.GenTextureMipmaps(texture) 107 | } 108 | 109 | // Set texture scaling filter mode 110 | [inline] pub fn set_texture_filter(texture Texture2D, filterMode int) { 111 | C.SetTextureFilter(texture, filterMode) 112 | } 113 | 114 | // Set texture wrapping mode 115 | [inline] pub fn set_texture_wrap(texture Texture2D, wrapMode int) { 116 | C.SetTextureWrap(texture, wrapMode) 117 | } 118 | 119 | // Texture2D drawing functions 120 | // 121 | 122 | // Draw a Texture2D 123 | [inline] pub fn draw_texture(texture Texture2D, posX, posY int, tint Color) { 124 | C.DrawTexture(texture, posX, posY, tint) 125 | } 126 | 127 | // Draw a Texture2D with position defined as Vector2 128 | [inline] pub fn draw_texture_v(texture Texture2D, position Vector2, tint Color) { 129 | C.DrawTextureV(texture, position, tint) 130 | } 131 | 132 | // Draw a Texture2D with extended parameters 133 | [inline] pub fn draw_texture_ex(texture Texture2D, position Vector2, rotation, scale f32, tint Color) { 134 | C.DrawTextureEx(texture, position, rotation, scale, tint) 135 | } 136 | 137 | // Draw a part of a texture defined by a rectangle 138 | [inline] pub fn draw_texture_rec(texture Texture2D, sourceRec Rectangle, position Vector2, tint Color) { 139 | C.DrawTextureRec(texture, sourceRec, position, tint) 140 | } 141 | 142 | // Draw texture quad with tiling and offset parameters 143 | [inline] pub fn draw_texture_quad(texture Texture2D, tiling, offset Vector2, quad Rectangle, tint Color) { 144 | C.DrawTextureQuad(texture, tiling, offset, quad, tint) 145 | } 146 | 147 | // Draw a part of a texture defined by a rectangle with 'pro' parameters 148 | [inline] pub fn draw_texture_pro(texture Texture2D, sourceRec, destRec Rectangle, origin Vector2, rotation f32, tint Color) { 149 | C.DrawTexturePro(texture, sourceRec, destRec, origin, rotation, tint) 150 | } 151 | 152 | // Draws a texture (or part of it) that stretches or shrinks nicely 153 | [inline] pub fn draw_texture_n_patch(texture Texture2D, nPatchInfo NPatchInfo, destRec Rectangle, origin Vector2, rotation f32, tint Color) { 154 | C.DrawTextureNPatch(texture, nPatchInfo, destRec, origin, rotation, tint) 155 | } 156 | 157 | -------------------------------------------------------------------------------- /timing.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // Timing-related functions 4 | 5 | // Set target FPS (maximum) 6 | [inline] pub fn set_target_fps(fps int) { 7 | C.SetTargetFPS(fps) 8 | } 9 | 10 | // Get current FPS 11 | [inline] pub fn get_fps() int { 12 | return C.GetFPS() 13 | } 14 | 15 | // Returns time in seconds for last frame drawn 16 | [inline] pub fn get_frame_time() f32 { 17 | return C.GetFrameTime() 18 | } 19 | 20 | // Returns elapsed time in seconds since InitWindow() 21 | [inline] pub fn get_time() f64 { 22 | return C.GetTime() 23 | } 24 | 25 | -------------------------------------------------------------------------------- /tools/raylib2v.v: -------------------------------------------------------------------------------- 1 | module main 2 | 3 | import os 4 | import flag 5 | import filepath 6 | 7 | 8 | const ( 9 | tool_version = '0.0.1' 10 | tool_description = 'Convert raylib.h RLAPI to v' 11 | ) 12 | 13 | fn main(){ 14 | mut fp := flag.new_flag_parser(os.args) 15 | fp.application(filepath.filename(os.executable())) 16 | fp.version( tool_version ) 17 | fp.description( tool_description ) 18 | fp.arguments_description('raylib.h') 19 | fp.limit_free_args_to_at_least(1) 20 | fp.skip_executable() 21 | show_help:=fp.bool_('help', `h`, false, 'Show this help screen\n') 22 | if show_help || os.args.len < 2 || os.args.len > 2 { 23 | println( fp.usage() ) 24 | exit(0) 25 | } 26 | println('module vraylib') 27 | println('') 28 | parse_hfile(os.realpath(os.args[1])) 29 | for ctype, counter in context.ctypes { 30 | println('// CType: $ctype | $counter') 31 | } 32 | } 33 | 34 | struct Context { 35 | mut: 36 | ctypes map[string]int 37 | } 38 | const ( 39 | context = &Context{} 40 | ) 41 | 42 | fn (c &Context) add_c_type(ctype string){ 43 | mut mc := c 44 | mc.ctypes[ ctype ] = mc.ctypes[ ctype ] + 1 45 | } 46 | 47 | struct ApiTypedName { 48 | name string 49 | kind string 50 | } 51 | pub fn (t ApiTypedName) str() string { return 'ApiTypedName{ name: "$t.name" , kind: "$t.kind" }' } 52 | pub fn (many []ApiTypedName) str() string { 53 | mut res := []string 54 | for t in many { res << t.str() } 55 | return '[' + res.join(', ') + ']' 56 | } 57 | pub fn (t ApiTypedName) vtype() string { 58 | k := t.kind.replace('RLAPI ', '') 59 | mut vt := match k { 60 | 61 | 'void' { '' } 62 | 'void *' { 'voidptr' } 63 | 'const void *' { 'voidptr' } 64 | 65 | '...' {'x ...charptr'} 66 | 'const char *' { 'charptr' } 67 | 'unsigned char *' { 'byteptr' } 68 | 69 | 'const char **' { '&charptr' } 70 | 'char **' { '&charptr' } 71 | 72 | 'unsigned int' { 'u32' } 73 | 'unsigned long' { 'u64' } 74 | 'int *' { '&int' } 75 | 'float *' { '&f32' } 76 | 'float' { 'f32' } 77 | 'double *' { '&f64' } 78 | 'double' { 'f64' } 79 | 'long *' { '&i64' } 80 | 'long' { 'i64' } 81 | 82 | 'const CharInfo *' { '&CharInfo' } 83 | 'Rectangle **' { '&PRectangle' } 84 | else { k } 85 | } 86 | //println('vt: "$vt"') 87 | if vt.len > 0 && vt[0] >= `A` && vt[0] <= `Z` { 88 | vt = 'C.${vt}' 89 | context.add_c_type( vt ) 90 | } 91 | if vt.ends_with('*') { 92 | vt = vt.trim('*') 93 | vt = '&${vt}' 94 | } 95 | return vt 96 | } 97 | 98 | struct ApiCall { 99 | mut: 100 | cname ApiTypedName 101 | params []ApiTypedName 102 | comment string 103 | } 104 | fn parse_hfile(hfile string){ 105 | lines := os.read_lines(hfile) or { panic(err) } 106 | mut n := 0 107 | for i:=0; i> param "${param:-25s}" | rtype: "${rtype:-15s}" | name: "${name:-15s}" ') 157 | if rtype == '' { 158 | return name, '' 159 | } 160 | return rtype, name 161 | } 162 | 163 | fn last_non_alphanum_index(s string) int { 164 | mut i := s.len 165 | for { 166 | i-- 167 | if i < 0 { 168 | break 169 | } 170 | c := s[i] 171 | if !((c >= `a` && c <= `z`) || (c >= `A` && c <= `Z`) || (c >= `0` && c <= `9`)) { 172 | break 173 | } 174 | } 175 | return i 176 | } 177 | 178 | [inline] fn is_wordchar(c byte) bool { return (c-0x20 < 0x5f) && !(c == ` ` || (c - `\t`) < 5 ) } 179 | -------------------------------------------------------------------------------- /touch.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // Input-related functions: touch 4 | 5 | // Returns touch position X for touch point 0 (relative to screen size) 6 | [inline] pub fn get_touch_x() int { 7 | return C.GetTouchX() 8 | } 9 | 10 | // Returns touch position Y for touch point 0 (relative to screen size) 11 | [inline] pub fn get_touch_y() int { 12 | return C.GetTouchY() 13 | } 14 | 15 | // Returns touch position XY for a touch point index (relative to screen size) 16 | [inline] pub fn get_touch_position(index int) Vector2 { 17 | return C.GetTouchPosition(index) 18 | } 19 | 20 | -------------------------------------------------------------------------------- /v.mod: -------------------------------------------------------------------------------- 1 | Module { 2 | name: 'vraylib' 3 | version: '0.1.0' 4 | deps: [] 5 | } 6 | -------------------------------------------------------------------------------- /window.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // Window-Related Functions 4 | 5 | // Initialize window and OpenGL context 6 | [inline] pub fn init_window(w, h int, title string) { 7 | C.InitWindow(w, h, title.str) 8 | } 9 | 10 | // Check if KEY_ESCAPE pressed or Close icon pressed 11 | [inline] pub fn window_should_close() bool { 12 | return C.WindowShouldClose() 13 | } 14 | 15 | // Close window and unload OpenGL context 16 | [inline] pub fn close_window() { 17 | C.CloseWindow() 18 | } 19 | 20 | // Check if window has been initialized successfully 21 | [inline] pub fn is_window_ready() bool { 22 | return C.IsWindowReady() 23 | } 24 | 25 | // Check if window has been minimized (or lost focus) 26 | [inline] pub fn is_window_minimized() bool { 27 | return C.IsWindowMinimized() 28 | } 29 | 30 | // Check if window has been resized 31 | [inline] pub fn is_window_resized() bool { 32 | return C.IsWindowResized() 33 | } 34 | 35 | // Check if window is currently hidden 36 | [inline] pub fn is_window_hidden() bool { 37 | return C.IsWindowHidden() 38 | } 39 | 40 | // Toggle fullscreen mode (only PLATFORM_DESKTOP) 41 | [inline] pub fn toggle_fullscreen() { 42 | C.ToggleFullscreen() 43 | } 44 | 45 | // Show the window 46 | [inline] pub fn unhide_window() { 47 | C.UnhideWindow() 48 | } 49 | 50 | // Hide the window 51 | [inline] pub fn hide_window() { 52 | C.HideWindow() 53 | } 54 | 55 | // Set icon for window (only PLATFORM_DESKTOP) 56 | [inline] pub fn set_window_icon(image Image) { 57 | C.SetWindowIcon(image) 58 | } 59 | 60 | // Set title for window (only PLATFORM_DESKTOP) 61 | [inline] pub fn set_window_title(title string) { 62 | C.SetWindowTitle(title.str) 63 | } 64 | 65 | // Set window position on screen (only PLATFORM_DESKTOP) 66 | [inline] pub fn set_window_position(x, y int) { 67 | C.SetWindowPosition(x, y) 68 | } 69 | 70 | // Set monitor for the current window (fullscreen mode) 71 | [inline] pub fn set_window_monitor(monitor int) { 72 | C.SetWindowMonitor(monitor) 73 | } 74 | 75 | // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) 76 | [inline] pub fn set_window_min_size(width, height int) { 77 | C.SetWindowMinSize(width, height) 78 | } 79 | 80 | // Set window dimensions 81 | [inline] pub fn set_window_size(width, height int) { 82 | C.SetWindowSize(width, height) 83 | } 84 | 85 | // Get native window handle 86 | [inline] pub fn get_window_hanlde() voidptr { 87 | return C.GetWindowHandle() 88 | } 89 | 90 | // Get current screen width 91 | [inline] pub fn get_screen_width() int { 92 | return C.GetScreenWidth() 93 | } 94 | 95 | // Get current screen height 96 | [inline] pub fn get_screen_height() int { 97 | return C.GetScreenHeight() 98 | } 99 | 100 | // Get number of connected monitors 101 | [inline] pub fn get_monitor_count() int { 102 | return C.GetMonitorCount() 103 | } 104 | 105 | // Get primary monitor width 106 | [inline] pub fn get_monitor_width(monitor int) int { 107 | return C.GetMonitorWidth(monitor) 108 | } 109 | 110 | // Get primary monitor height 111 | [inline] pub fn get_monitor_height(monitor int) int { 112 | return C.GetMonitorHeight(monitor) 113 | } 114 | 115 | // Get primary monitor physical width in millimetres 116 | [inline] pub fn get_monitor_physical_width(monitor int) int { 117 | return C.GetMonitorPhysicalWidth(monitor) 118 | } 119 | 120 | // Get primary monitor physical height in millimetres 121 | [inline] pub fn get_monitor_physical_height(monitor int) int { 122 | return C.GetMonitorPhysicalHeight(monitor) 123 | } 124 | 125 | // Get the human-readable, UTF-8 encoded name of the primary monitor 126 | [inline] pub fn get_monitor_name(monitor int) string { 127 | return string(byteptr(C.GetMonitorName(monitor))) 128 | } 129 | 130 | // Get clipboard text content 131 | [inline] pub fn get_clipboard_text() string { 132 | return string(byteptr(C.GetClipboardText())) 133 | } 134 | 135 | // Set clipboard text content 136 | [inline] pub fn set_clipboard_text(text string) { 137 | C.SetClipboardText(text.str) 138 | } 139 | -------------------------------------------------------------------------------- /z_c_fns.v: -------------------------------------------------------------------------------- 1 | module vraylib 2 | 3 | // C Original: RLAPI void InitWindow(int width, int height, const char *title); // Initialize window and OpenGL context 4 | // C.InitWindow - Initialize window and OpenGL context 5 | fn C.InitWindow(c_width int, c_height int, c_title charptr) 6 | 7 | // C Original: RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed 8 | // C.WindowShouldClose - Check if KEY_ESCAPE pressed or Close icon pressed 9 | fn C.WindowShouldClose() bool 10 | 11 | // C Original: RLAPI void CloseWindow(void); // Close window and unload OpenGL context 12 | // C.CloseWindow - Close window and unload OpenGL context 13 | fn C.CloseWindow() 14 | 15 | // C Original: RLAPI bool IsWindowReady(void); // Check if window has been initialized successfully 16 | // C.IsWindowReady - Check if window has been initialized successfully 17 | fn C.IsWindowReady() bool 18 | 19 | // C Original: RLAPI bool IsWindowMinimized(void); // Check if window has been minimized (or lost focus) 20 | // C.IsWindowMinimized - Check if window has been minimized (or lost focus) 21 | fn C.IsWindowMinimized() bool 22 | 23 | // C Original: RLAPI bool IsWindowResized(void); // Check if window has been resized 24 | // C.IsWindowResized - Check if window has been resized 25 | fn C.IsWindowResized() bool 26 | 27 | // C Original: RLAPI bool IsWindowHidden(void); // Check if window is currently hidden 28 | // C.IsWindowHidden - Check if window is currently hidden 29 | fn C.IsWindowHidden() bool 30 | 31 | // C Original: RLAPI void ToggleFullscreen(void); // Toggle fullscreen mode (only PLATFORM_DESKTOP) 32 | // C.ToggleFullscreen - Toggle fullscreen mode (only PLATFORM_DESKTOP) 33 | fn C.ToggleFullscreen() 34 | 35 | // C Original: RLAPI void UnhideWindow(void); // Show the window 36 | // C.UnhideWindow - Show the window 37 | fn C.UnhideWindow() 38 | 39 | // C Original: RLAPI void HideWindow(void); // Hide the window 40 | // C.HideWindow - Hide the window 41 | fn C.HideWindow() 42 | 43 | // C Original: RLAPI void SetWindowIcon(Image image); // Set icon for window (only PLATFORM_DESKTOP) 44 | // C.SetWindowIcon - Set icon for window (only PLATFORM_DESKTOP) 45 | fn C.SetWindowIcon(c_image C.Image) 46 | 47 | // C Original: RLAPI void SetWindowTitle(const char *title); // Set title for window (only PLATFORM_DESKTOP) 48 | // C.SetWindowTitle - Set title for window (only PLATFORM_DESKTOP) 49 | fn C.SetWindowTitle(c_title charptr) 50 | 51 | // C Original: RLAPI void SetWindowPosition(int x, int y); // Set window position on screen (only PLATFORM_DESKTOP) 52 | // C.SetWindowPosition - Set window position on screen (only PLATFORM_DESKTOP) 53 | fn C.SetWindowPosition(c_x int, c_y int) 54 | 55 | // C Original: RLAPI void SetWindowMonitor(int monitor); // Set monitor for the current window (fullscreen mode) 56 | // C.SetWindowMonitor - Set monitor for the current window (fullscreen mode) 57 | fn C.SetWindowMonitor(c_monitor int) 58 | 59 | // C Original: RLAPI void SetWindowMinSize(int width, int height); // Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) 60 | // C.SetWindowMinSize - Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE) 61 | fn C.SetWindowMinSize(c_width int, c_height int) 62 | 63 | // C Original: RLAPI void SetWindowSize(int width, int height); // Set window dimensions 64 | // C.SetWindowSize - Set window dimensions 65 | fn C.SetWindowSize(c_width int, c_height int) 66 | 67 | // C Original: RLAPI void *GetWindowHandle(void); // Get native window handle 68 | // C.GetWindowHandle - Get native window handle 69 | fn C.GetWindowHandle() voidptr 70 | 71 | // C Original: RLAPI int GetScreenWidth(void); // Get current screen width 72 | // C.GetScreenWidth - Get current screen width 73 | fn C.GetScreenWidth() int 74 | 75 | // C Original: RLAPI int GetScreenHeight(void); // Get current screen height 76 | // C.GetScreenHeight - Get current screen height 77 | fn C.GetScreenHeight() int 78 | 79 | // C Original: RLAPI int GetMonitorCount(void); // Get number of connected monitors 80 | // C.GetMonitorCount - Get number of connected monitors 81 | fn C.GetMonitorCount() int 82 | 83 | // C Original: RLAPI int GetMonitorWidth(int monitor); // Get primary monitor width 84 | // C.GetMonitorWidth - Get primary monitor width 85 | fn C.GetMonitorWidth(c_monitor int) int 86 | 87 | // C Original: RLAPI int GetMonitorHeight(int monitor); // Get primary monitor height 88 | // C.GetMonitorHeight - Get primary monitor height 89 | fn C.GetMonitorHeight(c_monitor int) int 90 | 91 | // C Original: RLAPI int GetMonitorPhysicalWidth(int monitor); // Get primary monitor physical width in millimetres 92 | // C.GetMonitorPhysicalWidth - Get primary monitor physical width in millimetres 93 | fn C.GetMonitorPhysicalWidth(c_monitor int) int 94 | 95 | // C Original: RLAPI int GetMonitorPhysicalHeight(int monitor); // Get primary monitor physical height in millimetres 96 | // C.GetMonitorPhysicalHeight - Get primary monitor physical height in millimetres 97 | fn C.GetMonitorPhysicalHeight(c_monitor int) int 98 | 99 | // C Original: RLAPI Vector2 GetWindowPosition(void); // Get window position XY on monitor 100 | // C.GetWindowPosition - Get window position XY on monitor 101 | fn C.GetWindowPosition() C.Vector2 102 | 103 | // C Original: RLAPI const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the primary monitor 104 | // C.GetMonitorName - Get the human-readable, UTF-8 encoded name of the primary monitor 105 | fn C.GetMonitorName(c_monitor int) charptr 106 | 107 | // C Original: RLAPI const char *GetClipboardText(void); // Get clipboard text content 108 | // C.GetClipboardText - Get clipboard text content 109 | fn C.GetClipboardText() charptr 110 | 111 | // C Original: RLAPI void SetClipboardText(const char *text); // Set clipboard text content 112 | // C.SetClipboardText - Set clipboard text content 113 | fn C.SetClipboardText(c_text charptr) 114 | 115 | // C Original: RLAPI void ShowCursor(void); // Shows cursor 116 | // C.ShowCursor - Shows cursor 117 | fn C.ShowCursor() 118 | 119 | // C Original: RLAPI void HideCursor(void); // Hides cursor 120 | // C.HideCursor - Hides cursor 121 | fn C.HideCursor() 122 | 123 | // C Original: RLAPI bool IsCursorHidden(void); // Check if cursor is not visible 124 | // C.IsCursorHidden - Check if cursor is not visible 125 | fn C.IsCursorHidden() bool 126 | 127 | // C Original: RLAPI void EnableCursor(void); // Enables cursor (unlock cursor) 128 | // C.EnableCursor - Enables cursor (unlock cursor) 129 | fn C.EnableCursor() 130 | 131 | // C Original: RLAPI void DisableCursor(void); // Disables cursor (lock cursor) 132 | // C.DisableCursor - Disables cursor (lock cursor) 133 | fn C.DisableCursor() 134 | 135 | // C Original: RLAPI void ClearBackground(Color color); // Set background color (framebuffer clear color) 136 | // C.ClearBackground - Set background color (framebuffer clear color) 137 | fn C.ClearBackground(c_color C.Color) 138 | 139 | // C Original: RLAPI void BeginDrawing(void); // Setup canvas (framebuffer) to start drawing 140 | // C.BeginDrawing - Setup canvas (framebuffer) to start drawing 141 | fn C.BeginDrawing() 142 | 143 | // C Original: RLAPI void EndDrawing(void); // End canvas drawing and swap buffers (double buffering) 144 | // C.EndDrawing - End canvas drawing and swap buffers (double buffering) 145 | fn C.EndDrawing() 146 | 147 | // C Original: RLAPI void BeginMode2D(Camera2D camera); // Initialize 2D mode with custom camera (2D) 148 | // C.BeginMode2D - Initialize 2D mode with custom camera (2D) 149 | fn C.BeginMode2D(c_camera C.Camera2D) 150 | 151 | // C Original: RLAPI void EndMode2D(void); // Ends 2D mode with custom camera 152 | // C.EndMode2D - Ends 2D mode with custom camera 153 | fn C.EndMode2D() 154 | 155 | // C Original: RLAPI void BeginMode3D(Camera3D camera); // Initializes 3D mode with custom camera (3D) 156 | // C.BeginMode3D - Initializes 3D mode with custom camera (3D) 157 | fn C.BeginMode3D(c_camera C.Camera3D) 158 | 159 | // C Original: RLAPI void EndMode3D(void); // Ends 3D mode and returns to default 2D orthographic mode 160 | // C.EndMode3D - Ends 3D mode and returns to default 2D orthographic mode 161 | fn C.EndMode3D() 162 | 163 | // C Original: RLAPI void BeginTextureMode(RenderTexture2D target); // Initializes render texture for drawing 164 | // C.BeginTextureMode - Initializes render texture for drawing 165 | fn C.BeginTextureMode(c_target C.RenderTexture2D) 166 | 167 | // C Original: RLAPI void EndTextureMode(void); // Ends drawing to render texture 168 | // C.EndTextureMode - Ends drawing to render texture 169 | fn C.EndTextureMode() 170 | 171 | // C Original: RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) 172 | // C.BeginScissorMode - Begin scissor mode (define screen area for following drawing) 173 | fn C.BeginScissorMode(c_x int, c_y int, c_width int, c_height int) 174 | 175 | // C Original: RLAPI void EndScissorMode(void); // End scissor mode 176 | // C.EndScissorMode - End scissor mode 177 | fn C.EndScissorMode() 178 | 179 | // C Original: RLAPI Ray GetMouseRay(Vector2 mousePosition, Camera camera); // Returns a ray trace from mouse position 180 | // C.GetMouseRay - Returns a ray trace from mouse position 181 | fn C.GetMouseRay(c_mousePosition C.Vector2, c_camera C.Camera) C.Ray 182 | 183 | // C Original: RLAPI Matrix GetCameraMatrix(Camera camera); // Returns camera transform matrix (view matrix) 184 | // C.GetCameraMatrix - Returns camera transform matrix (view matrix) 185 | fn C.GetCameraMatrix(c_camera C.Camera) C.Matrix 186 | 187 | // C Original: RLAPI Matrix GetCameraMatrix2D(Camera2D camera); // Returns camera 2d transform matrix 188 | // C.GetCameraMatrix2D - Returns camera 2d transform matrix 189 | fn C.GetCameraMatrix2D(c_camera C.Camera2D) C.Matrix 190 | 191 | // C Original: RLAPI Vector2 GetWorldToScreen(Vector3 position, Camera camera); // Returns the screen space position for a 3d world space position 192 | // C.GetWorldToScreen - Returns the screen space position for a 3d world space position 193 | fn C.GetWorldToScreen(c_position C.Vector3, c_camera C.Camera) C.Vector2 194 | 195 | // C Original: RLAPI Vector2 GetWorldToScreen2D(Vector2 position, Camera2D camera); // Returns the screen space position for a 2d camera world space position 196 | // C.GetWorldToScreen2D - Returns the screen space position for a 2d camera world space position 197 | fn C.GetWorldToScreen2D(c_position C.Vector2, c_camera C.Camera2D) C.Vector2 198 | 199 | // C Original: RLAPI Vector2 GetScreenToWorld2D(Vector2 position, Camera2D camera); // Returns the world space position for a 2d camera screen space position 200 | // C.GetScreenToWorld2D - Returns the world space position for a 2d camera screen space position 201 | fn C.GetScreenToWorld2D(c_position C.Vector2, c_camera C.Camera2D) C.Vector2 202 | 203 | // C Original: RLAPI void SetTargetFPS(int fps); // Set target FPS (maximum) 204 | // C.SetTargetFPS - Set target FPS (maximum) 205 | fn C.SetTargetFPS(c_fps int) 206 | 207 | // C Original: RLAPI int GetFPS(void); // Returns current FPS 208 | // C.GetFPS - Returns current FPS 209 | fn C.GetFPS() int 210 | 211 | // C Original: RLAPI float GetFrameTime(void); // Returns time in seconds for last frame drawn 212 | // C.GetFrameTime - Returns time in seconds for last frame drawn 213 | fn C.GetFrameTime() f32 214 | 215 | // C Original: RLAPI double GetTime(void); // Returns elapsed time in seconds since InitWindow() 216 | // C.GetTime - Returns elapsed time in seconds since InitWindow() 217 | fn C.GetTime() f64 218 | 219 | // C Original: RLAPI int ColorToInt(Color color); // Returns hexadecimal value for a Color 220 | // C.ColorToInt - Returns hexadecimal value for a Color 221 | fn C.ColorToInt(c_color C.Color) int 222 | 223 | // C Original: RLAPI Vector4 ColorNormalize(Color color); // Returns color normalized as float [0..1] 224 | // C.ColorNormalize - Returns color normalized as float [0..1] 225 | fn C.ColorNormalize(c_color C.Color) C.Vector4 226 | 227 | // C Original: RLAPI Color ColorFromNormalized(Vector4 normalized); // Returns color from normalized values [0..1] 228 | // C.ColorFromNormalized - Returns color from normalized values [0..1] 229 | fn C.ColorFromNormalized(c_normalized C.Vector4) C.Color 230 | 231 | // C Original: RLAPI Vector3 ColorToHSV(Color color); // Returns HSV values for a Color 232 | // C.ColorToHSV - Returns HSV values for a Color 233 | fn C.ColorToHSV(c_color C.Color) C.Vector3 234 | 235 | // C Original: RLAPI Color ColorFromHSV(Vector3 hsv); // Returns a Color from HSV values 236 | // C.ColorFromHSV - Returns a Color from HSV values 237 | fn C.ColorFromHSV(c_hsv C.Vector3) C.Color 238 | 239 | // C Original: RLAPI Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value 240 | // C.GetColor - Returns a Color struct from hexadecimal value 241 | fn C.GetColor(c_hexValue int) C.Color 242 | 243 | // C Original: RLAPI Color Fade(Color color, float alpha); // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f 244 | // C.Fade - Color fade-in or fade-out, alpha goes from 0.0f to 1.0f 245 | fn C.Fade(c_color C.Color, c_alpha f32) C.Color 246 | 247 | // C Original: RLAPI void SetConfigFlags(unsigned int flags); // Setup window configuration flags (view FLAGS) 248 | // C.SetConfigFlags - Setup window configuration flags (view FLAGS) 249 | fn C.SetConfigFlags(c_flags u32) 250 | 251 | // C Original: RLAPI void SetTraceLogLevel(int logType); // Set the current threshold (minimum) log level 252 | // C.SetTraceLogLevel - Set the current threshold (minimum) log level 253 | fn C.SetTraceLogLevel(c_logType int) 254 | 255 | // C Original: RLAPI void SetTraceLogExit(int logType); // Set the exit threshold (minimum) log level 256 | // C.SetTraceLogExit - Set the exit threshold (minimum) log level 257 | fn C.SetTraceLogExit(c_logType int) 258 | 259 | // C Original: RLAPI void SetTraceLogCallback(TraceLogCallback callback); // Set a trace log callback to enable custom logging 260 | // C Original: RLAPI void TraceLog(int logType, const char *text, ...); // Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) 261 | // C.TraceLog - Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR) 262 | fn C.TraceLog(c_logType int, c_text charptr, x ...charptr) 263 | 264 | // C Original: RLAPI void TakeScreenshot(const char *fileName); // Takes a screenshot of current screen (saved a .png) 265 | // C.TakeScreenshot - Takes a screenshot of current screen (saved a .png) 266 | fn C.TakeScreenshot(c_fileName charptr) 267 | 268 | // C Original: RLAPI int GetRandomValue(int min, int max); // Returns a random value between min and max (both included) 269 | // C.GetRandomValue - Returns a random value between min and max (both included) 270 | fn C.GetRandomValue(c_min int, c_max int) int 271 | 272 | // C Original: RLAPI bool FileExists(const char *fileName); // Check if file exists 273 | // C.FileExists - Check if file exists 274 | fn C.FileExists(c_fileName charptr) bool 275 | 276 | // C Original: RLAPI bool IsFileExtension(const char *fileName, const char *ext);// Check file extension 277 | // C.IsFileExtension - Check file extension 278 | fn C.IsFileExtension(c_fileName charptr, c_ext charptr) bool 279 | 280 | // C Original: RLAPI bool DirectoryExists(const char *dirPath); // Check if a directory path exists 281 | // C.DirectoryExists - Check if a directory path exists 282 | fn C.DirectoryExists(c_dirPath charptr) bool 283 | 284 | // C Original: RLAPI const char *GetExtension(const char *fileName); // Get pointer to extension for a filename string 285 | // C.GetExtension - Get pointer to extension for a filename string 286 | fn C.GetExtension(c_fileName charptr) charptr 287 | 288 | // C Original: RLAPI const char *GetFileName(const char *filePath); // Get pointer to filename for a path string 289 | // C.GetFileName - Get pointer to filename for a path string 290 | fn C.GetFileName(c_filePath charptr) charptr 291 | 292 | // C Original: RLAPI const char *GetFileNameWithoutExt(const char *filePath); // Get filename string without extension (uses static string) 293 | // C.GetFileNameWithoutExt - Get filename string without extension (uses static string) 294 | fn C.GetFileNameWithoutExt(c_filePath charptr) charptr 295 | 296 | // C Original: RLAPI const char *GetDirectoryPath(const char *filePath); // Get full path for a given fileName with path (uses static string) 297 | // C.GetDirectoryPath - Get full path for a given fileName with path (uses static string) 298 | fn C.GetDirectoryPath(c_filePath charptr) charptr 299 | 300 | // C Original: RLAPI const char *GetPrevDirectoryPath(const char *dirPath); // Get previous directory path for a given path (uses static string) 301 | // C.GetPrevDirectoryPath - Get previous directory path for a given path (uses static string) 302 | fn C.GetPrevDirectoryPath(c_dirPath charptr) charptr 303 | 304 | // C Original: RLAPI const char *GetWorkingDirectory(void); // Get current working directory (uses static string) 305 | // C.GetWorkingDirectory - Get current working directory (uses static string) 306 | fn C.GetWorkingDirectory() charptr 307 | 308 | // C Original: RLAPI char **GetDirectoryFiles(const char *dirPath, int *count); // Get filenames in a directory path (memory should be freed) 309 | // C.GetDirectoryFiles - Get filenames in a directory path (memory should be freed) 310 | fn C.GetDirectoryFiles(c_dirPath charptr, c_count &int) &charptr 311 | 312 | // C Original: RLAPI void ClearDirectoryFiles(void); // Clear directory files paths buffers (free memory) 313 | // C.ClearDirectoryFiles - Clear directory files paths buffers (free memory) 314 | fn C.ClearDirectoryFiles() 315 | 316 | // C Original: RLAPI bool ChangeDirectory(const char *dir); // Change working directory, returns true if success 317 | // C.ChangeDirectory - Change working directory, returns true if success 318 | fn C.ChangeDirectory(c_dir charptr) bool 319 | 320 | // C Original: RLAPI bool IsFileDropped(void); // Check if a file has been dropped into window 321 | // C.IsFileDropped - Check if a file has been dropped into window 322 | fn C.IsFileDropped() bool 323 | 324 | // C Original: RLAPI char **GetDroppedFiles(int *count); // Get dropped files names (memory should be freed) 325 | // C.GetDroppedFiles - Get dropped files names (memory should be freed) 326 | fn C.GetDroppedFiles(c_count &int) &charptr 327 | 328 | // C Original: RLAPI void ClearDroppedFiles(void); // Clear dropped files paths buffer (free memory) 329 | // C.ClearDroppedFiles - Clear dropped files paths buffer (free memory) 330 | fn C.ClearDroppedFiles() 331 | 332 | // C Original: RLAPI long GetFileModTime(const char *fileName); // Get file modification time (last write time) 333 | // C.GetFileModTime - Get file modification time (last write time) 334 | fn C.GetFileModTime(c_fileName charptr) i64 335 | 336 | // C Original: RLAPI unsigned char *CompressData(unsigned char *data, int dataLength, int *compDataLength); // Compress data (DEFLATE algorythm) 337 | // C.CompressData - Compress data (DEFLATE algorythm) 338 | fn C.CompressData(c_data byteptr, c_dataLength int, c_compDataLength &int) byteptr 339 | 340 | // C Original: RLAPI unsigned char *DecompressData(unsigned char *compData, int compDataLength, int *dataLength); // Decompress data (DEFLATE algorythm) 341 | // C.DecompressData - Decompress data (DEFLATE algorythm) 342 | fn C.DecompressData(c_compData byteptr, c_compDataLength int, c_dataLength &int) byteptr 343 | 344 | // C Original: RLAPI void StorageSaveValue(int position, int value); // Save integer value to storage file (to defined position) 345 | // C.StorageSaveValue - Save integer value to storage file (to defined position) 346 | fn C.StorageSaveValue(c_position int, c_value int) 347 | 348 | // C Original: RLAPI int StorageLoadValue(int position); // Load integer value from storage file (from defined position) 349 | // C.StorageLoadValue - Load integer value from storage file (from defined position) 350 | fn C.StorageLoadValue(c_position int) int 351 | 352 | // C Original: RLAPI void OpenURL(const char *url); // Open URL with default system browser (if available) 353 | // C.OpenURL - Open URL with default system browser (if available) 354 | fn C.OpenURL(c_url charptr) 355 | 356 | // C Original: RLAPI bool IsKeyPressed(int key); // Detect if a key has been pressed once 357 | // C.IsKeyPressed - Detect if a key has been pressed once 358 | fn C.IsKeyPressed(c_key int) bool 359 | 360 | // C Original: RLAPI bool IsKeyDown(int key); // Detect if a key is being pressed 361 | // C.IsKeyDown - Detect if a key is being pressed 362 | fn C.IsKeyDown(c_key int) bool 363 | 364 | // C Original: RLAPI bool IsKeyReleased(int key); // Detect if a key has been released once 365 | // C.IsKeyReleased - Detect if a key has been released once 366 | fn C.IsKeyReleased(c_key int) bool 367 | 368 | // C Original: RLAPI bool IsKeyUp(int key); // Detect if a key is NOT being pressed 369 | // C.IsKeyUp - Detect if a key is NOT being pressed 370 | fn C.IsKeyUp(c_key int) bool 371 | 372 | // C Original: RLAPI void SetExitKey(int key); // Set a custom key to exit program (default is ESC) 373 | // C.SetExitKey - Set a custom key to exit program (default is ESC) 374 | fn C.SetExitKey(c_key int) 375 | 376 | // C Original: RLAPI int GetKeyPressed(void); // Get key pressed, call it multiple times for chars queued 377 | // C.GetKeyPressed - Get key pressed, call it multiple times for chars queued 378 | fn C.GetKeyPressed() int 379 | 380 | // C Original: RLAPI bool IsGamepadAvailable(int gamepad); // Detect if a gamepad is available 381 | // C.IsGamepadAvailable - Detect if a gamepad is available 382 | fn C.IsGamepadAvailable(c_gamepad int) bool 383 | 384 | // C Original: RLAPI bool IsGamepadName(int gamepad, const char *name); // Check gamepad name (if available) 385 | // C.IsGamepadName - Check gamepad name (if available) 386 | fn C.IsGamepadName(c_gamepad int, c_name charptr) bool 387 | 388 | // C Original: RLAPI const char *GetGamepadName(int gamepad); // Return gamepad internal name id 389 | // C.GetGamepadName - Return gamepad internal name id 390 | fn C.GetGamepadName(c_gamepad int) charptr 391 | 392 | // C Original: RLAPI bool IsGamepadButtonPressed(int gamepad, int button); // Detect if a gamepad button has been pressed once 393 | // C.IsGamepadButtonPressed - Detect if a gamepad button has been pressed once 394 | fn C.IsGamepadButtonPressed(c_gamepad int, c_button int) bool 395 | 396 | // C Original: RLAPI bool IsGamepadButtonDown(int gamepad, int button); // Detect if a gamepad button is being pressed 397 | // C.IsGamepadButtonDown - Detect if a gamepad button is being pressed 398 | fn C.IsGamepadButtonDown(c_gamepad int, c_button int) bool 399 | 400 | // C Original: RLAPI bool IsGamepadButtonReleased(int gamepad, int button); // Detect if a gamepad button has been released once 401 | // C.IsGamepadButtonReleased - Detect if a gamepad button has been released once 402 | fn C.IsGamepadButtonReleased(c_gamepad int, c_button int) bool 403 | 404 | // C Original: RLAPI bool IsGamepadButtonUp(int gamepad, int button); // Detect if a gamepad button is NOT being pressed 405 | // C.IsGamepadButtonUp - Detect if a gamepad button is NOT being pressed 406 | fn C.IsGamepadButtonUp(c_gamepad int, c_button int) bool 407 | 408 | // C Original: RLAPI int GetGamepadButtonPressed(void); // Get the last gamepad button pressed 409 | // C.GetGamepadButtonPressed - Get the last gamepad button pressed 410 | fn C.GetGamepadButtonPressed() int 411 | 412 | // C Original: RLAPI int GetGamepadAxisCount(int gamepad); // Return gamepad axis count for a gamepad 413 | // C.GetGamepadAxisCount - Return gamepad axis count for a gamepad 414 | fn C.GetGamepadAxisCount(c_gamepad int) int 415 | 416 | // C Original: RLAPI float GetGamepadAxisMovement(int gamepad, int axis); // Return axis movement value for a gamepad axis 417 | // C.GetGamepadAxisMovement - Return axis movement value for a gamepad axis 418 | fn C.GetGamepadAxisMovement(c_gamepad int, c_axis int) f32 419 | 420 | // C Original: RLAPI bool IsMouseButtonPressed(int button); // Detect if a mouse button has been pressed once 421 | // C.IsMouseButtonPressed - Detect if a mouse button has been pressed once 422 | fn C.IsMouseButtonPressed(c_button int) bool 423 | 424 | // C Original: RLAPI bool IsMouseButtonDown(int button); // Detect if a mouse button is being pressed 425 | // C.IsMouseButtonDown - Detect if a mouse button is being pressed 426 | fn C.IsMouseButtonDown(c_button int) bool 427 | 428 | // C Original: RLAPI bool IsMouseButtonReleased(int button); // Detect if a mouse button has been released once 429 | // C.IsMouseButtonReleased - Detect if a mouse button has been released once 430 | fn C.IsMouseButtonReleased(c_button int) bool 431 | 432 | // C Original: RLAPI bool IsMouseButtonUp(int button); // Detect if a mouse button is NOT being pressed 433 | // C.IsMouseButtonUp - Detect if a mouse button is NOT being pressed 434 | fn C.IsMouseButtonUp(c_button int) bool 435 | 436 | // C Original: RLAPI int GetMouseX(void); // Returns mouse position X 437 | // C.GetMouseX - Returns mouse position X 438 | fn C.GetMouseX() int 439 | 440 | // C Original: RLAPI int GetMouseY(void); // Returns mouse position Y 441 | // C.GetMouseY - Returns mouse position Y 442 | fn C.GetMouseY() int 443 | 444 | // C Original: RLAPI Vector2 GetMousePosition(void); // Returns mouse position XY 445 | // C.GetMousePosition - Returns mouse position XY 446 | fn C.GetMousePosition() C.Vector2 447 | 448 | // C Original: RLAPI void SetMousePosition(int x, int y); // Set mouse position XY 449 | // C.SetMousePosition - Set mouse position XY 450 | fn C.SetMousePosition(c_x int, c_y int) 451 | 452 | // C Original: RLAPI void SetMouseOffset(int offsetX, int offsetY); // Set mouse offset 453 | // C.SetMouseOffset - Set mouse offset 454 | fn C.SetMouseOffset(c_offsetX int, c_offsetY int) 455 | 456 | // C Original: RLAPI void SetMouseScale(float scaleX, float scaleY); // Set mouse scaling 457 | // C.SetMouseScale - Set mouse scaling 458 | fn C.SetMouseScale(c_scaleX f32, c_scaleY f32) 459 | 460 | // C Original: RLAPI int GetMouseWheelMove(void); // Returns mouse wheel movement Y 461 | // C.GetMouseWheelMove - Returns mouse wheel movement Y 462 | fn C.GetMouseWheelMove() int 463 | 464 | // C Original: RLAPI int GetTouchX(void); // Returns touch position X for touch point 0 (relative to screen size) 465 | // C.GetTouchX - Returns touch position X for touch point 0 (relative to screen size) 466 | fn C.GetTouchX() int 467 | 468 | // C Original: RLAPI int GetTouchY(void); // Returns touch position Y for touch point 0 (relative to screen size) 469 | // C.GetTouchY - Returns touch position Y for touch point 0 (relative to screen size) 470 | fn C.GetTouchY() int 471 | 472 | // C Original: RLAPI Vector2 GetTouchPosition(int index); // Returns touch position XY for a touch point index (relative to screen size) 473 | // C.GetTouchPosition - Returns touch position XY for a touch point index (relative to screen size) 474 | fn C.GetTouchPosition(c_index int) C.Vector2 475 | 476 | // C Original: RLAPI void SetGesturesEnabled(unsigned int gestureFlags); // Enable a set of gestures using flags 477 | // C.SetGesturesEnabled - Enable a set of gestures using flags 478 | fn C.SetGesturesEnabled(c_gestureFlags u32) 479 | 480 | // C Original: RLAPI bool IsGestureDetected(int gesture); // Check if a gesture have been detected 481 | // C.IsGestureDetected - Check if a gesture have been detected 482 | fn C.IsGestureDetected(c_gesture int) bool 483 | 484 | // C Original: RLAPI int GetGestureDetected(void); // Get latest detected gesture 485 | // C.GetGestureDetected - Get latest detected gesture 486 | fn C.GetGestureDetected() int 487 | 488 | // C Original: RLAPI int GetTouchPointsCount(void); // Get touch points count 489 | // C.GetTouchPointsCount - Get touch points count 490 | fn C.GetTouchPointsCount() int 491 | 492 | // C Original: RLAPI float GetGestureHoldDuration(void); // Get gesture hold time in milliseconds 493 | // C.GetGestureHoldDuration - Get gesture hold time in milliseconds 494 | fn C.GetGestureHoldDuration() f32 495 | 496 | // C Original: RLAPI Vector2 GetGestureDragVector(void); // Get gesture drag vector 497 | // C.GetGestureDragVector - Get gesture drag vector 498 | fn C.GetGestureDragVector() C.Vector2 499 | 500 | // C Original: RLAPI float GetGestureDragAngle(void); // Get gesture drag angle 501 | // C.GetGestureDragAngle - Get gesture drag angle 502 | fn C.GetGestureDragAngle() f32 503 | 504 | // C Original: RLAPI Vector2 GetGesturePinchVector(void); // Get gesture pinch delta 505 | // C.GetGesturePinchVector - Get gesture pinch delta 506 | fn C.GetGesturePinchVector() C.Vector2 507 | 508 | // C Original: RLAPI float GetGesturePinchAngle(void); // Get gesture pinch angle 509 | // C.GetGesturePinchAngle - Get gesture pinch angle 510 | fn C.GetGesturePinchAngle() f32 511 | 512 | // C Original: RLAPI void SetCameraMode(Camera camera, int mode); // Set camera mode (multiple camera modes available) 513 | // C.SetCameraMode - Set camera mode (multiple camera modes available) 514 | fn C.SetCameraMode(c_camera C.Camera, c_mode int) 515 | 516 | // C Original: RLAPI void UpdateCamera(Camera *camera); // Update camera position for selected mode 517 | // C.UpdateCamera - Update camera position for selected mode 518 | fn C.UpdateCamera(c_camera &C.Camera ) 519 | 520 | // C Original: RLAPI void SetCameraPanControl(int panKey); // Set camera pan key to combine with mouse movement (free camera) 521 | // C.SetCameraPanControl - Set camera pan key to combine with mouse movement (free camera) 522 | fn C.SetCameraPanControl(c_panKey int) 523 | 524 | // C Original: RLAPI void SetCameraAltControl(int altKey); // Set camera alt key to combine with mouse movement (free camera) 525 | // C.SetCameraAltControl - Set camera alt key to combine with mouse movement (free camera) 526 | fn C.SetCameraAltControl(c_altKey int) 527 | 528 | // C Original: RLAPI void SetCameraSmoothZoomControl(int szKey); // Set camera smooth zoom key to combine with mouse (free camera) 529 | // C.SetCameraSmoothZoomControl - Set camera smooth zoom key to combine with mouse (free camera) 530 | fn C.SetCameraSmoothZoomControl(c_szKey int) 531 | 532 | // C Original: RLAPI void SetCameraMoveControls(int frontKey, int backKey, int rightKey, int leftKey, int upKey, int downKey); // Set camera move controls (1st person and 3rd person cameras) 533 | // C.SetCameraMoveControls - Set camera move controls (1st person and 3rd person cameras) 534 | fn C.SetCameraMoveControls(c_frontKey int, c_backKey int, c_rightKey int, c_leftKey int, c_upKey int, c_downKey int) 535 | 536 | // C Original: RLAPI void DrawPixel(int posX, int posY, Color color); // Draw a pixel 537 | // C.DrawPixel - Draw a pixel 538 | fn C.DrawPixel(c_posX int, c_posY int, c_color C.Color) 539 | 540 | // C Original: RLAPI void DrawPixelV(Vector2 position, Color color); // Draw a pixel (Vector version) 541 | // C.DrawPixelV - Draw a pixel (Vector version) 542 | fn C.DrawPixelV(c_position C.Vector2, c_color C.Color) 543 | 544 | // C Original: RLAPI void DrawLine(int startPosX, int startPosY, int endPosX, int endPosY, Color color); // Draw a line 545 | // C.DrawLine - Draw a line 546 | fn C.DrawLine(c_startPosX int, c_startPosY int, c_endPosX int, c_endPosY int, c_color C.Color) 547 | 548 | // C Original: RLAPI void DrawLineV(Vector2 startPos, Vector2 endPos, Color color); // Draw a line (Vector version) 549 | // C.DrawLineV - Draw a line (Vector version) 550 | fn C.DrawLineV(c_startPos C.Vector2, c_endPos C.Vector2, c_color C.Color) 551 | 552 | // C Original: RLAPI void DrawLineEx(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line defining thickness 553 | // C.DrawLineEx - Draw a line defining thickness 554 | fn C.DrawLineEx(c_startPos C.Vector2, c_endPos C.Vector2, c_thick f32, c_color C.Color) 555 | 556 | // C Original: RLAPI void DrawLineBezier(Vector2 startPos, Vector2 endPos, float thick, Color color); // Draw a line using cubic-bezier curves in-out 557 | // C.DrawLineBezier - Draw a line using cubic-bezier curves in-out 558 | fn C.DrawLineBezier(c_startPos C.Vector2, c_endPos C.Vector2, c_thick f32, c_color C.Color) 559 | 560 | // C Original: RLAPI void DrawLineStrip(Vector2 *points, int numPoints, Color color); // Draw lines sequence 561 | // C.DrawLineStrip - Draw lines sequence 562 | fn C.DrawLineStrip(c_points &C.Vector2 , c_numPoints int, c_color C.Color) 563 | 564 | // C Original: RLAPI void DrawCircle(int centerX, int centerY, float radius, Color color); // Draw a color-filled circle 565 | // C.DrawCircle - Draw a color-filled circle 566 | fn C.DrawCircle(c_centerX int, c_centerY int, c_radius f32, c_color C.Color) 567 | 568 | // C Original: RLAPI void DrawCircleSector(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw a piece of a circle 569 | // C.DrawCircleSector - Draw a piece of a circle 570 | fn C.DrawCircleSector(c_center C.Vector2, c_radius f32, c_startAngle int, c_endAngle int, c_segments int, c_color C.Color) 571 | 572 | // C Original: RLAPI void DrawCircleSectorLines(Vector2 center, float radius, int startAngle, int endAngle, int segments, Color color); // Draw circle sector outline 573 | // C.DrawCircleSectorLines - Draw circle sector outline 574 | fn C.DrawCircleSectorLines(c_center C.Vector2, c_radius f32, c_startAngle int, c_endAngle int, c_segments int, c_color C.Color) 575 | 576 | // C Original: RLAPI void DrawCircleGradient(int centerX, int centerY, float radius, Color color1, Color color2); // Draw a gradient-filled circle 577 | // C.DrawCircleGradient - Draw a gradient-filled circle 578 | fn C.DrawCircleGradient(c_centerX int, c_centerY int, c_radius f32, c_color1 C.Color, c_color2 C.Color) 579 | 580 | // C Original: RLAPI void DrawCircleV(Vector2 center, float radius, Color color); // Draw a color-filled circle (Vector version) 581 | // C.DrawCircleV - Draw a color-filled circle (Vector version) 582 | fn C.DrawCircleV(c_center C.Vector2, c_radius f32, c_color C.Color) 583 | 584 | // C Original: RLAPI void DrawCircleLines(int centerX, int centerY, float radius, Color color); // Draw circle outline 585 | // C.DrawCircleLines - Draw circle outline 586 | fn C.DrawCircleLines(c_centerX int, c_centerY int, c_radius f32, c_color C.Color) 587 | 588 | // C Original: RLAPI void DrawRing(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring 589 | // C.DrawRing - Draw ring 590 | fn C.DrawRing(c_center C.Vector2, c_innerRadius f32, c_outerRadius f32, c_startAngle int, c_endAngle int, c_segments int, c_color C.Color) 591 | 592 | // C Original: RLAPI void DrawRingLines(Vector2 center, float innerRadius, float outerRadius, int startAngle, int endAngle, int segments, Color color); // Draw ring outline 593 | // C.DrawRingLines - Draw ring outline 594 | fn C.DrawRingLines(c_center C.Vector2, c_innerRadius f32, c_outerRadius f32, c_startAngle int, c_endAngle int, c_segments int, c_color C.Color) 595 | 596 | // C Original: RLAPI void DrawRectangle(int posX, int posY, int width, int height, Color color); // Draw a color-filled rectangle 597 | // C.DrawRectangle - Draw a color-filled rectangle 598 | fn C.DrawRectangle(c_posX int, c_posY int, c_width int, c_height int, c_color C.Color) 599 | 600 | // C Original: RLAPI void DrawRectangleV(Vector2 position, Vector2 size, Color color); // Draw a color-filled rectangle (Vector version) 601 | // C.DrawRectangleV - Draw a color-filled rectangle (Vector version) 602 | fn C.DrawRectangleV(c_position C.Vector2, c_size C.Vector2, c_color C.Color) 603 | 604 | // C Original: RLAPI void DrawRectangleRec(Rectangle rec, Color color); // Draw a color-filled rectangle 605 | // C.DrawRectangleRec - Draw a color-filled rectangle 606 | fn C.DrawRectangleRec(c_rec C.Rectangle, c_color C.Color) 607 | 608 | // C Original: RLAPI void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color); // Draw a color-filled rectangle with pro parameters 609 | // C.DrawRectanglePro - Draw a color-filled rectangle with pro parameters 610 | fn C.DrawRectanglePro(c_rec C.Rectangle, c_origin C.Vector2, c_rotation f32, c_color C.Color) 611 | 612 | // C Original: RLAPI void DrawRectangleGradientV(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a vertical-gradient-filled rectangle 613 | // C.DrawRectangleGradientV - Draw a vertical-gradient-filled rectangle 614 | fn C.DrawRectangleGradientV(c_posX int, c_posY int, c_width int, c_height int, c_color1 C.Color, c_color2 C.Color) 615 | 616 | // C Original: RLAPI void DrawRectangleGradientH(int posX, int posY, int width, int height, Color color1, Color color2);// Draw a horizontal-gradient-filled rectangle 617 | // C.DrawRectangleGradientH - Draw a horizontal-gradient-filled rectangle 618 | fn C.DrawRectangleGradientH(c_posX int, c_posY int, c_width int, c_height int, c_color1 C.Color, c_color2 C.Color) 619 | 620 | // C Original: RLAPI void DrawRectangleGradientEx(Rectangle rec, Color col1, Color col2, Color col3, Color col4); // Draw a gradient-filled rectangle with custom vertex colors 621 | // C.DrawRectangleGradientEx - Draw a gradient-filled rectangle with custom vertex colors 622 | fn C.DrawRectangleGradientEx(c_rec C.Rectangle, c_col1 C.Color, c_col2 C.Color, c_col3 C.Color, c_col4 C.Color) 623 | 624 | // C Original: RLAPI void DrawRectangleLines(int posX, int posY, int width, int height, Color color); // Draw rectangle outline 625 | // C.DrawRectangleLines - Draw rectangle outline 626 | fn C.DrawRectangleLines(c_posX int, c_posY int, c_width int, c_height int, c_color C.Color) 627 | 628 | // C Original: RLAPI void DrawRectangleLinesEx(Rectangle rec, int lineThick, Color color); // Draw rectangle outline with extended parameters 629 | // C.DrawRectangleLinesEx - Draw rectangle outline with extended parameters 630 | fn C.DrawRectangleLinesEx(c_rec C.Rectangle, c_lineThick int, c_color C.Color) 631 | 632 | // C Original: RLAPI void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color color); // Draw rectangle with rounded edges 633 | // C.DrawRectangleRounded - Draw rectangle with rounded edges 634 | fn C.DrawRectangleRounded(c_rec C.Rectangle, c_roundness f32, c_segments int, c_color C.Color) 635 | 636 | // C Original: RLAPI void DrawRectangleRoundedLines(Rectangle rec, float roundness, int segments, int lineThick, Color color); // Draw rectangle with rounded edges outline 637 | // C.DrawRectangleRoundedLines - Draw rectangle with rounded edges outline 638 | fn C.DrawRectangleRoundedLines(c_rec C.Rectangle, c_roundness f32, c_segments int, c_lineThick int, c_color C.Color) 639 | 640 | // C Original: RLAPI void DrawTriangle(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw a color-filled triangle (vertex in counter-clockwise order!) 641 | // C.DrawTriangle - Draw a color-filled triangle (vertex in counter-clockwise order!) 642 | fn C.DrawTriangle(c_v1 C.Vector2, c_v2 C.Vector2, c_v3 C.Vector2, c_color C.Color) 643 | 644 | // C Original: RLAPI void DrawTriangleLines(Vector2 v1, Vector2 v2, Vector2 v3, Color color); // Draw triangle outline (vertex in counter-clockwise order!) 645 | // C.DrawTriangleLines - Draw triangle outline (vertex in counter-clockwise order!) 646 | fn C.DrawTriangleLines(c_v1 C.Vector2, c_v2 C.Vector2, c_v3 C.Vector2, c_color C.Color) 647 | 648 | // C Original: RLAPI void DrawTriangleFan(Vector2 *points, int numPoints, Color color); // Draw a triangle fan defined by points (first vertex is the center) 649 | // C.DrawTriangleFan - Draw a triangle fan defined by points (first vertex is the center) 650 | fn C.DrawTriangleFan(c_points &C.Vector2 , c_numPoints int, c_color C.Color) 651 | 652 | // C Original: RLAPI void DrawTriangleStrip(Vector2 *points, int pointsCount, Color color); // Draw a triangle strip defined by points 653 | // C.DrawTriangleStrip - Draw a triangle strip defined by points 654 | fn C.DrawTriangleStrip(c_points &C.Vector2 , c_pointsCount int, c_color C.Color) 655 | 656 | // C Original: RLAPI void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color color); // Draw a regular polygon (Vector version) 657 | // C.DrawPoly - Draw a regular polygon (Vector version) 658 | fn C.DrawPoly(c_center C.Vector2, c_sides int, c_radius f32, c_rotation f32, c_color C.Color) 659 | 660 | // C Original: RLAPI void SetShapesTexture(Texture2D texture, Rectangle source); // Define default texture used to draw shapes 661 | // C.SetShapesTexture - Define default texture used to draw shapes 662 | fn C.SetShapesTexture(c_texture C.Texture2D, c_source C.Rectangle) 663 | 664 | // C Original: RLAPI bool CheckCollisionRecs(Rectangle rec1, Rectangle rec2); // Check collision between two rectangles 665 | // C.CheckCollisionRecs - Check collision between two rectangles 666 | fn C.CheckCollisionRecs(c_rec1 C.Rectangle, c_rec2 C.Rectangle) bool 667 | 668 | // C Original: RLAPI bool CheckCollisionCircles(Vector2 center1, float radius1, Vector2 center2, float radius2); // Check collision between two circles 669 | // C.CheckCollisionCircles - Check collision between two circles 670 | fn C.CheckCollisionCircles(c_center1 C.Vector2, c_radius1 f32, c_center2 C.Vector2, c_radius2 f32) bool 671 | 672 | // C Original: RLAPI bool CheckCollisionCircleRec(Vector2 center, float radius, Rectangle rec); // Check collision between circle and rectangle 673 | // C.CheckCollisionCircleRec - Check collision between circle and rectangle 674 | fn C.CheckCollisionCircleRec(c_center C.Vector2, c_radius f32, c_rec C.Rectangle) bool 675 | 676 | // C Original: RLAPI Rectangle GetCollisionRec(Rectangle rec1, Rectangle rec2); // Get collision rectangle for two rectangles collision 677 | // C.GetCollisionRec - Get collision rectangle for two rectangles collision 678 | fn C.GetCollisionRec(c_rec1 C.Rectangle, c_rec2 C.Rectangle) C.Rectangle 679 | 680 | // C Original: RLAPI bool CheckCollisionPointRec(Vector2 point, Rectangle rec); // Check if point is inside rectangle 681 | // C.CheckCollisionPointRec - Check if point is inside rectangle 682 | fn C.CheckCollisionPointRec(c_point C.Vector2, c_rec C.Rectangle) bool 683 | 684 | // C Original: RLAPI bool CheckCollisionPointCircle(Vector2 point, Vector2 center, float radius); // Check if point is inside circle 685 | // C.CheckCollisionPointCircle - Check if point is inside circle 686 | fn C.CheckCollisionPointCircle(c_point C.Vector2, c_center C.Vector2, c_radius f32) bool 687 | 688 | // C Original: RLAPI bool CheckCollisionPointTriangle(Vector2 point, Vector2 p1, Vector2 p2, Vector2 p3); // Check if point is inside a triangle 689 | // C.CheckCollisionPointTriangle - Check if point is inside a triangle 690 | fn C.CheckCollisionPointTriangle(c_point C.Vector2, c_p1 C.Vector2, c_p2 C.Vector2, c_p3 C.Vector2) bool 691 | 692 | // C Original: RLAPI Image LoadImage(const char *fileName); // Load image from file into CPU memory (RAM) 693 | // C.LoadImage - Load image from file into CPU memory (RAM) 694 | fn C.LoadImage(c_fileName charptr) C.Image 695 | 696 | // C Original: RLAPI Image LoadImageEx(Color *pixels, int width, int height); // Load image from Color array data (RGBA - 32bit) 697 | // C.LoadImageEx - Load image from Color array data (RGBA - 32bit) 698 | fn C.LoadImageEx(c_pixels &C.Color , c_width int, c_height int) C.Image 699 | 700 | // C Original: RLAPI Image LoadImagePro(void *data, int width, int height, int format); // Load image from raw data with parameters 701 | // C.LoadImagePro - Load image from raw data with parameters 702 | fn C.LoadImagePro(c_data voidptr, c_width int, c_height int, c_format int) C.Image 703 | 704 | // C Original: RLAPI Image LoadImageRaw(const char *fileName, int width, int height, int format, int headerSize); // Load image from RAW file data 705 | // C.LoadImageRaw - Load image from RAW file data 706 | fn C.LoadImageRaw(c_fileName charptr, c_width int, c_height int, c_format int, c_headerSize int) C.Image 707 | 708 | // C Original: RLAPI void ExportImage(Image image, const char *fileName); // Export image data to file 709 | // C.ExportImage - Export image data to file 710 | fn C.ExportImage(c_image C.Image, c_fileName charptr) 711 | 712 | // C Original: RLAPI void ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes 713 | // C.ExportImageAsCode - Export image as code file defining an array of bytes 714 | fn C.ExportImageAsCode(c_image C.Image, c_fileName charptr) 715 | 716 | // C Original: RLAPI Texture2D LoadTexture(const char *fileName); // Load texture from file into GPU memory (VRAM) 717 | // C.LoadTexture - Load texture from file into GPU memory (VRAM) 718 | fn C.LoadTexture(c_fileName charptr) C.Texture2D 719 | 720 | // C Original: RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data 721 | // C.LoadTextureFromImage - Load texture from image data 722 | fn C.LoadTextureFromImage(c_image C.Image) C.Texture2D 723 | 724 | // C Original: RLAPI TextureCubemap LoadTextureCubemap(Image image, int layoutType); // Load cubemap from image, multiple image cubemap layouts supported 725 | // C.LoadTextureCubemap - Load cubemap from image, multiple image cubemap layouts supported 726 | fn C.LoadTextureCubemap(c_image C.Image, c_layoutType int) C.TextureCubemap 727 | 728 | // C Original: RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) 729 | // C.LoadRenderTexture - Load texture for rendering (framebuffer) 730 | fn C.LoadRenderTexture(c_width int, c_height int) C.RenderTexture2D 731 | 732 | // C Original: RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) 733 | // C.UnloadImage - Unload image from CPU memory (RAM) 734 | fn C.UnloadImage(c_image C.Image) 735 | 736 | // C Original: RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) 737 | // C.UnloadTexture - Unload texture from GPU memory (VRAM) 738 | fn C.UnloadTexture(c_texture C.Texture2D) 739 | 740 | // C Original: RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) 741 | // C.UnloadRenderTexture - Unload render texture from GPU memory (VRAM) 742 | fn C.UnloadRenderTexture(c_target C.RenderTexture2D) 743 | 744 | // C Original: RLAPI Color *GetImageData(Image image); // Get pixel data from image as a Color struct array 745 | // C.GetImageData - Get pixel data from image as a Color struct array 746 | fn C.GetImageData(c_image C.Image) &C.Color 747 | 748 | // C Original: RLAPI Vector4 *GetImageDataNormalized(Image image); // Get pixel data from image as Vector4 array (float normalized) 749 | // C.GetImageDataNormalized - Get pixel data from image as Vector4 array (float normalized) 750 | fn C.GetImageDataNormalized(c_image C.Image) &C.Vector4 751 | 752 | // C Original: RLAPI Rectangle GetImageAlphaBorder(Image image, float threshold); // Get image alpha border rectangle 753 | // C.GetImageAlphaBorder - Get image alpha border rectangle 754 | fn C.GetImageAlphaBorder(c_image C.Image, c_threshold f32) C.Rectangle 755 | 756 | // C Original: RLAPI int GetPixelDataSize(int width, int height, int format); // Get pixel data size in bytes (image or texture) 757 | // C.GetPixelDataSize - Get pixel data size in bytes (image or texture) 758 | fn C.GetPixelDataSize(c_width int, c_height int, c_format int) int 759 | 760 | // C Original: RLAPI Image GetTextureData(Texture2D texture); // Get pixel data from GPU texture and return an Image 761 | // C.GetTextureData - Get pixel data from GPU texture and return an Image 762 | fn C.GetTextureData(c_texture C.Texture2D) C.Image 763 | 764 | // C Original: RLAPI Image GetScreenData(void); // Get pixel data from screen buffer and return an Image (screenshot) 765 | // C.GetScreenData - Get pixel data from screen buffer and return an Image (screenshot) 766 | fn C.GetScreenData() C.Image 767 | 768 | // C Original: RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data 769 | // C.UpdateTexture - Update GPU texture with new data 770 | fn C.UpdateTexture(c_texture C.Texture2D, c_pixels voidptr) 771 | 772 | // C Original: RLAPI Image ImageCopy(Image image); // Create an image duplicate (useful for transformations) 773 | // C.ImageCopy - Create an image duplicate (useful for transformations) 774 | fn C.ImageCopy(c_image C.Image) C.Image 775 | 776 | // C Original: RLAPI Image ImageFromImage(Image image, Rectangle rec); // Create an image from another image piece 777 | // C.ImageFromImage - Create an image from another image piece 778 | fn C.ImageFromImage(c_image C.Image, c_rec C.Rectangle) C.Image 779 | 780 | // C Original: RLAPI void ImageToPOT(Image *image, Color fillColor); // Convert image to POT (power-of-two) 781 | // C.ImageToPOT - Convert image to POT (power-of-two) 782 | fn C.ImageToPOT(c_image &C.Image , c_fillColor C.Color) 783 | 784 | // C Original: RLAPI void ImageFormat(Image *image, int newFormat); // Convert image data to desired format 785 | // C.ImageFormat - Convert image data to desired format 786 | fn C.ImageFormat(c_image &C.Image , c_newFormat int) 787 | 788 | // C Original: RLAPI void ImageAlphaMask(Image *image, Image alphaMask); // Apply alpha mask to image 789 | // C.ImageAlphaMask - Apply alpha mask to image 790 | fn C.ImageAlphaMask(c_image &C.Image , c_alphaMask C.Image) 791 | 792 | // C Original: RLAPI void ImageAlphaClear(Image *image, Color color, float threshold); // Clear alpha channel to desired color 793 | // C.ImageAlphaClear - Clear alpha channel to desired color 794 | fn C.ImageAlphaClear(c_image &C.Image , c_color C.Color, c_threshold f32) 795 | 796 | // C Original: RLAPI void ImageAlphaCrop(Image *image, float threshold); // Crop image depending on alpha value 797 | // C.ImageAlphaCrop - Crop image depending on alpha value 798 | fn C.ImageAlphaCrop(c_image &C.Image , c_threshold f32) 799 | 800 | // C Original: RLAPI void ImageAlphaPremultiply(Image *image); // Premultiply alpha channel 801 | // C.ImageAlphaPremultiply - Premultiply alpha channel 802 | fn C.ImageAlphaPremultiply(c_image &C.Image ) 803 | 804 | // C Original: RLAPI void ImageCrop(Image *image, Rectangle crop); // Crop an image to a defined rectangle 805 | // C.ImageCrop - Crop an image to a defined rectangle 806 | fn C.ImageCrop(c_image &C.Image , c_crop C.Rectangle) 807 | 808 | // C Original: RLAPI void ImageResize(Image *image, int newWidth, int newHeight); // Resize image (Bicubic scaling algorithm) 809 | // C.ImageResize - Resize image (Bicubic scaling algorithm) 810 | fn C.ImageResize(c_image &C.Image , c_newWidth int, c_newHeight int) 811 | 812 | // C Original: RLAPI void ImageResizeNN(Image *image, int newWidth,int newHeight); // Resize image (Nearest-Neighbor scaling algorithm) 813 | // C.ImageResizeNN - Resize image (Nearest-Neighbor scaling algorithm) 814 | fn C.ImageResizeNN(c_image &C.Image , c_newWidth int, c_newHeight int) 815 | 816 | // C Original: RLAPI void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color); // Resize canvas and fill with color 817 | // C.ImageResizeCanvas - Resize canvas and fill with color 818 | fn C.ImageResizeCanvas(c_image &C.Image , c_newWidth int, c_newHeight int, c_offsetX int, c_offsetY int, c_color C.Color) 819 | 820 | // C Original: RLAPI void ImageMipmaps(Image *image); // Generate all mipmap levels for a provided image 821 | // C.ImageMipmaps - Generate all mipmap levels for a provided image 822 | fn C.ImageMipmaps(c_image &C.Image ) 823 | 824 | // C Original: RLAPI void ImageDither(Image *image, int rBpp, int gBpp, int bBpp, int aBpp); // Dither image data to 16bpp or lower (Floyd-Steinberg dithering) 825 | // C.ImageDither - Dither image data to 16bpp or lower (Floyd-Steinberg dithering) 826 | fn C.ImageDither(c_image &C.Image , c_rBpp int, c_gBpp int, c_bBpp int, c_aBpp int) 827 | 828 | // C Original: RLAPI Color *ImageExtractPalette(Image image, int maxPaletteSize, int *extractCount); // Extract color palette from image to maximum size (memory should be freed) 829 | // C.ImageExtractPalette - Extract color palette from image to maximum size (memory should be freed) 830 | fn C.ImageExtractPalette(c_image C.Image, c_maxPaletteSize int, c_extractCount &int) &C.Color 831 | 832 | // C Original: RLAPI Image ImageText(const char *text, int fontSize, Color color); // Create an image from text (default font) 833 | // C.ImageText - Create an image from text (default font) 834 | fn C.ImageText(c_text charptr, c_fontSize int, c_color C.Color) C.Image 835 | 836 | // C Original: RLAPI Image ImageTextEx(Font font, const char *text, float fontSize, float spacing, Color tint); // Create an image from text (custom sprite font) 837 | // C.ImageTextEx - Create an image from text (custom sprite font) 838 | fn C.ImageTextEx(c_font C.Font, c_text charptr, c_fontSize f32, c_spacing f32, c_tint C.Color) C.Image 839 | 840 | // C Original: RLAPI void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color tint); // Draw a source image within a destination image (tint applied to source) 841 | // C.ImageDraw - Draw a source image within a destination image (tint applied to source) 842 | fn C.ImageDraw(c_dst &C.Image , c_src C.Image, c_srcRec C.Rectangle, c_dstRec C.Rectangle, c_tint C.Color) 843 | 844 | // C Original: RLAPI void ImageDrawRectangle(Image *dst, Rectangle rec, Color color); // Draw rectangle within an image 845 | // C.ImageDrawRectangle - Draw rectangle within an image 846 | fn C.ImageDrawRectangle(c_dst &C.Image , c_rec C.Rectangle, c_color C.Color) 847 | 848 | // C Original: RLAPI void ImageDrawRectangleLines(Image *dst, Rectangle rec, int thick, Color color); // Draw rectangle lines within an image 849 | // C.ImageDrawRectangleLines - Draw rectangle lines within an image 850 | fn C.ImageDrawRectangleLines(c_dst &C.Image , c_rec C.Rectangle, c_thick int, c_color C.Color) 851 | 852 | // C Original: RLAPI void ImageDrawText(Image *dst, Vector2 position, const char *text, int fontSize, Color color); // Draw text (default font) within an image (destination) 853 | // C.ImageDrawText - Draw text (default font) within an image (destination) 854 | fn C.ImageDrawText(c_dst &C.Image , c_position C.Vector2, c_text charptr, c_fontSize int, c_color C.Color) 855 | 856 | // C Original: RLAPI void ImageDrawTextEx(Image *dst, Vector2 position, Font font, const char *text, float fontSize, float spacing, Color color); // Draw text (custom sprite font) within an image (destination) 857 | // C.ImageDrawTextEx - Draw text (custom sprite font) within an image (destination) 858 | fn C.ImageDrawTextEx(c_dst &C.Image , c_position C.Vector2, c_font C.Font, c_text charptr, c_fontSize f32, c_spacing f32, c_color C.Color) 859 | 860 | // C Original: RLAPI void ImageFlipVertical(Image *image); // Flip image vertically 861 | // C.ImageFlipVertical - Flip image vertically 862 | fn C.ImageFlipVertical(c_image &C.Image ) 863 | 864 | // C Original: RLAPI void ImageFlipHorizontal(Image *image); // Flip image horizontally 865 | // C.ImageFlipHorizontal - Flip image horizontally 866 | fn C.ImageFlipHorizontal(c_image &C.Image ) 867 | 868 | // C Original: RLAPI void ImageRotateCW(Image *image); // Rotate image clockwise 90deg 869 | // C.ImageRotateCW - Rotate image clockwise 90deg 870 | fn C.ImageRotateCW(c_image &C.Image ) 871 | 872 | // C Original: RLAPI void ImageRotateCCW(Image *image); // Rotate image counter-clockwise 90deg 873 | // C.ImageRotateCCW - Rotate image counter-clockwise 90deg 874 | fn C.ImageRotateCCW(c_image &C.Image ) 875 | 876 | // C Original: RLAPI void ImageColorTint(Image *image, Color color); // Modify image color: tint 877 | // C.ImageColorTint - Modify image color: tint 878 | fn C.ImageColorTint(c_image &C.Image , c_color C.Color) 879 | 880 | // C Original: RLAPI void ImageColorInvert(Image *image); // Modify image color: invert 881 | // C.ImageColorInvert - Modify image color: invert 882 | fn C.ImageColorInvert(c_image &C.Image ) 883 | 884 | // C Original: RLAPI void ImageColorGrayscale(Image *image); // Modify image color: grayscale 885 | // C.ImageColorGrayscale - Modify image color: grayscale 886 | fn C.ImageColorGrayscale(c_image &C.Image ) 887 | 888 | // C Original: RLAPI void ImageColorContrast(Image *image, float contrast); // Modify image color: contrast (-100 to 100) 889 | // C.ImageColorContrast - Modify image color: contrast (-100 to 100) 890 | fn C.ImageColorContrast(c_image &C.Image , c_contrast f32) 891 | 892 | // C Original: RLAPI void ImageColorBrightness(Image *image, int brightness); // Modify image color: brightness (-255 to 255) 893 | // C.ImageColorBrightness - Modify image color: brightness (-255 to 255) 894 | fn C.ImageColorBrightness(c_image &C.Image , c_brightness int) 895 | 896 | // C Original: RLAPI void ImageColorReplace(Image *image, Color color, Color replace); // Modify image color: replace color 897 | // C.ImageColorReplace - Modify image color: replace color 898 | fn C.ImageColorReplace(c_image &C.Image , c_color C.Color, c_replace C.Color) 899 | 900 | // C Original: RLAPI Image GenImageColor(int width, int height, Color color); // Generate image: plain color 901 | // C.GenImageColor - Generate image: plain color 902 | fn C.GenImageColor(c_width int, c_height int, c_color C.Color) C.Image 903 | 904 | // C Original: RLAPI Image GenImageGradientV(int width, int height, Color top, Color bottom); // Generate image: vertical gradient 905 | // C.GenImageGradientV - Generate image: vertical gradient 906 | fn C.GenImageGradientV(c_width int, c_height int, c_top C.Color, c_bottom C.Color) C.Image 907 | 908 | // C Original: RLAPI Image GenImageGradientH(int width, int height, Color left, Color right); // Generate image: horizontal gradient 909 | // C.GenImageGradientH - Generate image: horizontal gradient 910 | fn C.GenImageGradientH(c_width int, c_height int, c_left C.Color, c_right C.Color) C.Image 911 | 912 | // C Original: RLAPI Image GenImageGradientRadial(int width, int height, float density, Color inner, Color outer); // Generate image: radial gradient 913 | // C.GenImageGradientRadial - Generate image: radial gradient 914 | fn C.GenImageGradientRadial(c_width int, c_height int, c_density f32, c_inner C.Color, c_outer C.Color) C.Image 915 | 916 | // C Original: RLAPI Image GenImageChecked(int width, int height, int checksX, int checksY, Color col1, Color col2); // Generate image: checked 917 | // C.GenImageChecked - Generate image: checked 918 | fn C.GenImageChecked(c_width int, c_height int, c_checksX int, c_checksY int, c_col1 C.Color, c_col2 C.Color) C.Image 919 | 920 | // C Original: RLAPI Image GenImageWhiteNoise(int width, int height, float factor); // Generate image: white noise 921 | // C.GenImageWhiteNoise - Generate image: white noise 922 | fn C.GenImageWhiteNoise(c_width int, c_height int, c_factor f32) C.Image 923 | 924 | // C Original: RLAPI Image GenImagePerlinNoise(int width, int height, int offsetX, int offsetY, float scale); // Generate image: perlin noise 925 | // C.GenImagePerlinNoise - Generate image: perlin noise 926 | fn C.GenImagePerlinNoise(c_width int, c_height int, c_offsetX int, c_offsetY int, c_scale f32) C.Image 927 | 928 | // C Original: RLAPI Image GenImageCellular(int width, int height, int tileSize); // Generate image: cellular algorithm. Bigger tileSize means bigger cells 929 | // C.GenImageCellular - Generate image: cellular algorithm. Bigger tileSize means bigger cells 930 | fn C.GenImageCellular(c_width int, c_height int, c_tileSize int) C.Image 931 | 932 | // C Original: RLAPI void GenTextureMipmaps(Texture2D *texture); // Generate GPU mipmaps for a texture 933 | // C.GenTextureMipmaps - Generate GPU mipmaps for a texture 934 | fn C.GenTextureMipmaps(c_texture &C.Texture2D ) 935 | 936 | // C Original: RLAPI void SetTextureFilter(Texture2D texture, int filterMode); // Set texture scaling filter mode 937 | // C.SetTextureFilter - Set texture scaling filter mode 938 | fn C.SetTextureFilter(c_texture C.Texture2D, c_filterMode int) 939 | 940 | // C Original: RLAPI void SetTextureWrap(Texture2D texture, int wrapMode); // Set texture wrapping mode 941 | // C.SetTextureWrap - Set texture wrapping mode 942 | fn C.SetTextureWrap(c_texture C.Texture2D, c_wrapMode int) 943 | 944 | // C Original: RLAPI void DrawTexture(Texture2D texture, int posX, int posY, Color tint); // Draw a Texture2D 945 | // C.DrawTexture - Draw a Texture2D 946 | fn C.DrawTexture(c_texture C.Texture2D, c_posX int, c_posY int, c_tint C.Color) 947 | 948 | // C Original: RLAPI void DrawTextureV(Texture2D texture, Vector2 position, Color tint); // Draw a Texture2D with position defined as Vector2 949 | // C.DrawTextureV - Draw a Texture2D with position defined as Vector2 950 | fn C.DrawTextureV(c_texture C.Texture2D, c_position C.Vector2, c_tint C.Color) 951 | 952 | // C Original: RLAPI void DrawTextureEx(Texture2D texture, Vector2 position, float rotation, float scale, Color tint); // Draw a Texture2D with extended parameters 953 | // C.DrawTextureEx - Draw a Texture2D with extended parameters 954 | fn C.DrawTextureEx(c_texture C.Texture2D, c_position C.Vector2, c_rotation f32, c_scale f32, c_tint C.Color) 955 | 956 | // C Original: RLAPI void DrawTextureRec(Texture2D texture, Rectangle sourceRec, Vector2 position, Color tint); // Draw a part of a texture defined by a rectangle 957 | // C.DrawTextureRec - Draw a part of a texture defined by a rectangle 958 | fn C.DrawTextureRec(c_texture C.Texture2D, c_sourceRec C.Rectangle, c_position C.Vector2, c_tint C.Color) 959 | 960 | // C Original: RLAPI void DrawTextureQuad(Texture2D texture, Vector2 tiling, Vector2 offset, Rectangle quad, Color tint); // Draw texture quad with tiling and offset parameters 961 | // C.DrawTextureQuad - Draw texture quad with tiling and offset parameters 962 | fn C.DrawTextureQuad(c_texture C.Texture2D, c_tiling C.Vector2, c_offset C.Vector2, c_quad C.Rectangle, c_tint C.Color) 963 | 964 | // C Original: RLAPI void DrawTexturePro(Texture2D texture, Rectangle sourceRec, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draw a part of a texture defined by a rectangle with 'pro' parameters 965 | // C.DrawTexturePro - Draw a part of a texture defined by a rectangle with 'pro' parameters 966 | fn C.DrawTexturePro(c_texture C.Texture2D, c_sourceRec C.Rectangle, c_destRec C.Rectangle, c_origin C.Vector2, c_rotation f32, c_tint C.Color) 967 | 968 | // C Original: RLAPI void DrawTextureNPatch(Texture2D texture, NPatchInfo nPatchInfo, Rectangle destRec, Vector2 origin, float rotation, Color tint); // Draws a texture (or part of it) that stretches or shrinks nicely 969 | // C.DrawTextureNPatch - Draws a texture (or part of it) that stretches or shrinks nicely 970 | fn C.DrawTextureNPatch(c_texture C.Texture2D, c_nPatchInfo C.NPatchInfo, c_destRec C.Rectangle, c_origin C.Vector2, c_rotation f32, c_tint C.Color) 971 | 972 | // C Original: RLAPI Font GetFontDefault(void); // Get the default Font 973 | // C.GetFontDefault - Get the default Font 974 | fn C.GetFontDefault() C.Font 975 | 976 | // C Original: RLAPI Font LoadFont(const char *fileName); // Load font from file into GPU memory (VRAM) 977 | // C.LoadFont - Load font from file into GPU memory (VRAM) 978 | fn C.LoadFont(c_fileName charptr) C.Font 979 | 980 | // C Original: RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int charsCount); // Load font from file with extended parameters 981 | // C.LoadFontEx - Load font from file with extended parameters 982 | fn C.LoadFontEx(c_fileName charptr, c_fontSize int, c_fontChars &int, c_charsCount int) C.Font 983 | 984 | // C Original: RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) 985 | // C.LoadFontFromImage - Load font from Image (XNA style) 986 | fn C.LoadFontFromImage(c_image C.Image, c_key C.Color, c_firstChar int) C.Font 987 | 988 | // C Original: RLAPI CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int charsCount, int type); // Load font data for further use 989 | // C.LoadFontData - Load font data for further use 990 | fn C.LoadFontData(c_fileName charptr, c_fontSize int, c_fontChars &int, c_charsCount int, c_type int) &C.CharInfo 991 | 992 | // C Original: RLAPI Image GenImageFontAtlas(const CharInfo *chars, Rectangle **recs, int charsCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info 993 | // C.GenImageFontAtlas - Generate image font atlas using chars info 994 | fn C.GenImageFontAtlas(c_chars &CharInfo, c_recs &PRectangle, c_charsCount int, c_fontSize int, c_padding int, c_packMethod int) C.Image 995 | 996 | // C Original: RLAPI void UnloadFont(Font font); // Unload Font from GPU memory (VRAM) 997 | // C.UnloadFont - Unload Font from GPU memory (VRAM) 998 | fn C.UnloadFont(c_font C.Font) 999 | 1000 | // C Original: RLAPI void DrawFPS(int posX, int posY); // Shows current FPS 1001 | // C.DrawFPS - Shows current FPS 1002 | fn C.DrawFPS(c_posX int, c_posY int) 1003 | 1004 | // C Original: RLAPI void DrawText(const char *text, int posX, int posY, int fontSize, Color color); // Draw text (using default font) 1005 | // C.DrawText - Draw text (using default font) 1006 | fn C.DrawText(c_text charptr, c_posX int, c_posY int, c_fontSize int, c_color C.Color) 1007 | 1008 | // C Original: RLAPI void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint); // Draw text using font and additional parameters 1009 | // C.DrawTextEx - Draw text using font and additional parameters 1010 | fn C.DrawTextEx(c_font C.Font, c_text charptr, c_position C.Vector2, c_fontSize f32, c_spacing f32, c_tint C.Color) 1011 | 1012 | // C Original: RLAPI void DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // Draw text using font inside rectangle limits 1013 | // C.DrawTextRec - Draw text using font inside rectangle limits 1014 | fn C.DrawTextRec(c_font C.Font, c_text charptr, c_rec C.Rectangle, c_fontSize f32, c_spacing f32, c_wordWrap bool, c_tint C.Color) 1015 | 1016 | // C Original: RLAPI void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint,int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Draw text using font inside rectangle limits with support for text selection 1017 | // C.DrawTextRecEx - Draw text using font inside rectangle limits with support for text selection 1018 | fn C.DrawTextRecEx(c_font C.Font, c_text charptr, c_rec C.Rectangle, c_fontSize f32, c_spacing f32, c_wordWrap bool, c_tint C.Color, c_selectStart int, c_selectLength int, c_selectTint C.Color, c_selectBackTint C.Color) 1019 | 1020 | // C Original: RLAPI void DrawTextCodepoint(Font font, int codepoint, Vector2 position, float scale, Color tint); // Draw one character (codepoint) 1021 | // C.DrawTextCodepoint - Draw one character (codepoint) 1022 | fn C.DrawTextCodepoint(c_font C.Font, c_codepoint int, c_position C.Vector2, c_scale f32, c_tint C.Color) 1023 | 1024 | // C Original: RLAPI int MeasureText(const char *text, int fontSize); // Measure string width for default font 1025 | // C.MeasureText - Measure string width for default font 1026 | fn C.MeasureText(c_text charptr, c_fontSize int) int 1027 | 1028 | // C Original: RLAPI Vector2 MeasureTextEx(Font font, const char *text, float fontSize, float spacing); // Measure string size for Font 1029 | // C.MeasureTextEx - Measure string size for Font 1030 | fn C.MeasureTextEx(c_font C.Font, c_text charptr, c_fontSize f32, c_spacing f32) C.Vector2 1031 | 1032 | // C Original: RLAPI int GetGlyphIndex(Font font, int codepoint); // Get index position for a unicode character on font 1033 | // C.GetGlyphIndex - Get index position for a unicode character on font 1034 | fn C.GetGlyphIndex(c_font C.Font, c_codepoint int) int 1035 | 1036 | // C Original: RLAPI bool TextIsEqual(const char *text1, const char *text2); // Check if two text string are equal 1037 | // C.TextIsEqual - Check if two text string are equal 1038 | fn C.TextIsEqual(c_text1 charptr, c_text2 charptr) bool 1039 | 1040 | // C Original: RLAPI unsigned int TextLength(const char *text); // Get text length, checks for '\0' ending 1041 | // C.TextLength - Get text length, checks for '\0' ending 1042 | fn C.TextLength(c_text charptr) u32 1043 | 1044 | // C Original: RLAPI const char *TextFormat(const char *text, ...); // Text formatting with variables (sprintf style) 1045 | // C.TextFormat - Text formatting with variables (sprintf style) 1046 | fn C.TextFormat(c_text charptr, x ...charptr) charptr 1047 | 1048 | // C Original: RLAPI const char *TextSubtext(const char *text, int position, int length); // Get a piece of a text string 1049 | // C.TextSubtext - Get a piece of a text string 1050 | fn C.TextSubtext(c_text charptr, c_position int, c_length int) charptr 1051 | 1052 | // C Original: RLAPI char *TextReplace(char *text, const char *replace, const char *by); // Replace text string (memory must be freed!) 1053 | // C.TextReplace - Replace text string (memory must be freed!) 1054 | fn C.TextReplace(c_text &char , c_replace charptr, c_by charptr) &char 1055 | 1056 | // C Original: RLAPI char *TextInsert(const char *text, const char *insert, int position); // Insert text in a position (memory must be freed!) 1057 | // C.TextInsert - Insert text in a position (memory must be freed!) 1058 | fn C.TextInsert(c_text charptr, c_insert charptr, c_position int) &char 1059 | 1060 | // C Original: RLAPI const char *TextJoin(const char **textList, int count, const char *delimiter); // Join text strings with delimiter 1061 | // C.TextJoin - Join text strings with delimiter 1062 | fn C.TextJoin(c_textList &charptr, c_count int, c_delimiter charptr) charptr 1063 | 1064 | // C Original: RLAPI const char **TextSplit(const char *text, char delimiter, int *count); // Split text into multiple strings 1065 | // C.TextSplit - Split text into multiple strings 1066 | fn C.TextSplit(c_text charptr, c_delimiter char, c_count &int) &charptr 1067 | 1068 | // C Original: RLAPI void TextAppend(char *text, const char *append, int *position); // Append text at specific position and move cursor! 1069 | // C.TextAppend - Append text at specific position and move cursor! 1070 | fn C.TextAppend(c_text &char , c_append charptr, c_position &int) 1071 | 1072 | // C Original: RLAPI int TextFindIndex(const char *text, const char *find); // Find first text occurrence within a string 1073 | // C.TextFindIndex - Find first text occurrence within a string 1074 | fn C.TextFindIndex(c_text charptr, c_find charptr) int 1075 | 1076 | // C Original: RLAPI const char *TextToUpper(const char *text); // Get upper case version of provided string 1077 | // C.TextToUpper - Get upper case version of provided string 1078 | fn C.TextToUpper(c_text charptr) charptr 1079 | 1080 | // C Original: RLAPI const char *TextToLower(const char *text); // Get lower case version of provided string 1081 | // C.TextToLower - Get lower case version of provided string 1082 | fn C.TextToLower(c_text charptr) charptr 1083 | 1084 | // C Original: RLAPI const char *TextToPascal(const char *text); // Get Pascal case notation version of provided string 1085 | // C.TextToPascal - Get Pascal case notation version of provided string 1086 | fn C.TextToPascal(c_text charptr) charptr 1087 | 1088 | // C Original: RLAPI int TextToInteger(const char *text); // Get integer value from text (negative values not supported) 1089 | // C.TextToInteger - Get integer value from text (negative values not supported) 1090 | fn C.TextToInteger(c_text charptr) int 1091 | 1092 | // C Original: RLAPI char *TextToUtf8(int *codepoints, int length); // Encode text codepoint into utf8 text (memory must be freed!) 1093 | // C.TextToUtf8 - Encode text codepoint into utf8 text (memory must be freed!) 1094 | fn C.TextToUtf8(c_codepoints &int, c_length int) &char 1095 | 1096 | // C Original: RLAPI int *GetCodepoints(const char *text, int *count); // Get all codepoints in a string, codepoints count returned by parameters 1097 | // C.GetCodepoints - Get all codepoints in a string, codepoints count returned by parameters 1098 | fn C.GetCodepoints(c_text charptr, c_count &int) &int 1099 | 1100 | // C Original: RLAPI int GetCodepointsCount(const char *text); // Get total number of characters (codepoints) in a UTF8 encoded string 1101 | // C.GetCodepointsCount - Get total number of characters (codepoints) in a UTF8 encoded string 1102 | fn C.GetCodepointsCount(c_text charptr) int 1103 | 1104 | // C Original: RLAPI int GetNextCodepoint(const char *text, int *bytesProcessed); // Returns next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure 1105 | // C.GetNextCodepoint - Returns next codepoint in a UTF8 encoded string; 0x3f('?') is returned on failure 1106 | fn C.GetNextCodepoint(c_text charptr, c_bytesProcessed &int) int 1107 | 1108 | // C Original: RLAPI const char *CodepointToUtf8(int codepoint, int *byteLength); // Encode codepoint into utf8 text (char array length returned as parameter) 1109 | // C.CodepointToUtf8 - Encode codepoint into utf8 text (char array length returned as parameter) 1110 | fn C.CodepointToUtf8(c_codepoint int, c_byteLength &int) charptr 1111 | 1112 | // C Original: RLAPI void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color); // Draw a line in 3D world space 1113 | // C.DrawLine3D - Draw a line in 3D world space 1114 | fn C.DrawLine3D(c_startPos C.Vector3, c_endPos C.Vector3, c_color C.Color) 1115 | 1116 | // C Original: RLAPI void DrawCircle3D(Vector3 center, float radius, Vector3 rotationAxis, float rotationAngle, Color color); // Draw a circle in 3D world space 1117 | // C.DrawCircle3D - Draw a circle in 3D world space 1118 | fn C.DrawCircle3D(c_center C.Vector3, c_radius f32, c_rotationAxis C.Vector3, c_rotationAngle f32, c_color C.Color) 1119 | 1120 | // C Original: RLAPI void DrawCube(Vector3 position, float width, float height, float length, Color color); // Draw cube 1121 | // C.DrawCube - Draw cube 1122 | fn C.DrawCube(c_position C.Vector3, c_width f32, c_height f32, c_length f32, c_color C.Color) 1123 | 1124 | // C Original: RLAPI void DrawCubeV(Vector3 position, Vector3 size, Color color); // Draw cube (Vector version) 1125 | // C.DrawCubeV - Draw cube (Vector version) 1126 | fn C.DrawCubeV(c_position C.Vector3, c_size C.Vector3, c_color C.Color) 1127 | 1128 | // C Original: RLAPI void DrawCubeWires(Vector3 position, float width, float height, float length, Color color); // Draw cube wires 1129 | // C.DrawCubeWires - Draw cube wires 1130 | fn C.DrawCubeWires(c_position C.Vector3, c_width f32, c_height f32, c_length f32, c_color C.Color) 1131 | 1132 | // C Original: RLAPI void DrawCubeWiresV(Vector3 position, Vector3 size, Color color); // Draw cube wires (Vector version) 1133 | // C.DrawCubeWiresV - Draw cube wires (Vector version) 1134 | fn C.DrawCubeWiresV(c_position C.Vector3, c_size C.Vector3, c_color C.Color) 1135 | 1136 | // C Original: RLAPI void DrawCubeTexture(Texture2D texture, Vector3 position, float width, float height, float length, Color color); // Draw cube textured 1137 | // C.DrawCubeTexture - Draw cube textured 1138 | fn C.DrawCubeTexture(c_texture C.Texture2D, c_position C.Vector3, c_width f32, c_height f32, c_length f32, c_color C.Color) 1139 | 1140 | // C Original: RLAPI void DrawSphere(Vector3 centerPos, float radius, Color color); // Draw sphere 1141 | // C.DrawSphere - Draw sphere 1142 | fn C.DrawSphere(c_centerPos C.Vector3, c_radius f32, c_color C.Color) 1143 | 1144 | // C Original: RLAPI void DrawSphereEx(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere with extended parameters 1145 | // C.DrawSphereEx - Draw sphere with extended parameters 1146 | fn C.DrawSphereEx(c_centerPos C.Vector3, c_radius f32, c_rings int, c_slices int, c_color C.Color) 1147 | 1148 | // C Original: RLAPI void DrawSphereWires(Vector3 centerPos, float radius, int rings, int slices, Color color); // Draw sphere wires 1149 | // C.DrawSphereWires - Draw sphere wires 1150 | fn C.DrawSphereWires(c_centerPos C.Vector3, c_radius f32, c_rings int, c_slices int, c_color C.Color) 1151 | 1152 | // C Original: RLAPI void DrawCylinder(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone 1153 | // C.DrawCylinder - Draw a cylinder/cone 1154 | fn C.DrawCylinder(c_position C.Vector3, c_radiusTop f32, c_radiusBottom f32, c_height f32, c_slices int, c_color C.Color) 1155 | 1156 | // C Original: RLAPI void DrawCylinderWires(Vector3 position, float radiusTop, float radiusBottom, float height, int slices, Color color); // Draw a cylinder/cone wires 1157 | // C.DrawCylinderWires - Draw a cylinder/cone wires 1158 | fn C.DrawCylinderWires(c_position C.Vector3, c_radiusTop f32, c_radiusBottom f32, c_height f32, c_slices int, c_color C.Color) 1159 | 1160 | // C Original: RLAPI void DrawPlane(Vector3 centerPos, Vector2 size, Color color); // Draw a plane XZ 1161 | // C.DrawPlane - Draw a plane XZ 1162 | fn C.DrawPlane(c_centerPos C.Vector3, c_size C.Vector2, c_color C.Color) 1163 | 1164 | // C Original: RLAPI void DrawRay(Ray ray, Color color); // Draw a ray line 1165 | // C.DrawRay - Draw a ray line 1166 | fn C.DrawRay(c_ray C.Ray, c_color C.Color) 1167 | 1168 | // C Original: RLAPI void DrawGrid(int slices, float spacing); // Draw a grid (centered at (0, 0, 0)) 1169 | // C.DrawGrid - Draw a grid (centered at (0, 0, 0)) 1170 | fn C.DrawGrid(c_slices int, c_spacing f32) 1171 | 1172 | // C Original: RLAPI void DrawGizmo(Vector3 position); // Draw simple gizmo 1173 | // C.DrawGizmo - Draw simple gizmo 1174 | fn C.DrawGizmo(c_position C.Vector3) 1175 | 1176 | // C Original: RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) 1177 | // C.LoadModel - Load model from files (meshes and materials) 1178 | fn C.LoadModel(c_fileName charptr) C.Model 1179 | 1180 | // C Original: RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) 1181 | // C.LoadModelFromMesh - Load model from generated mesh (default material) 1182 | fn C.LoadModelFromMesh(c_mesh C.Mesh) C.Model 1183 | 1184 | // C Original: RLAPI void UnloadModel(Model model); // Unload model from memory (RAM and/or VRAM) 1185 | // C.UnloadModel - Unload model from memory (RAM and/or VRAM) 1186 | fn C.UnloadModel(c_model C.Model) 1187 | 1188 | // C Original: RLAPI Mesh *LoadMeshes(const char *fileName, int *meshCount); // Load meshes from model file 1189 | // C.LoadMeshes - Load meshes from model file 1190 | fn C.LoadMeshes(c_fileName charptr, c_meshCount &int) &C.Mesh 1191 | 1192 | // C Original: RLAPI void ExportMesh(Mesh mesh, const char *fileName); // Export mesh data to file 1193 | // C.ExportMesh - Export mesh data to file 1194 | fn C.ExportMesh(c_mesh C.Mesh, c_fileName charptr) 1195 | 1196 | // C Original: RLAPI void UnloadMesh(Mesh mesh); // Unload mesh from memory (RAM and/or VRAM) 1197 | // C.UnloadMesh - Unload mesh from memory (RAM and/or VRAM) 1198 | fn C.UnloadMesh(c_mesh C.Mesh) 1199 | 1200 | // C Original: RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file 1201 | // C.LoadMaterials - Load materials from model file 1202 | fn C.LoadMaterials(c_fileName charptr, c_materialCount &int) &C.Material 1203 | 1204 | // C Original: RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) 1205 | // C.LoadMaterialDefault - Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) 1206 | fn C.LoadMaterialDefault() C.Material 1207 | 1208 | // C Original: RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) 1209 | // C.UnloadMaterial - Unload material from GPU memory (VRAM) 1210 | fn C.UnloadMaterial(c_material C.Material) 1211 | 1212 | // C Original: RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) 1213 | // C.SetMaterialTexture - Set texture for a material map type (MAP_DIFFUSE, MAP_SPECULAR...) 1214 | fn C.SetMaterialTexture(c_material &C.Material , c_mapType int, c_texture C.Texture2D) 1215 | 1216 | // C Original: RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh 1217 | // C.SetModelMeshMaterial - Set material for a mesh 1218 | fn C.SetModelMeshMaterial(c_model &C.Model , c_meshId int, c_materialId int) 1219 | 1220 | // C Original: RLAPI ModelAnimation *LoadModelAnimations(const char *fileName, int *animsCount); // Load model animations from file 1221 | // C.LoadModelAnimations - Load model animations from file 1222 | fn C.LoadModelAnimations(c_fileName charptr, c_animsCount &int) &C.ModelAnimation 1223 | 1224 | // C Original: RLAPI void UpdateModelAnimation(Model model, ModelAnimation anim, int frame); // Update model animation pose 1225 | // C.UpdateModelAnimation - Update model animation pose 1226 | fn C.UpdateModelAnimation(c_model C.Model, c_anim C.ModelAnimation, c_frame int) 1227 | 1228 | // C Original: RLAPI void UnloadModelAnimation(ModelAnimation anim); // Unload animation data 1229 | // C.UnloadModelAnimation - Unload animation data 1230 | fn C.UnloadModelAnimation(c_anim C.ModelAnimation) 1231 | 1232 | // C Original: RLAPI bool IsModelAnimationValid(Model model, ModelAnimation anim); // Check model animation skeleton match 1233 | // C.IsModelAnimationValid - Check model animation skeleton match 1234 | fn C.IsModelAnimationValid(c_model C.Model, c_anim C.ModelAnimation) bool 1235 | 1236 | // C Original: RLAPI Mesh GenMeshPoly(int sides, float radius); // Generate polygonal mesh 1237 | // C.GenMeshPoly - Generate polygonal mesh 1238 | fn C.GenMeshPoly(c_sides int, c_radius f32) C.Mesh 1239 | 1240 | // C Original: RLAPI Mesh GenMeshPlane(float width, float length, int resX, int resZ); // Generate plane mesh (with subdivisions) 1241 | // C.GenMeshPlane - Generate plane mesh (with subdivisions) 1242 | fn C.GenMeshPlane(c_width f32, c_length f32, c_resX int, c_resZ int) C.Mesh 1243 | 1244 | // C Original: RLAPI Mesh GenMeshCube(float width, float height, float length); // Generate cuboid mesh 1245 | // C.GenMeshCube - Generate cuboid mesh 1246 | fn C.GenMeshCube(c_width f32, c_height f32, c_length f32) C.Mesh 1247 | 1248 | // C Original: RLAPI Mesh GenMeshSphere(float radius, int rings, int slices); // Generate sphere mesh (standard sphere) 1249 | // C.GenMeshSphere - Generate sphere mesh (standard sphere) 1250 | fn C.GenMeshSphere(c_radius f32, c_rings int, c_slices int) C.Mesh 1251 | 1252 | // C Original: RLAPI Mesh GenMeshHemiSphere(float radius, int rings, int slices); // Generate half-sphere mesh (no bottom cap) 1253 | // C.GenMeshHemiSphere - Generate half-sphere mesh (no bottom cap) 1254 | fn C.GenMeshHemiSphere(c_radius f32, c_rings int, c_slices int) C.Mesh 1255 | 1256 | // C Original: RLAPI Mesh GenMeshCylinder(float radius, float height, int slices); // Generate cylinder mesh 1257 | // C.GenMeshCylinder - Generate cylinder mesh 1258 | fn C.GenMeshCylinder(c_radius f32, c_height f32, c_slices int) C.Mesh 1259 | 1260 | // C Original: RLAPI Mesh GenMeshTorus(float radius, float size, int radSeg, int sides); // Generate torus mesh 1261 | // C.GenMeshTorus - Generate torus mesh 1262 | fn C.GenMeshTorus(c_radius f32, c_size f32, c_radSeg int, c_sides int) C.Mesh 1263 | 1264 | // C Original: RLAPI Mesh GenMeshKnot(float radius, float size, int radSeg, int sides); // Generate trefoil knot mesh 1265 | // C.GenMeshKnot - Generate trefoil knot mesh 1266 | fn C.GenMeshKnot(c_radius f32, c_size f32, c_radSeg int, c_sides int) C.Mesh 1267 | 1268 | // C Original: RLAPI Mesh GenMeshHeightmap(Image heightmap, Vector3 size); // Generate heightmap mesh from image data 1269 | // C.GenMeshHeightmap - Generate heightmap mesh from image data 1270 | fn C.GenMeshHeightmap(c_heightmap C.Image, c_size C.Vector3) C.Mesh 1271 | 1272 | // C Original: RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Generate cubes-based map mesh from image data 1273 | // C.GenMeshCubicmap - Generate cubes-based map mesh from image data 1274 | fn C.GenMeshCubicmap(c_cubicmap C.Image, c_cubeSize C.Vector3) C.Mesh 1275 | 1276 | // C Original: RLAPI BoundingBox MeshBoundingBox(Mesh mesh); // Compute mesh bounding box limits 1277 | // C.MeshBoundingBox - Compute mesh bounding box limits 1278 | fn C.MeshBoundingBox(c_mesh C.Mesh) C.BoundingBox 1279 | 1280 | // C Original: RLAPI void MeshTangents(Mesh *mesh); // Compute mesh tangents 1281 | // C.MeshTangents - Compute mesh tangents 1282 | fn C.MeshTangents(c_mesh &C.Mesh ) 1283 | 1284 | // C Original: RLAPI void MeshBinormals(Mesh *mesh); // Compute mesh binormals 1285 | // C.MeshBinormals - Compute mesh binormals 1286 | fn C.MeshBinormals(c_mesh &C.Mesh ) 1287 | 1288 | // C Original: RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint); // Draw a model (with texture if set) 1289 | // C.DrawModel - Draw a model (with texture if set) 1290 | fn C.DrawModel(c_model C.Model, c_position C.Vector3, c_scale f32, c_tint C.Color) 1291 | 1292 | // C Original: RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters 1293 | // C.DrawModelEx - Draw a model with extended parameters 1294 | fn C.DrawModelEx(c_model C.Model, c_position C.Vector3, c_rotationAxis C.Vector3, c_rotationAngle f32, c_scale C.Vector3, c_tint C.Color) 1295 | 1296 | // C Original: RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set) 1297 | // C.DrawModelWires - Draw a model wires (with texture if set) 1298 | fn C.DrawModelWires(c_model C.Model, c_position C.Vector3, c_scale f32, c_tint C.Color) 1299 | 1300 | // C Original: RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters 1301 | // C.DrawModelWiresEx - Draw a model wires (with texture if set) with extended parameters 1302 | fn C.DrawModelWiresEx(c_model C.Model, c_position C.Vector3, c_rotationAxis C.Vector3, c_rotationAngle f32, c_scale C.Vector3, c_tint C.Color) 1303 | 1304 | // C Original: RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires) 1305 | // C.DrawBoundingBox - Draw bounding box (wires) 1306 | fn C.DrawBoundingBox(c_box C.BoundingBox, c_color C.Color) 1307 | 1308 | // C Original: RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 center, float size, Color tint); // Draw a billboard texture 1309 | // C.DrawBillboard - Draw a billboard texture 1310 | fn C.DrawBillboard(c_camera C.Camera, c_texture C.Texture2D, c_center C.Vector3, c_size f32, c_tint C.Color) 1311 | 1312 | // C Original: RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle sourceRec, Vector3 center, float size, Color tint); // Draw a billboard texture defined by sourceRec 1313 | // C.DrawBillboardRec - Draw a billboard texture defined by sourceRec 1314 | fn C.DrawBillboardRec(c_camera C.Camera, c_texture C.Texture2D, c_sourceRec C.Rectangle, c_center C.Vector3, c_size f32, c_tint C.Color) 1315 | 1316 | // C Original: RLAPI bool CheckCollisionSpheres(Vector3 centerA, float radiusA, Vector3 centerB, float radiusB); // Detect collision between two spheres 1317 | // C.CheckCollisionSpheres - Detect collision between two spheres 1318 | fn C.CheckCollisionSpheres(c_centerA C.Vector3, c_radiusA f32, c_centerB C.Vector3, c_radiusB f32) bool 1319 | 1320 | // C Original: RLAPI bool CheckCollisionBoxes(BoundingBox box1, BoundingBox box2); // Detect collision between two bounding boxes 1321 | // C.CheckCollisionBoxes - Detect collision between two bounding boxes 1322 | fn C.CheckCollisionBoxes(c_box1 C.BoundingBox, c_box2 C.BoundingBox) bool 1323 | 1324 | // C Original: RLAPI bool CheckCollisionBoxSphere(BoundingBox box, Vector3 center, float radius); // Detect collision between box and sphere 1325 | // C.CheckCollisionBoxSphere - Detect collision between box and sphere 1326 | fn C.CheckCollisionBoxSphere(c_box C.BoundingBox, c_center C.Vector3, c_radius f32) bool 1327 | 1328 | // C Original: RLAPI bool CheckCollisionRaySphere(Ray ray, Vector3 center, float radius); // Detect collision between ray and sphere 1329 | // C.CheckCollisionRaySphere - Detect collision between ray and sphere 1330 | fn C.CheckCollisionRaySphere(c_ray C.Ray, c_center C.Vector3, c_radius f32) bool 1331 | 1332 | // C Original: RLAPI bool CheckCollisionRaySphereEx(Ray ray, Vector3 center, float radius, Vector3 *collisionPoint); // Detect collision between ray and sphere, returns collision point 1333 | // C.CheckCollisionRaySphereEx - Detect collision between ray and sphere, returns collision point 1334 | fn C.CheckCollisionRaySphereEx(c_ray C.Ray, c_center C.Vector3, c_radius f32, c_collisionPoint &C.Vector3 ) bool 1335 | 1336 | // C Original: RLAPI bool CheckCollisionRayBox(Ray ray, BoundingBox box); // Detect collision between ray and box 1337 | // C.CheckCollisionRayBox - Detect collision between ray and box 1338 | fn C.CheckCollisionRayBox(c_ray C.Ray, c_box C.BoundingBox) bool 1339 | 1340 | // C Original: RLAPI RayHitInfo GetCollisionRayModel(Ray ray, Model model); // Get collision info between ray and model 1341 | // C.GetCollisionRayModel - Get collision info between ray and model 1342 | fn C.GetCollisionRayModel(c_ray C.Ray, c_model C.Model) C.RayHitInfo 1343 | 1344 | // C Original: RLAPI RayHitInfo GetCollisionRayTriangle(Ray ray, Vector3 p1, Vector3 p2, Vector3 p3); // Get collision info between ray and triangle 1345 | // C.GetCollisionRayTriangle - Get collision info between ray and triangle 1346 | fn C.GetCollisionRayTriangle(c_ray C.Ray, c_p1 C.Vector3, c_p2 C.Vector3, c_p3 C.Vector3) C.RayHitInfo 1347 | 1348 | // C Original: RLAPI RayHitInfo GetCollisionRayGround(Ray ray, float groundHeight); // Get collision info between ray and ground plane (Y-normal plane) 1349 | // C.GetCollisionRayGround - Get collision info between ray and ground plane (Y-normal plane) 1350 | fn C.GetCollisionRayGround(c_ray C.Ray, c_groundHeight f32) C.RayHitInfo 1351 | 1352 | // C Original: RLAPI char *LoadText(const char *fileName); // Load chars array from text file 1353 | // C.LoadText - Load chars array from text file 1354 | fn C.LoadText(c_fileName charptr) &char 1355 | 1356 | // C Original: RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations 1357 | // C.LoadShader - Load shader from files and bind default locations 1358 | fn C.LoadShader(c_vsFileName charptr, c_fsFileName charptr) C.Shader 1359 | 1360 | // C Original: RLAPI Shader LoadShaderCode(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations 1361 | // C.LoadShaderCode - Load shader from code strings and bind default locations 1362 | fn C.LoadShaderCode(c_vsCode charptr, c_fsCode charptr) C.Shader 1363 | 1364 | // C Original: RLAPI void UnloadShader(Shader shader); // Unload shader from GPU memory (VRAM) 1365 | // C.UnloadShader - Unload shader from GPU memory (VRAM) 1366 | fn C.UnloadShader(c_shader C.Shader) 1367 | 1368 | // C Original: RLAPI Shader GetShaderDefault(void); // Get default shader 1369 | // C.GetShaderDefault - Get default shader 1370 | fn C.GetShaderDefault() C.Shader 1371 | 1372 | // C Original: RLAPI Texture2D GetTextureDefault(void); // Get default texture 1373 | // C.GetTextureDefault - Get default texture 1374 | fn C.GetTextureDefault() C.Texture2D 1375 | 1376 | // C Original: RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location 1377 | // C.GetShaderLocation - Get shader uniform location 1378 | fn C.GetShaderLocation(c_shader C.Shader, c_uniformName charptr) int 1379 | 1380 | // C Original: RLAPI void SetShaderValue(Shader shader, int uniformLoc, const void *value, int uniformType); // Set shader uniform value 1381 | // C.SetShaderValue - Set shader uniform value 1382 | fn C.SetShaderValue(c_shader C.Shader, c_uniformLoc int, c_value voidptr, c_uniformType int) 1383 | 1384 | // C Original: RLAPI void SetShaderValueV(Shader shader, int uniformLoc, const void *value, int uniformType, int count); // Set shader uniform value vector 1385 | // C.SetShaderValueV - Set shader uniform value vector 1386 | fn C.SetShaderValueV(c_shader C.Shader, c_uniformLoc int, c_value voidptr, c_uniformType int, c_count int) 1387 | 1388 | // C Original: RLAPI void SetShaderValueMatrix(Shader shader, int uniformLoc, Matrix mat); // Set shader uniform value (matrix 4x4) 1389 | // C.SetShaderValueMatrix - Set shader uniform value (matrix 4x4) 1390 | fn C.SetShaderValueMatrix(c_shader C.Shader, c_uniformLoc int, c_mat C.Matrix) 1391 | 1392 | // C Original: RLAPI void SetShaderValueTexture(Shader shader, int uniformLoc, Texture2D texture); // Set shader uniform value for texture 1393 | // C.SetShaderValueTexture - Set shader uniform value for texture 1394 | fn C.SetShaderValueTexture(c_shader C.Shader, c_uniformLoc int, c_texture C.Texture2D) 1395 | 1396 | // C Original: RLAPI void SetMatrixProjection(Matrix proj); // Set a custom projection matrix (replaces internal projection matrix) 1397 | // C.SetMatrixProjection - Set a custom projection matrix (replaces internal projection matrix) 1398 | fn C.SetMatrixProjection(c_proj C.Matrix) 1399 | 1400 | // C Original: RLAPI void SetMatrixModelview(Matrix view); // Set a custom modelview matrix (replaces internal modelview matrix) 1401 | // C.SetMatrixModelview - Set a custom modelview matrix (replaces internal modelview matrix) 1402 | fn C.SetMatrixModelview(c_view C.Matrix) 1403 | 1404 | // C Original: RLAPI Matrix GetMatrixModelview(void); // Get internal modelview matrix 1405 | // C.GetMatrixModelview - Get internal modelview matrix 1406 | fn C.GetMatrixModelview() C.Matrix 1407 | 1408 | // C Original: RLAPI Matrix GetMatrixProjection(void); // Get internal projection matrix 1409 | // C.GetMatrixProjection - Get internal projection matrix 1410 | fn C.GetMatrixProjection() C.Matrix 1411 | 1412 | // C Original: RLAPI Texture2D GenTextureCubemap(Shader shader, Texture2D map, int size); // Generate cubemap texture from 2D texture 1413 | // C.GenTextureCubemap - Generate cubemap texture from 2D texture 1414 | fn C.GenTextureCubemap(c_shader C.Shader, c_map C.Texture2D, c_size int) C.Texture2D 1415 | 1416 | // C Original: RLAPI Texture2D GenTextureIrradiance(Shader shader, Texture2D cubemap, int size); // Generate irradiance texture using cubemap data 1417 | // C.GenTextureIrradiance - Generate irradiance texture using cubemap data 1418 | fn C.GenTextureIrradiance(c_shader C.Shader, c_cubemap C.Texture2D, c_size int) C.Texture2D 1419 | 1420 | // C Original: RLAPI Texture2D GenTexturePrefilter(Shader shader, Texture2D cubemap, int size); // Generate prefilter texture using cubemap data 1421 | // C.GenTexturePrefilter - Generate prefilter texture using cubemap data 1422 | fn C.GenTexturePrefilter(c_shader C.Shader, c_cubemap C.Texture2D, c_size int) C.Texture2D 1423 | 1424 | // C Original: RLAPI Texture2D GenTextureBRDF(Shader shader, int size); // Generate BRDF texture 1425 | // C.GenTextureBRDF - Generate BRDF texture 1426 | fn C.GenTextureBRDF(c_shader C.Shader, c_size int) C.Texture2D 1427 | 1428 | // C Original: RLAPI void BeginShaderMode(Shader shader); // Begin custom shader drawing 1429 | // C.BeginShaderMode - Begin custom shader drawing 1430 | fn C.BeginShaderMode(c_shader C.Shader) 1431 | 1432 | // C Original: RLAPI void EndShaderMode(void); // End custom shader drawing (use default shader) 1433 | // C.EndShaderMode - End custom shader drawing (use default shader) 1434 | fn C.EndShaderMode() 1435 | 1436 | // C Original: RLAPI void BeginBlendMode(int mode); // Begin blending mode (alpha, additive, multiplied) 1437 | // C.BeginBlendMode - Begin blending mode (alpha, additive, multiplied) 1438 | fn C.BeginBlendMode(c_mode int) 1439 | 1440 | // C Original: RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) 1441 | // C.EndBlendMode - End blending mode (reset to default: alpha blending) 1442 | fn C.EndBlendMode() 1443 | 1444 | // C Original: RLAPI void InitVrSimulator(void); // Init VR simulator for selected device parameters 1445 | // C.InitVrSimulator - Init VR simulator for selected device parameters 1446 | fn C.InitVrSimulator() 1447 | 1448 | // C Original: RLAPI void CloseVrSimulator(void); // Close VR simulator for current device 1449 | // C.CloseVrSimulator - Close VR simulator for current device 1450 | fn C.CloseVrSimulator() 1451 | 1452 | // C Original: RLAPI void UpdateVrTracking(Camera *camera); // Update VR tracking (position and orientation) and camera 1453 | // C.UpdateVrTracking - Update VR tracking (position and orientation) and camera 1454 | fn C.UpdateVrTracking(c_camera &C.Camera ) 1455 | 1456 | // C Original: RLAPI void SetVrConfiguration(VrDeviceInfo info, Shader distortion); // Set stereo rendering configuration parameters 1457 | // C.SetVrConfiguration - Set stereo rendering configuration parameters 1458 | fn C.SetVrConfiguration(c_info C.VrDeviceInfo, c_distortion C.Shader) 1459 | 1460 | // C Original: RLAPI bool IsVrSimulatorReady(void); // Detect if VR simulator is ready 1461 | // C.IsVrSimulatorReady - Detect if VR simulator is ready 1462 | fn C.IsVrSimulatorReady() bool 1463 | 1464 | // C Original: RLAPI void ToggleVrMode(void); // Enable/Disable VR experience 1465 | // C.ToggleVrMode - Enable/Disable VR experience 1466 | fn C.ToggleVrMode() 1467 | 1468 | // C Original: RLAPI void BeginVrDrawing(void); // Begin VR simulator stereo rendering 1469 | // C.BeginVrDrawing - Begin VR simulator stereo rendering 1470 | fn C.BeginVrDrawing() 1471 | 1472 | // C Original: RLAPI void EndVrDrawing(void); // End VR simulator stereo rendering 1473 | // C.EndVrDrawing - End VR simulator stereo rendering 1474 | fn C.EndVrDrawing() 1475 | 1476 | // C Original: RLAPI void InitAudioDevice(void); // Initialize audio device and context 1477 | // C.InitAudioDevice - Initialize audio device and context 1478 | fn C.InitAudioDevice() 1479 | 1480 | // C Original: RLAPI void CloseAudioDevice(void); // Close the audio device and context 1481 | // C.CloseAudioDevice - Close the audio device and context 1482 | fn C.CloseAudioDevice() 1483 | 1484 | // C Original: RLAPI bool IsAudioDeviceReady(void); // Check if audio device has been initialized successfully 1485 | // C.IsAudioDeviceReady - Check if audio device has been initialized successfully 1486 | fn C.IsAudioDeviceReady() bool 1487 | 1488 | // C Original: RLAPI void SetMasterVolume(float volume); // Set master volume (listener) 1489 | // C.SetMasterVolume - Set master volume (listener) 1490 | fn C.SetMasterVolume(c_volume f32) 1491 | 1492 | // C Original: RLAPI Wave LoadWave(const char *fileName); // Load wave data from file 1493 | // C.LoadWave - Load wave data from file 1494 | fn C.LoadWave(c_fileName charptr) C.Wave 1495 | 1496 | // C Original: RLAPI Sound LoadSound(const char *fileName); // Load sound from file 1497 | // C.LoadSound - Load sound from file 1498 | fn C.LoadSound(c_fileName charptr) C.Sound 1499 | 1500 | // C Original: RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data 1501 | // C.LoadSoundFromWave - Load sound from wave data 1502 | fn C.LoadSoundFromWave(c_wave C.Wave) C.Sound 1503 | 1504 | // C Original: RLAPI void UpdateSound(Sound sound, const void *data, int samplesCount);// Update sound buffer with new data 1505 | // C.UpdateSound - Update sound buffer with new data 1506 | fn C.UpdateSound(c_sound C.Sound, c_data voidptr, c_samplesCount int) 1507 | 1508 | // C Original: RLAPI void UnloadWave(Wave wave); // Unload wave data 1509 | // C.UnloadWave - Unload wave data 1510 | fn C.UnloadWave(c_wave C.Wave) 1511 | 1512 | // C Original: RLAPI void UnloadSound(Sound sound); // Unload sound 1513 | // C.UnloadSound - Unload sound 1514 | fn C.UnloadSound(c_sound C.Sound) 1515 | 1516 | // C Original: RLAPI void ExportWave(Wave wave, const char *fileName); // Export wave data to file 1517 | // C.ExportWave - Export wave data to file 1518 | fn C.ExportWave(c_wave C.Wave, c_fileName charptr) 1519 | 1520 | // C Original: RLAPI void ExportWaveAsCode(Wave wave, const char *fileName); // Export wave sample data to code (.h) 1521 | // C.ExportWaveAsCode - Export wave sample data to code (.h) 1522 | fn C.ExportWaveAsCode(c_wave C.Wave, c_fileName charptr) 1523 | 1524 | // C Original: RLAPI void PlaySound(Sound sound); // Play a sound 1525 | // C.PlaySound - Play a sound 1526 | fn C.PlaySound(c_sound C.Sound) 1527 | 1528 | // C Original: RLAPI void StopSound(Sound sound); // Stop playing a sound 1529 | // C.StopSound - Stop playing a sound 1530 | fn C.StopSound(c_sound C.Sound) 1531 | 1532 | // C Original: RLAPI void PauseSound(Sound sound); // Pause a sound 1533 | // C.PauseSound - Pause a sound 1534 | fn C.PauseSound(c_sound C.Sound) 1535 | 1536 | // C Original: RLAPI void ResumeSound(Sound sound); // Resume a paused sound 1537 | // C.ResumeSound - Resume a paused sound 1538 | fn C.ResumeSound(c_sound C.Sound) 1539 | 1540 | // C Original: RLAPI void PlaySoundMulti(Sound sound); // Play a sound (using multichannel buffer pool) 1541 | // C.PlaySoundMulti - Play a sound (using multichannel buffer pool) 1542 | fn C.PlaySoundMulti(c_sound C.Sound) 1543 | 1544 | // C Original: RLAPI void StopSoundMulti(void); // Stop any sound playing (using multichannel buffer pool) 1545 | // C.StopSoundMulti - Stop any sound playing (using multichannel buffer pool) 1546 | fn C.StopSoundMulti() 1547 | 1548 | // C Original: RLAPI int GetSoundsPlaying(void); // Get number of sounds playing in the multichannel 1549 | // C.GetSoundsPlaying - Get number of sounds playing in the multichannel 1550 | fn C.GetSoundsPlaying() int 1551 | 1552 | // C Original: RLAPI bool IsSoundPlaying(Sound sound); // Check if a sound is currently playing 1553 | // C.IsSoundPlaying - Check if a sound is currently playing 1554 | fn C.IsSoundPlaying(c_sound C.Sound) bool 1555 | 1556 | // C Original: RLAPI void SetSoundVolume(Sound sound, float volume); // Set volume for a sound (1.0 is max level) 1557 | // C.SetSoundVolume - Set volume for a sound (1.0 is max level) 1558 | fn C.SetSoundVolume(c_sound C.Sound, c_volume f32) 1559 | 1560 | // C Original: RLAPI void SetSoundPitch(Sound sound, float pitch); // Set pitch for a sound (1.0 is base level) 1561 | // C.SetSoundPitch - Set pitch for a sound (1.0 is base level) 1562 | fn C.SetSoundPitch(c_sound C.Sound, c_pitch f32) 1563 | 1564 | // C Original: RLAPI void WaveFormat(Wave *wave, int sampleRate, int sampleSize, int channels); // Convert wave data to desired format 1565 | // C.WaveFormat - Convert wave data to desired format 1566 | fn C.WaveFormat(c_wave &C.Wave , c_sampleRate int, c_sampleSize int, c_channels int) 1567 | 1568 | // C Original: RLAPI Wave WaveCopy(Wave wave); // Copy a wave to a new wave 1569 | // C.WaveCopy - Copy a wave to a new wave 1570 | fn C.WaveCopy(c_wave C.Wave) C.Wave 1571 | 1572 | // C Original: RLAPI void WaveCrop(Wave *wave, int initSample, int finalSample); // Crop a wave to defined samples range 1573 | // C.WaveCrop - Crop a wave to defined samples range 1574 | fn C.WaveCrop(c_wave &C.Wave , c_initSample int, c_finalSample int) 1575 | 1576 | // C Original: RLAPI float *GetWaveData(Wave wave); // Get samples data from wave as a floats array 1577 | // C.GetWaveData - Get samples data from wave as a floats array 1578 | fn C.GetWaveData(c_wave C.Wave) &f32 1579 | 1580 | // C Original: RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file 1581 | // C.LoadMusicStream - Load music stream from file 1582 | fn C.LoadMusicStream(c_fileName charptr) C.Music 1583 | 1584 | // C Original: RLAPI void UnloadMusicStream(Music music); // Unload music stream 1585 | // C.UnloadMusicStream - Unload music stream 1586 | fn C.UnloadMusicStream(c_music C.Music) 1587 | 1588 | // C Original: RLAPI void PlayMusicStream(Music music); // Start music playing 1589 | // C.PlayMusicStream - Start music playing 1590 | fn C.PlayMusicStream(c_music C.Music) 1591 | 1592 | // C Original: RLAPI void UpdateMusicStream(Music music); // Updates buffers for music streaming 1593 | // C.UpdateMusicStream - Updates buffers for music streaming 1594 | fn C.UpdateMusicStream(c_music C.Music) 1595 | 1596 | // C Original: RLAPI void StopMusicStream(Music music); // Stop music playing 1597 | // C.StopMusicStream - Stop music playing 1598 | fn C.StopMusicStream(c_music C.Music) 1599 | 1600 | // C Original: RLAPI void PauseMusicStream(Music music); // Pause music playing 1601 | // C.PauseMusicStream - Pause music playing 1602 | fn C.PauseMusicStream(c_music C.Music) 1603 | 1604 | // C Original: RLAPI void ResumeMusicStream(Music music); // Resume playing paused music 1605 | // C.ResumeMusicStream - Resume playing paused music 1606 | fn C.ResumeMusicStream(c_music C.Music) 1607 | 1608 | // C Original: RLAPI bool IsMusicPlaying(Music music); // Check if music is playing 1609 | // C.IsMusicPlaying - Check if music is playing 1610 | fn C.IsMusicPlaying(c_music C.Music) bool 1611 | 1612 | // C Original: RLAPI void SetMusicVolume(Music music, float volume); // Set volume for music (1.0 is max level) 1613 | // C.SetMusicVolume - Set volume for music (1.0 is max level) 1614 | fn C.SetMusicVolume(c_music C.Music, c_volume f32) 1615 | 1616 | // C Original: RLAPI void SetMusicPitch(Music music, float pitch); // Set pitch for a music (1.0 is base level) 1617 | // C.SetMusicPitch - Set pitch for a music (1.0 is base level) 1618 | fn C.SetMusicPitch(c_music C.Music, c_pitch f32) 1619 | 1620 | // C Original: RLAPI void SetMusicLoopCount(Music music, int count); // Set music loop count (loop repeats) 1621 | // C.SetMusicLoopCount - Set music loop count (loop repeats) 1622 | fn C.SetMusicLoopCount(c_music C.Music, c_count int) 1623 | 1624 | // C Original: RLAPI float GetMusicTimeLength(Music music); // Get music time length (in seconds) 1625 | // C.GetMusicTimeLength - Get music time length (in seconds) 1626 | fn C.GetMusicTimeLength(c_music C.Music) f32 1627 | 1628 | // C Original: RLAPI float GetMusicTimePlayed(Music music); // Get current music time played (in seconds) 1629 | // C.GetMusicTimePlayed - Get current music time played (in seconds) 1630 | fn C.GetMusicTimePlayed(c_music C.Music) f32 1631 | 1632 | // C Original: RLAPI AudioStream InitAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Init audio stream (to stream raw audio pcm data) 1633 | // C.InitAudioStream - Init audio stream (to stream raw audio pcm data) 1634 | fn C.InitAudioStream(c_sampleRate u32, c_sampleSize u32, c_channels u32) C.AudioStream 1635 | 1636 | // C Original: RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int samplesCount); // Update audio stream buffers with data 1637 | // C.UpdateAudioStream - Update audio stream buffers with data 1638 | fn C.UpdateAudioStream(c_stream C.AudioStream, c_data voidptr, c_samplesCount int) 1639 | 1640 | // C Original: RLAPI void CloseAudioStream(AudioStream stream); // Close audio stream and free memory 1641 | // C.CloseAudioStream - Close audio stream and free memory 1642 | fn C.CloseAudioStream(c_stream C.AudioStream) 1643 | 1644 | // C Original: RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill 1645 | // C.IsAudioStreamProcessed - Check if any audio stream buffers requires refill 1646 | fn C.IsAudioStreamProcessed(c_stream C.AudioStream) bool 1647 | 1648 | // C Original: RLAPI void PlayAudioStream(AudioStream stream); // Play audio stream 1649 | // C.PlayAudioStream - Play audio stream 1650 | fn C.PlayAudioStream(c_stream C.AudioStream) 1651 | 1652 | // C Original: RLAPI void PauseAudioStream(AudioStream stream); // Pause audio stream 1653 | // C.PauseAudioStream - Pause audio stream 1654 | fn C.PauseAudioStream(c_stream C.AudioStream) 1655 | 1656 | // C Original: RLAPI void ResumeAudioStream(AudioStream stream); // Resume audio stream 1657 | // C.ResumeAudioStream - Resume audio stream 1658 | fn C.ResumeAudioStream(c_stream C.AudioStream) 1659 | 1660 | // C Original: RLAPI bool IsAudioStreamPlaying(AudioStream stream); // Check if audio stream is playing 1661 | // C.IsAudioStreamPlaying - Check if audio stream is playing 1662 | fn C.IsAudioStreamPlaying(c_stream C.AudioStream) bool 1663 | 1664 | // C Original: RLAPI void StopAudioStream(AudioStream stream); // Stop audio stream 1665 | // C.StopAudioStream - Stop audio stream 1666 | fn C.StopAudioStream(c_stream C.AudioStream) 1667 | 1668 | // C Original: RLAPI void SetAudioStreamVolume(AudioStream stream, float volume); // Set volume for audio stream (1.0 is max level) 1669 | // C.SetAudioStreamVolume - Set volume for audio stream (1.0 is max level) 1670 | fn C.SetAudioStreamVolume(c_stream C.AudioStream, c_volume f32) 1671 | 1672 | // C Original: RLAPI void SetAudioStreamPitch(AudioStream stream, float pitch); // Set pitch for audio stream (1.0 is base level) 1673 | // C.SetAudioStreamPitch - Set pitch for audio stream (1.0 is base level) 1674 | fn C.SetAudioStreamPitch(c_stream C.AudioStream, c_pitch f32) 1675 | 1676 | // CType: C.Image | 55 1677 | // CType: C.Color | 108 1678 | // CType: C.Camera2D | 4 1679 | // CType: C.Camera | 6 1680 | // CType: C.BoundingBox | 7 1681 | // CType: C.AudioStream | 12 1682 | // CType: C.Camera * | 2 1683 | // CType: C.Camera3D | 1 1684 | // CType: C.CharInfo * | 2 1685 | // CType: C.Color * | 5 1686 | // CType: C.Font | 17 1687 | // CType: C.Vector2 | 65 1688 | // CType: C.RenderTexture2D | 4 1689 | // CType: C.Ray | 9 1690 | // CType: C.Matrix | 11 1691 | // CType: C.Image * | 27 1692 | // CType: C.Material * | 3 1693 | // CType: C.Material | 3 1694 | // CType: C.NPatchInfo | 1 1695 | // CType: C.Model | 12 1696 | // CType: C.Mesh | 24 1697 | // CType: C.Mesh * | 4 1698 | // CType: C.Model * | 1 1699 | // CType: C.ModelAnimation * | 2 1700 | // CType: C.ModelAnimation | 3 1701 | // CType: C.Music | 14 1702 | // CType: C.Rectangle | 31 1703 | // CType: C.RayHitInfo | 6 1704 | // CType: C.Texture2D | 35 1705 | // CType: C.Shader | 18 1706 | // CType: C.Sound | 14 1707 | // CType: C.TextureCubemap | 2 1708 | // CType: C.Texture2D * | 1 1709 | // CType: C.Vector3 | 42 1710 | // CType: C.Vector2 * | 3 1711 | // CType: C.Vector4 | 3 1712 | // CType: C.Vector3 * | 1 1713 | // CType: C.Vector4 * | 2 1714 | // CType: C.VrDeviceInfo | 1 1715 | // CType: C.Wave | 10 1716 | // CType: C.Wave * | 2 1717 | --------------------------------------------------------------------------------