Module rust_raylib::ffi
source · Expand description
Raw ffi bindings
Modules
Structs
- AudioStream, custom audio stream
- Bone, skeletal animation bone
- BoundingBox
- Camera2D, defines position/orientation in 2d space
- Camera, defines position/orientation in 3d space
- Color, 4 components, R8G8B8A8 (32bit)
- System/Window config flags
- File path list
- Font, font texture and GlyphInfo array data
- Gesture
- GlyphInfo, font characters glyphs info
- Image, pixel data stored in CPU memory (RAM)
- Material, includes shader and maps
- MaterialMap
- Matrix, 4x4 components, column major, OpenGL style, right-handed
- Mesh, vertex data and vao/vbo
- Model, meshes, materials and animation data
- ModelAnimation
- Music, audio stream, anything longer than ~10 seconds should be streamed
- NPatchInfo, n-patch layout info
- Ray, ray for raycasting
- RayCollision, ray hit information
- Rectangle, 4 components
- RenderTexture, fbo for texture rendering
- Shader
- Sound
- Texture, tex data stored in GPU memory (VRAM)
- Transform, vertex transformation data
- Vector2, 2 components
- Vector3, 3 components
- Vector4, 4 components
- VrDeviceInfo, Head-Mounted-Display device parameters
- VrStereoConfig, VR stereo rendering configuration for simulator
- Wave, audio wave data
Enums
- Color blending modes (pre-defined)
- Camera system modes
- Camera projection
- Cubemap layouts
- Font type, defines generation method
- Gamepad axis
- Gamepad buttons
- Keyboard keys (US keyboard layout)
- Material map index
- Mouse buttons
- Mouse cursor
- N-patch layout
- Pixel formats
- Shader attribute data types
- Shader location index
- Shader uniform data type
- Texture parameters: filter mode
- Texture parameters: wrap mode
- Trace log level
Constants
Functions
- Attach audio stream processor to the entire audio pipeline
- Attach audio stream processor to stream
- Begin blending mode (alpha, additive, multiplied, subtract, custom)
- Setup canvas (framebuffer) to start drawing
- Begin 2D mode with custom camera (2D)
- Begin 3D mode with custom camera (3D)
- Begin scissor mode (define screen area for following drawing)
- Begin custom shader drawing
- Begin drawing to render texture
- Begin stereo rendering (requires VR simulator)
- Change working directory, return true on success
- Check collision between box and sphere
- Check collision between two bounding boxes
- Check collision between circle and rectangle
- Check collision between two circles
- Check the collision between two lines defined by two points each, returns collision point by reference
- Check if point is inside circle
- Check if point belongs to line created between two points [p1] and [p2] with defined margin in pixels [threshold]
- Check if point is within a polygon described by array of vertices
- Check if point is inside rectangle
- Check if point is inside a triangle
- Check collision between two rectangles
- Check collision between two spheres
- Set background color (framebuffer clear color)
- Clear window configuration state flags
- Close the audio device and context
- Close window and unload OpenGL context
- Encode one codepoint into UTF-8 byte array (array length returned as parameter)
- Get color with alpha applied, alpha goes from 0.0f to 1.0f
- Get src alpha-blended into dst color with tint
- Get color with brightness correction, brightness factor goes from -1.0f to 1.0f
- Get color with contrast correction, contrast values between -1.0f and 1.0f
- Get a Color from HSV values, hue [0..360], saturation/value [0..1]
- Get Color from normalized values [0..1]
- Get Color normalized as float [0..1]
- Get color multiplied with another color
- Get HSV values for a Color, hue [0..360], saturation/value [0..1]
- Get hexadecimal value for a Color
- Compress data (DEFLATE algorithm), memory must be MemFree()
- Decode Base64 string data, memory must be MemFree()
- Decompress data (DEFLATE algorithm), memory must be MemFree()
- Detach audio stream processor from the entire audio pipeline
- Detach audio stream processor from stream
- Check if a directory path exists
- Disables cursor (lock cursor)
- Disable waiting for events on EndDrawing(), automatic events polling
- Draw a billboard texture
- Draw a billboard texture defined by source and rotation
- Draw a billboard texture defined by source
- Draw bounding box (wires)
- Draw a capsule with the center of its sphere caps at startPos and endPos
- Draw capsule wireframe with the center of its sphere caps at startPos and endPos
- Draw a color-filled circle
- Draw a circle in 3D world space
- Draw a gradient-filled circle
- Draw circle outline
- Draw a piece of a circle
- Draw circle sector outline
- Draw a color-filled circle (Vector version)
- Draw cube
- Draw cube (Vector version)
- Draw cube wires
- Draw cube wires (Vector version)
- Draw a cylinder/cone
- Draw a cylinder with base at startPos and top at endPos
- Draw a cylinder/cone wires
- Draw a cylinder wires with base at startPos and top at endPos
- Draw ellipse
- Draw ellipse outline
- Draw current FPS
- Draw a grid (centered at (0, 0, 0))
- Draw a line
- Draw a line in 3D world space
- Draw a line using cubic-bezier curves in-out
- Draw line using cubic bezier curves with 2 control points
- Draw line using quadratic bezier curves with a control point
- Draw a line defining thickness
- Draw lines sequence
- Draw a line (Vector version)
- Draw a 3d mesh with material and transform
- Draw multiple mesh instances with material and different transforms
- Draw a model (with texture if set)
- Draw a model with extended parameters
- Draw a model wires (with texture if set)
- Draw a model wires (with texture if set) with extended parameters
- Draw a pixel
- Draw a pixel (Vector version)
- Draw a plane XZ
- Draw a point in 3D space, actually a small line
- Draw a regular polygon (Vector version)
- Draw a polygon outline of n sides
- Draw a polygon outline of n sides with extended parameters
- Draw a ray line
- Draw a color-filled rectangle
- Draw a gradient-filled rectangle with custom vertex colors
- Draw a horizontal-gradient-filled rectangle
- Draw a vertical-gradient-filled rectangle
- Draw rectangle outline
- Draw rectangle outline with extended parameters
- Draw a color-filled rectangle with pro parameters
- Draw a color-filled rectangle
- Draw rectangle with rounded edges
- Draw rectangle with rounded edges outline
- Draw a color-filled rectangle (Vector version)
- Draw ring
- Draw ring outline
- Draw sphere
- Draw sphere with extended parameters
- Draw sphere wires
- Draw text (using default font)
- Draw one character (codepoint)
- Draw multiple character (codepoint)
- Draw text using font and additional parameters
- Draw text using Font and pro parameters (rotation)
- Draw a Texture2D
- Draw a Texture2D with extended parameters
- Draws a texture (or part of it) that stretches or shrinks nicely
- Draw a part of a texture defined by a rectangle with ‘pro’ parameters
- Draw a part of a texture defined by a rectangle
- Draw a Texture2D with position defined as Vector2
- Draw a color-filled triangle (vertex in counter-clockwise order!)
- Draw a color-filled triangle (vertex in counter-clockwise order!)
- Draw a triangle fan defined by points (first vertex is the center)
- Draw triangle outline (vertex in counter-clockwise order!)
- Draw a triangle strip defined by points
- Draw a triangle strip defined by points
- Enables cursor (unlock cursor)
- Enable waiting for events on EndDrawing(), no automatic event polling
- Encode data to Base64 string, memory must be MemFree()
- End blending mode (reset to default: alpha blending)
- End canvas drawing and swap buffers (double buffering)
- Ends 2D mode with custom camera
- Ends 3D mode and returns to default 2D orthographic mode
- End scissor mode
- End custom shader drawing (use default shader)
- Ends drawing to render texture
- End stereo rendering (requires VR simulator)
- Export data to code (.h), returns true on success
- Export font as code file, returns true on success
- Export image data to file, returns true on success
- Export image as code file defining an array of bytes, returns true on success
- Export mesh data to file, returns true on success
- Export wave data to file, returns true on success
- Export wave sample data to code (.h), returns true on success
- Fade⚠Get color with alpha applied, alpha goes from 0.0f to 1.0f
- Check if file exists
- Generate image: cellular algorithm, bigger tileSize means bigger cells
- Generate image: checked
- Generate image: plain color
- Generate image font atlas using chars info
- Generate image: horizontal gradient
- Generate image: radial gradient
- Generate image: vertical gradient
- Generate image: perlin noise
- Generate image: grayscale image from text data
- Generate image: white noise
- Generate cone/pyramid mesh
- Generate cuboid mesh
- Generate cubes-based map mesh from image data
- Generate cylinder mesh
- Generate heightmap mesh from image data
- Generate half-sphere mesh (no bottom cap)
- Generate trefoil knot mesh
- Generate plane mesh (with subdivisions)
- Generate polygonal mesh
- Generate sphere mesh (standard sphere)
- Compute mesh tangents
- Generate torus mesh
- Generate GPU mipmaps for a texture
- Get the directory if the running application (uses static string)
- Get camera transform matrix (view matrix)
- Get camera 2d transform matrix
- Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty
- Get clipboard text content
- Get next codepoint in a UTF-8 encoded string, 0x3f(‘?’) is returned on failure
- Get total number of codepoints in a UTF-8 encoded string
- Get next codepoint in a UTF-8 encoded string, 0x3f(‘?’) is returned on failure
- Get previous codepoint in a UTF-8 encoded string, 0x3f(‘?’) is returned on failure
- Get collision rectangle for two rectangles collision
- Get Color structure from hexadecimal value
- Get current connected monitor
- Get full path for a given fileName with path (uses static string)
- Get current FPS
- Get pointer to extension for a filename string (includes dot: ‘.png’)
- Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)
- Get file modification time (last write time)
- Get pointer to filename for a path string
- Get filename string without extension (uses static string)
- Get the default Font
- Get time in seconds for last frame drawn (delta time)
- Get gamepad axis count for a gamepad
- Get axis movement value for a gamepad axis
- Get the last gamepad button pressed
- Get gamepad internal name id
- Get latest detected gesture
- Get gesture drag angle
- Get gesture drag vector
- Get gesture hold time in milliseconds
- Get gesture pinch angle
- Get gesture pinch delta
- Get glyph rectangle in font atlas for a codepoint (unicode character), fallback to ‘?’ if not found
- Get glyph index position in font for a codepoint (unicode character), fallback to ‘?’ if not found
- Get glyph font info data for a codepoint (unicode character), fallback to ‘?’ if not found
- Get image alpha border rectangle
- Get image pixel color at (x, y) position
- Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
- Compute mesh bounding box limits
- Compute model bounding box limits (considers all meshes)
- Get number of connected monitors
- Get specified monitor height (current video mode used by monitor)
- Get the human-readable, UTF-8 encoded name of the primary monitor
- Get specified monitor physical height in millimetres
- Get specified monitor physical width in millimetres
- Get specified monitor position
- Get specified monitor refresh rate
- Get specified monitor width (current video mode used by monitor)
- Get mouse delta between frames
- Get mouse position XY
- Get a ray trace from mouse position
- Get mouse wheel movement for X or Y, whichever is larger
- Get mouse wheel movement for both X and Y
- Get mouse position X
- Get mouse position Y
- Get music time length (in seconds)
- Get current music time played (in seconds)
- Get Color from a source pixel pointer of certain format
- Get pixel data size in bytes for certain format
- Get previous directory path for a given path (uses static string)
- Get a random value between min and max (both included)
- Get collision info between ray and box
- Get collision info between ray and mesh
- Get collision info between ray and quad
- Get collision info between ray and sphere
- Get collision info between ray and triangle
- Get current render height (it considers HiDPI)
- Get current render width (it considers HiDPI)
- Get current screen height
- Get the world space position for a 2d camera screen space position
- Get current screen width
- Get shader uniform location
- Get shader attribute location
- Get elapsed time in seconds since InitWindow()
- Get number of touch points
- Get touch point identifier for given index
- Get touch position XY for a touch point index (relative to screen size)
- Get touch position X for touch point 0 (relative to screen size)
- Get touch position Y for touch point 0 (relative to screen size)
- Get native window handle
- Get window position XY on monitor
- Get window scale DPI factor
- Get current working directory (uses static string)
- Get the screen space position for a 3d world space position
- Get the screen space position for a 2d camera world space position
- Get size position for a 3d world space position
- Hides cursor
- Clear alpha channel to desired color
- Crop image depending on alpha value
- Apply alpha mask to image
- Premultiply alpha channel
- Apply Gaussian blur using a box blur approximation
- Clear image background with given color
- Modify image color: brightness (-255 to 255)
- Modify image color: contrast (-100 to 100)
- Modify image color: grayscale
- Modify image color: invert
- Modify image color: replace color
- Modify image color: tint
- Create an image duplicate (useful for transformations)
- Crop an image to a defined rectangle
- Dither image data to 16bpp or lower (Floyd-Steinberg dithering)
- Draw a source image within a destination image (tint applied to source)
- Draw a filled circle within an image
- Draw circle outline within an image
- Draw circle outline within an image (Vector version)
- Draw a filled circle within an image (Vector version)
- Draw line within an image
- Draw line within an image (Vector version)
- Draw pixel within an image
- Draw pixel within an image (Vector version)
- Draw rectangle within an image
- Draw rectangle lines within an image
- Draw rectangle within an image
- Draw rectangle within an image (Vector version)
- Draw text (using default font) within an image (destination)
- Draw text (custom sprite font) within an image (destination)
- Flip image horizontally
- Flip image vertically
- Convert image data to desired format
- Create an image from another image piece
- Compute all mipmap levels for a provided image
- Resize image (Bicubic scaling algorithm)
- Resize canvas and fill with color
- Resize image (Nearest-Neighbor scaling algorithm)
- Rotate image counter-clockwise 90deg
- Rotate image clockwise 90deg
- Create an image from text (default font)
- Create an image from text (custom sprite font)
- Convert image to POT (power-of-two)
- Initialize audio device and context
- Initialize window and OpenGL context
- Check if audio device has been initialized successfully
- Check if audio stream is playing
- Check if any audio stream buffers requires refill
- Checks if an audio stream is ready
- Check if cursor is not visible
- Check if cursor is on the screen
- Check if a file has been dropped into window
- Check file extension (including point: .png, .wav)
- Check if a font is ready
- Check if a gamepad is available
- Check if a gamepad button is being pressed
- Check if a gamepad button has been pressed once
- Check if a gamepad button has been released once
- Check if a gamepad button is NOT being pressed
- Check if a gesture have been detected
- Check if an image is ready
- Check if a key is being pressed
- Check if a key has been pressed once
- Check if a key has been released once
- Check if a key is NOT being pressed
- Check if a material is ready
- Check model animation skeleton match
- Check if a model is ready
- Check if a mouse button is being pressed
- Check if a mouse button has been pressed once
- Check if a mouse button has been released once
- Check if a mouse button is NOT being pressed
- Checks if a music stream is ready
- Check if music is playing
- Check if a given path is a file or a directory
- Check if a render texture is ready
- Check if a shader is ready
- Check if a sound is currently playing
- Checks if a sound is ready
- Check if a texture is ready
- Checks if wave data is ready
- Check if window is currently focused (only PLATFORM_DESKTOP)
- Check if window is currently fullscreen
- Check if window is currently hidden (only PLATFORM_DESKTOP)
- Check if window is currently maximized (only PLATFORM_DESKTOP)
- Check if window is currently minimized (only PLATFORM_DESKTOP)
- Check if window has been initialized successfully
- Check if window has been resized last frame
- Check if one specific window flag is enabled
- Load audio stream (to stream raw audio pcm data)
- Load all codepoints from a UTF-8 text string, codepoints count returned by parameter
- Load directory filepaths
- Load directory filepaths with extension filtering and recursive directory scan
- Load dropped filepaths
- Load file data as byte array (read)
- Load text data from file (read), returns a ‘\0’ terminated string
- Load font from file into GPU memory (VRAM)
- Load font data for further use
- Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set
- Load font from Image (XNA style)
- Load font from memory buffer, fileType refers to extension: i.e. ‘.ttf’
- Load image from file into CPU memory (RAM)
- Load image sequence from file (frames appended to image.data)
- Load color data from image as a Color array (RGBA - 32bit)
- Load image from memory buffer, fileType refers to extension: i.e. ‘.png’
- Load image from screen buffer and (screenshot)
- Load image from GPU texture data
- Load colors palette from image as a Color array (RGBA - 32bit)
- Load image from RAW file data
- Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps)
- Load materials from model file
- Load model from files (meshes and materials)
- Load model animations from file
- Load model from generated mesh (default material)
- Load music stream from file
- Load music stream from data
- Load texture for rendering (framebuffer)
- Load shader from files and bind default locations
- Load shader from code strings and bind default locations
- Load sound from file
- Load sound from wave data
- Load texture from file into GPU memory (VRAM)
- Load cubemap from image, multiple image cubemap layouts supported
- Load texture from image data
- Load UTF-8 text encoded from codepoints array
- Load VR stereo config for VR simulator device parameters
- Load wave data from file
- Load wave from memory buffer, fileType refers to extension: i.e. ‘.wav’
- Load samples data from wave as a 32bit float data array
- Set window state: maximized, if resizable (only PLATFORM_DESKTOP)
- Measure string width for default font
- Measure string size for Font
- Internal memory allocator
- Internal memory free
- Internal memory reallocator
- Set window state: minimized, if resizable (only PLATFORM_DESKTOP)
- Open URL with default system browser (if available)
- Pause audio stream
- Pause music playing
- Pause a sound
- Play audio stream
- Start music playing
- Play a sound
- Register all input events
- Set window state: not minimized/maximized (only PLATFORM_DESKTOP)
- Resume audio stream
- Resume playing paused music
- Resume a paused sound
- Save data to file from byte array (write), returns true on success
- Save text data to file (write), string must be ‘\0’ terminated, returns true on success
- Seek music to a position (in seconds)
- Default size for new audio streams
- Audio thread callback to request new data
- Set pan for audio stream (0.5 is centered)
- Set pitch for audio stream (1.0 is base level)
- Set volume for audio stream (1.0 is max level)
- Set clipboard text content
- Setup init configuration flags (view FLAGS)
- Set a custom key to exit program (default is ESC)
- Set internal gamepad mappings (SDL_GameControllerDB)
- Enable a set of gestures using flags
- Set custom file binary data loader
- Set custom file text data loader
- Set master volume (listener)
- Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR…)
- Set material for a mesh
- Set mouse cursor
- Set mouse offset
- Set mouse position XY
- Set mouse scaling
- Set pan for a music (0.5 is center)
- Set pitch for a music (1.0 is base level)
- Set volume for music (1.0 is max level)
- Set color formatted into destination pixel pointer
- Set the seed for the random number generator
- Set custom file binary data saver
- Set custom file text data saver
- Set shader uniform value
- Set shader uniform value (matrix 4x4)
- Set shader uniform value for texture (sampler2d)
- Set shader uniform value vector
- Set texture and rectangle to be used on shapes drawing
- Set pan for a sound (0.5 is center)
- Set pitch for a sound (1.0 is base level)
- Set volume for a sound (1.0 is max level)
- Set target FPS (maximum)
- Set texture scaling filter mode
- Set texture wrapping mode
- Set custom trace log
- Set the current threshold (minimum) log level
- Set icon for window (single image, RGBA 32bit, only PLATFORM_DESKTOP)
- Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)
- Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
- Set monitor for the current window (fullscreen mode)
- Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)
- Set window position on screen (only PLATFORM_DESKTOP)
- Set window dimensions
- Set window configuration state using flags (only PLATFORM_DESKTOP)
- Set title for window (only PLATFORM_DESKTOP)
- Shows cursor
- Stop audio stream
- Stop music playing
- Stop playing a sound
- Swap back buffer with front buffer (screen drawing)
- Takes a screenshot of current screen (filename extension defines format)
- Append text at specific position and move cursor!
- Copy one string to another, returns bytes copied
- Find first text occurrence within a string
- Text formatting with variables (sprintf() style)
- Insert text in a position (WARNING: memory must be freed!)
- Check if two text string are equal
- Join text strings with delimiter
- Get text length, checks for ‘\0’ ending
- Replace text string (WARNING: memory must be freed!)
- Split text into multiple strings
- Get a piece of a text string
- Get integer value from text (negative values not supported)
- Get lower case version of provided string
- Get Pascal case notation version of provided string
- Get upper case version of provided string
- Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)
- Show trace log messages (LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERROR…)
- Unload audio stream and free memory
- Unload codepoints data from memory
- Unload filepaths
- Unload dropped filepaths
- Unload file data allocated by LoadFileData()
- Unload file text data allocated by LoadFileText()
- Unload font from GPU memory (VRAM)
- Unload font chars info data (RAM)
- Unload image from CPU memory (RAM)
- Unload color data loaded with LoadImageColors()
- Unload colors palette loaded with LoadImagePalette()
- Unload material from GPU memory (VRAM)
- Unload mesh data from CPU and GPU
- Unload model (including meshes) from memory (RAM and/or VRAM)
- Unload animation data
- Unload animation array data
- Unload music stream
- Unload render texture from GPU memory (VRAM)
- Unload shader from GPU memory (VRAM)
- Unload sound
- Unload texture from GPU memory (VRAM)
- Unload UTF-8 text encoded from codepoints array
- Unload VR stereo config
- Unload wave data
- Unload samples data loaded with LoadWaveSamples()
- Update audio stream buffers with data
- Update camera position for selected mode
- Update camera movement/rotation
- Update mesh vertex data in GPU for a specific buffer index
- Update model animation pose
- Updates buffers for music streaming
- Update sound buffer with new data
- Update GPU texture with new data
- Update GPU texture rectangle with new data
- Upload mesh vertex data in GPU and provide VAO/VBO ids
- Wait for some time (halt program execution)
- Copy a wave to a new wave
- Crop a wave to defined samples range
- Convert wave data to desired format
- Check if KEY_ESCAPE pressed or Close icon pressed
Type Aliases
- Camera type fallback, defaults to Camera3D
- FileIO: Load binary data
- FileIO: Load text data
- Quaternion, 4 components (Vector4 alias)
- RenderTexture2D, same as RenderTexture
- FileIO: Save binary data
- FileIO: Save text data
- Texture2D, same as Texture
- TextureCubemap, same as Texture
- Logging: Redirect trace log messages