Expand description
§Direct raylib bindings for Rust
raylib-ffi
aims to provide a “no frills” direct binding to raylib for rust developers.
This library is largely auto-generated by the code in build/
. Raylib itself exposes lots of metadata, meaning that wrappers can auto-translate the C API into whatever language is needed (in this case, Rust).
§Dependencies
Fedora:
dnf install clang-devel alsa-lib-devel mesa-libGL-devel libX11-devel libXrandr-devel libXi-devel libXcursor-devel libXinerama-devel libatomic cmake
§Verifying your build
raylib-ffi
bundles a rust version of the example project from raylib proper. To verify your build of this library worked, run:
cargo run --example basic
§Versioning policy
raylib-ffi
follows SemVer.
The major and minor version numbers of a raylib-ffi
will always match the version of raylib it was built against. The patch version may be incremented if a rust-only fix is needed at any point.
Modules§
- colors
- This module contains auto-generated Rust representations of raylib’s colors.
- enums
- This module contains auto-generated Rust representations of raylib’s enums.
- macros
- Quality of life macros
Macros§
- draw
- Begins drawing, creates a new scope, executes code, then cleans up
- rl_str
- Converts a string to
*const i8
for use with raylib
Structs§
- Audio
Stream - Automation
Event - Automation
Event List - Bone
Info - Bounding
Box - Camera2D
- Camera3D
- Color
- File
Path List - Font
- Glyph
Info - Image
- Material
- Material
Map - Matrix
- Mesh
- Model
- Model
Animation - Music
- NPatch
Info - Ray
- RayCollision
- Rectangle
- Render
Texture - Shader
- Sound
- Texture
- Transform
- Vector2
- Vector3
- Vector4
- VrDevice
Info - VrStereo
Config - Wave
- __
va_ list_ tag - rAudio
Buffer - rAudio
Processor
Constants§
Functions§
- Attach
Audio ⚠Mixed Processor - Attach
Audio ⚠Stream Processor - Begin
Blend ⚠Mode - Begin
Drawing ⚠ - Begin
Mode2D ⚠ - Begin
Mode3D ⚠ - Begin
Scissor ⚠Mode - Begin
Shader ⚠Mode - Begin
Texture ⚠Mode - Begin
VrStereo ⚠Mode - Change
Directory ⚠ - Check
Collision ⚠BoxSphere - Check
Collision ⚠Boxes - Check
Collision ⚠Circle Line - Check
Collision ⚠Circle Rec - Check
Collision ⚠Circles - Check
Collision ⚠Lines - Check
Collision ⚠Point Circle - Check
Collision ⚠Point Line - Check
Collision ⚠Point Poly - Check
Collision ⚠Point Rec - Check
Collision ⚠Point Triangle - Check
Collision ⚠Recs - Check
Collision ⚠Spheres - Clear
Background ⚠ - Clear
Window ⚠State - Close
Audio ⚠Device - Close
Window ⚠ - Codepoint
ToUT ⚠F8 - Color
Alpha ⚠ - Color
Alpha ⚠Blend - Color
Brightness ⚠ - Color
Contrast ⚠ - Color
FromHSV ⚠ - Color
From ⚠Normalized - Color
IsEqual ⚠ - Color
Lerp ⚠ - Color
Normalize ⚠ - Color
Tint ⚠ - Color
ToHSV ⚠ - Color
ToInt ⚠ - Compress
Data ⚠ - ComputeCR
C32 ⚠ - ComputeM
D5 ⚠ - ComputeSH
A1 ⚠ - Decode
Data ⚠Base64 - Decompress
Data ⚠ - Detach
Audio ⚠Mixed Processor - Detach
Audio ⚠Stream Processor - Directory
Exists ⚠ - Disable
Cursor ⚠ - Disable
Event ⚠Waiting - Draw
Billboard ⚠ - Draw
Billboard ⚠Pro - Draw
Billboard ⚠Rec - Draw
Bounding ⚠Box - Draw
Capsule ⚠ - Draw
Capsule ⚠Wires - Draw
Circle ⚠ - Draw
Circle3D ⚠ - Draw
Circle ⚠Gradient - Draw
Circle ⚠Lines - Draw
Circle ⚠LinesV - Draw
Circle ⚠Sector - Draw
Circle ⚠Sector Lines - Draw
CircleV ⚠ - Draw
Cube ⚠ - Draw
CubeV ⚠ - Draw
Cube ⚠Wires - Draw
Cube ⚠WiresV - Draw
Cylinder ⚠ - Draw
Cylinder ⚠Ex - Draw
Cylinder ⚠Wires - Draw
Cylinder ⚠Wires Ex - Draw
Ellipse ⚠ - Draw
Ellipse ⚠Lines - DrawFPS⚠
- Draw
Grid ⚠ - Draw
Line ⚠ - Draw
Line3D ⚠ - Draw
Line ⚠Bezier - Draw
Line ⚠Ex - Draw
Line ⚠Strip - Draw
LineV ⚠ - Draw
Mesh ⚠ - Draw
Mesh ⚠Instanced - Draw
Model ⚠ - Draw
Model ⚠Ex - Draw
Model ⚠Points - Draw
Model ⚠Points Ex - Draw
Model ⚠Wires - Draw
Model ⚠Wires Ex - Draw
Pixel ⚠ - Draw
PixelV ⚠ - Draw
Plane ⚠ - Draw
Point3D ⚠ - Draw
Poly ⚠ - Draw
Poly ⚠Lines - Draw
Poly ⚠Lines Ex - DrawRay⚠
- Draw
Rectangle ⚠ - Draw
Rectangle ⚠Gradient Ex - Draw
Rectangle ⚠GradientH - Draw
Rectangle ⚠GradientV - Draw
Rectangle ⚠Lines - Draw
Rectangle ⚠Lines Ex - Draw
Rectangle ⚠Pro - Draw
Rectangle ⚠Rec - Draw
Rectangle ⚠Rounded - Draw
Rectangle ⚠Rounded Lines - Draw
Rectangle ⚠Rounded Lines Ex - Draw
RectangleV ⚠ - Draw
Ring ⚠ - Draw
Ring ⚠Lines - Draw
Sphere ⚠ - Draw
Sphere ⚠Ex - Draw
Sphere ⚠Wires - Draw
Spline ⚠Basis - Draw
Spline ⚠Bezier Cubic - Draw
Spline ⚠Bezier Quadratic - Draw
Spline ⚠Catmull Rom - Draw
Spline ⚠Linear - Draw
Spline ⚠Segment Basis - Draw
Spline ⚠Segment Bezier Cubic - Draw
Spline ⚠Segment Bezier Quadratic - Draw
Spline ⚠Segment Catmull Rom - Draw
Spline ⚠Segment Linear - Draw
Text ⚠ - Draw
Text ⚠Codepoint - Draw
Text ⚠Codepoints - Draw
Text ⚠Ex - Draw
Text ⚠Pro - Draw
Texture ⚠ - Draw
Texture ⚠Ex - Draw
TextureN ⚠Patch - Draw
Texture ⚠Pro - Draw
Texture ⚠Rec - Draw
TextureV ⚠ - Draw
Triangle ⚠ - Draw
Triangle3D ⚠ - Draw
Triangle ⚠Fan - Draw
Triangle ⚠Lines - Draw
Triangle ⚠Strip - Draw
Triangle ⚠Strip3D - Enable
Cursor ⚠ - Enable
Event ⚠Waiting - Encode
Data ⚠Base64 - EndBlend
Mode ⚠ - EndDrawing⚠
- EndMode2D⚠
- EndMode3D⚠
- EndScissor
Mode ⚠ - EndShader
Mode ⚠ - EndTexture
Mode ⚠ - EndVr
Stereo ⚠Mode - Export
Automation ⚠Event List - Export
Data ⚠AsCode - Export
Font ⚠AsCode - Export
Image ⚠ - Export
Image ⚠AsCode - Export
Image ⚠ToMemory - Export
Mesh ⚠ - Export
Mesh ⚠AsCode - Export
Wave ⚠ - Export
Wave ⚠AsCode - Fade⚠
- File
Exists ⚠ - GenImage
Cellular ⚠ - GenImage
Checked ⚠ - GenImage
Color ⚠ - GenImage
Font ⚠Atlas - GenImage
Gradient ⚠Linear - GenImage
Gradient ⚠Radial - GenImage
Gradient ⚠Square - GenImage
Perlin ⚠Noise - GenImage
Text ⚠ - GenImage
White ⚠Noise - GenMesh
Cone ⚠ - GenMesh
Cube ⚠ - GenMesh
Cubicmap ⚠ - GenMesh
Cylinder ⚠ - GenMesh
Heightmap ⚠ - GenMesh
Hemi ⚠Sphere - GenMesh
Knot ⚠ - GenMesh
Plane ⚠ - GenMesh
Poly ⚠ - GenMesh
Sphere ⚠ - GenMesh
Tangents ⚠ - GenMesh
Torus ⚠ - GenTexture
Mipmaps ⚠ - GetApplication
Directory ⚠ - GetCamera
Matrix ⚠ - GetCamera
Matrix2D ⚠ - GetChar
Pressed ⚠ - GetClipboard
Image ⚠ - GetClipboard
Text ⚠ - GetCodepoint⚠
- GetCodepoint
Count ⚠ - GetCodepoint
Next ⚠ - GetCodepoint
Previous ⚠ - GetCollision
Rec ⚠ - GetColor⚠
- GetCurrent
Monitor ⚠ - GetDirectory
Path ⚠ - GetFPS⚠
- GetFile
Extension ⚠ - GetFile
Length ⚠ - GetFile
ModTime ⚠ - GetFile
Name ⚠ - GetFile
Name ⚠Without Ext - GetFont
Default ⚠ - GetFrame
Time ⚠ - GetGamepad
Axis ⚠Count - GetGamepad
Axis ⚠Movement - GetGamepad
Button ⚠Pressed - GetGamepad
Name ⚠ - GetGesture
Detected ⚠ - GetGesture
Drag ⚠Angle - GetGesture
Drag ⚠Vector - GetGesture
Hold ⚠Duration - GetGesture
Pinch ⚠Angle - GetGesture
Pinch ⚠Vector - GetGlyph
Atlas ⚠Rec - GetGlyph
Index ⚠ - GetGlyph
Info ⚠ - GetImage
Alpha ⚠Border - GetImage
Color ⚠ - GetKey
Pressed ⚠ - GetMaster
Volume ⚠ - GetMesh
Bounding ⚠Box - GetModel
Bounding ⚠Box - GetMonitor
Count ⚠ - GetMonitor
Height ⚠ - GetMonitor
Name ⚠ - GetMonitor
Physical ⚠Height - GetMonitor
Physical ⚠Width - GetMonitor
Position ⚠ - GetMonitor
Refresh ⚠Rate - GetMonitor
Width ⚠ - GetMouse
Delta ⚠ - GetMouse
Position ⚠ - GetMouse
Wheel ⚠Move - GetMouse
Wheel ⚠MoveV - GetMouseX⚠
- GetMouseY⚠
- GetMusic
Time ⚠Length - GetMusic
Time ⚠Played - GetPixel
Color ⚠ - GetPixel
Data ⚠Size - GetPrev
Directory ⚠Path - GetRandom
Value ⚠ - GetRay
Collision ⚠Box - GetRay
Collision ⚠Mesh - GetRay
Collision ⚠Quad - GetRay
Collision ⚠Sphere - GetRay
Collision ⚠Triangle - GetRender
Height ⚠ - GetRender
Width ⚠ - GetScreen
Height ⚠ - GetScreen
ToWorld2D ⚠ - GetScreen
ToWorld ⚠Ray - GetScreen
ToWorld ⚠RayEx - GetScreen
Width ⚠ - GetShader
Location ⚠ - GetShader
Location ⚠Attrib - GetShapes
Texture ⚠ - GetShapes
Texture ⚠Rectangle - GetSpline
Point ⚠Basis - GetSpline
Point ⚠Bezier Cubic - GetSpline
Point ⚠Bezier Quad - GetSpline
Point ⚠Catmull Rom - GetSpline
Point ⚠Linear - GetTime⚠
- GetTouch
Point ⚠Count - GetTouch
Point ⚠Id - GetTouch
Position ⚠ - GetTouchX⚠
- GetTouchY⚠
- GetWindow
Handle ⚠ - GetWindow
Position ⚠ - GetWindow
ScaleDPI ⚠ - GetWorking
Directory ⚠ - GetWorld
ToScreen ⚠ - GetWorld
ToScreen2D ⚠ - GetWorld
ToScreen ⚠Ex - Hide
Cursor ⚠ - Image
Alpha ⚠Clear - Image
Alpha ⚠Crop - Image
Alpha ⚠Mask - Image
Alpha ⚠Premultiply - Image
Blur ⚠Gaussian - Image
Clear ⚠Background - Image
Color ⚠Brightness - Image
Color ⚠Contrast - Image
Color ⚠Grayscale - Image
Color ⚠Invert - Image
Color ⚠Replace - Image
Color ⚠Tint - Image
Copy ⚠ - Image
Crop ⚠ - Image
Dither ⚠ - Image
Draw ⚠ - Image
Draw ⚠Circle - Image
Draw ⚠Circle Lines - Image
Draw ⚠Circle LinesV - Image
Draw ⚠CircleV - Image
Draw ⚠Line - Image
Draw ⚠Line Ex - Image
Draw ⚠LineV - Image
Draw ⚠Pixel - Image
Draw ⚠PixelV - Image
Draw ⚠Rectangle - Image
Draw ⚠Rectangle Lines - Image
Draw ⚠Rectangle Rec - Image
Draw ⚠RectangleV - Image
Draw ⚠Text - Image
Draw ⚠Text Ex - Image
Draw ⚠Triangle - Image
Draw ⚠Triangle Ex - Image
Draw ⚠Triangle Fan - Image
Draw ⚠Triangle Lines - Image
Draw ⚠Triangle Strip - Image
Flip ⚠Horizontal - Image
Flip ⚠Vertical - Image
Format ⚠ - Image
From ⚠Channel - Image
From ⚠Image - Image
Kernel ⚠Convolution - Image
Mipmaps ⚠ - Image
Resize ⚠ - Image
Resize ⚠Canvas - Image
ResizeNN ⚠ - Image
Rotate ⚠ - Image
RotateCCW ⚠ - Image
RotateCW ⚠ - Image
Text ⚠ - Image
Text ⚠Ex - Image
ToPOT ⚠ - Init
Audio ⚠Device - Init
Window ⚠ - IsAudio
Device ⚠Ready - IsAudio
Stream ⚠Playing - IsAudio
Stream ⚠Processed - IsAudio
Stream ⚠Valid - IsCursor
Hidden ⚠ - IsCursor
OnScreen ⚠ - IsFile
Dropped ⚠ - IsFile
Extension ⚠ - IsFile
Name ⚠Valid - IsFont
Valid ⚠ - IsGamepad
Available ⚠ - IsGamepad
Button ⚠Down - IsGamepad
Button ⚠Pressed - IsGamepad
Button ⚠Released - IsGamepad
Button ⚠Up - IsGesture
Detected ⚠ - IsImage
Valid ⚠ - IsKey
Down ⚠ - IsKey
Pressed ⚠ - IsKey
Pressed ⚠Repeat - IsKey
Released ⚠ - IsKeyUp⚠
- IsMaterial
Valid ⚠ - IsModel
Animation ⚠Valid - IsModel
Valid ⚠ - IsMouse
Button ⚠Down - IsMouse
Button ⚠Pressed - IsMouse
Button ⚠Released - IsMouse
Button ⚠Up - IsMusic
Stream ⚠Playing - IsMusic
Valid ⚠ - IsPath
File ⚠ - IsRender
Texture ⚠Valid - IsShader
Valid ⚠ - IsSound
Playing ⚠ - IsSound
Valid ⚠ - IsTexture
Valid ⚠ - IsWave
Valid ⚠ - IsWindow
Focused ⚠ - IsWindow
Fullscreen ⚠ - IsWindow
Hidden ⚠ - IsWindow
Maximized ⚠ - IsWindow
Minimized ⚠ - IsWindow
Ready ⚠ - IsWindow
Resized ⚠ - IsWindow
State ⚠ - Load
Audio ⚠Stream - Load
Automation ⚠Event List - Load
Codepoints ⚠ - Load
Directory ⚠Files - Load
Directory ⚠Files Ex - Load
Dropped ⚠Files - Load
File ⚠Data - Load
File ⚠Text - Load
Font ⚠ - Load
Font ⚠Data - Load
Font ⚠Ex - Load
Font ⚠From Image - Load
Font ⚠From Memory - Load
Image ⚠ - Load
Image ⚠Anim - Load
Image ⚠Anim From Memory - Load
Image ⚠Colors - Load
Image ⚠From Memory - Load
Image ⚠From Screen - Load
Image ⚠From Texture - Load
Image ⚠Palette - Load
Image ⚠Raw - Load
Material ⚠Default - Load
Materials ⚠ - Load
Model ⚠ - Load
Model ⚠Animations - Load
Model ⚠From Mesh - Load
Music ⚠Stream - Load
Music ⚠Stream From Memory - Load
Random ⚠Sequence - Load
Render ⚠Texture - Load
Shader ⚠ - Load
Shader ⚠From Memory - Load
Sound ⚠ - Load
Sound ⚠Alias - Load
Sound ⚠From Wave - Load
Texture ⚠ - Load
Texture ⚠Cubemap - Load
Texture ⚠From Image - LoadUT
F8 ⚠ - Load
VrStereo ⚠Config - Load
Wave ⚠ - Load
Wave ⚠From Memory - Load
Wave ⚠Samples - Make
Directory ⚠ - Maximize
Window ⚠ - Measure
Text ⚠ - Measure
Text ⚠Ex - MemAlloc⚠
- MemFree⚠
- MemRealloc⚠
- Minimize
Window ⚠ - OpenURL⚠
- Pause
Audio ⚠Stream - Pause
Music ⚠Stream - Pause
Sound ⚠ - Play
Audio ⚠Stream - Play
Automation ⚠Event - Play
Music ⚠Stream - Play
Sound ⚠ - Poll
Input ⚠Events - Restore
Window ⚠ - Resume
Audio ⚠Stream - Resume
Music ⚠Stream - Resume
Sound ⚠ - Save
File ⚠Data - Save
File ⚠Text - Seek
Music ⚠Stream - SetAudio
Stream ⚠Buffer Size Default - SetAudio
Stream ⚠Callback - SetAudio
Stream ⚠Pan - SetAudio
Stream ⚠Pitch - SetAudio
Stream ⚠Volume - SetAutomation
Event ⚠Base Frame - SetAutomation
Event ⚠List - SetClipboard
Text ⚠ - SetConfig
Flags ⚠ - SetExit
Key ⚠ - SetGamepad
Mappings ⚠ - SetGamepad
Vibration ⚠ - SetGestures
Enabled ⚠ - SetLoad
File ⚠Data Callback - SetLoad
File ⚠Text Callback - SetMaster
Volume ⚠ - SetMaterial
Texture ⚠ - SetModel
Mesh ⚠Material - SetMouse
Cursor ⚠ - SetMouse
Offset ⚠ - SetMouse
Position ⚠ - SetMouse
Scale ⚠ - SetMusic
Pan ⚠ - SetMusic
Pitch ⚠ - SetMusic
Volume ⚠ - SetPixel
Color ⚠ - SetRandom
Seed ⚠ - SetSave
File ⚠Data Callback - SetSave
File ⚠Text Callback - SetShader
Value ⚠ - SetShader
Value ⚠Matrix - SetShader
Value ⚠Texture - SetShader
ValueV ⚠ - SetShapes
Texture ⚠ - SetSound
Pan ⚠ - SetSound
Pitch ⚠ - SetSound
Volume ⚠ - SetTargetFPS⚠
- SetText
Line ⚠Spacing - SetTexture
Filter ⚠ - SetTexture
Wrap ⚠ - SetTrace
LogCallback ⚠ - SetTrace
LogLevel ⚠ - SetWindow
Focused ⚠ - SetWindow
Icon ⚠ - SetWindow
Icons ⚠ - SetWindow
MaxSize ⚠ - SetWindow
MinSize ⚠ - SetWindow
Monitor ⚠ - SetWindow
Opacity ⚠ - SetWindow
Position ⚠ - SetWindow
Size ⚠ - SetWindow
State ⚠ - SetWindow
Title ⚠ - Show
Cursor ⚠ - Start
Automation ⚠Event Recording - Stop
Audio ⚠Stream - Stop
Automation ⚠Event Recording - Stop
Music ⚠Stream - Stop
Sound ⚠ - Swap
Screen ⚠Buffer - Take
Screenshot ⚠ - Text
Append ⚠ - Text
Copy ⚠ - Text
Find ⚠Index - Text
Format ⚠ - Text
Insert ⚠ - Text
IsEqual ⚠ - Text
Join ⚠ - Text
Length ⚠ - Text
Replace ⚠ - Text
Split ⚠ - Text
Subtext ⚠ - Text
ToCamel ⚠ - Text
ToFloat ⚠ - Text
ToInteger ⚠ - Text
ToLower ⚠ - Text
ToPascal ⚠ - Text
ToSnake ⚠ - Text
ToUpper ⚠ - Toggle
Borderless ⚠Windowed - Toggle
Fullscreen ⚠ - Trace
Log ⚠ - Unload
Audio ⚠Stream - Unload
Automation ⚠Event List - Unload
Codepoints ⚠ - Unload
Directory ⚠Files - Unload
Dropped ⚠Files - Unload
File ⚠Data - Unload
File ⚠Text - Unload
Font ⚠ - Unload
Font ⚠Data - Unload
Image ⚠ - Unload
Image ⚠Colors - Unload
Image ⚠Palette - Unload
Material ⚠ - Unload
Mesh ⚠ - Unload
Model ⚠ - Unload
Model ⚠Animation - Unload
Model ⚠Animations - Unload
Music ⚠Stream - Unload
Random ⚠Sequence - Unload
Render ⚠Texture - Unload
Shader ⚠ - Unload
Sound ⚠ - Unload
Sound ⚠Alias - Unload
Texture ⚠ - UnloadUT
F8 ⚠ - Unload
VrStereo ⚠Config - Unload
Wave ⚠ - Unload
Wave ⚠Samples - Update
Audio ⚠Stream - Update
Camera ⚠ - Update
Camera ⚠Pro - Update
Mesh ⚠Buffer - Update
Model ⚠Animation - Update
Model ⚠Animation Bones - Update
Music ⚠Stream - Update
Sound ⚠ - Update
Texture ⚠ - Update
Texture ⚠Rec - Upload
Mesh ⚠ - Wait
Time ⚠ - Wave
Copy ⚠ - Wave
Crop ⚠ - Wave
Format ⚠ - Window
Should ⚠Close