Skip to content
JoeStrout edited this page Oct 17, 2026 · 3 revisions

RCore

Name Parameters Purpose
BeginDrawing Begin canvas (framebuffer) drawing
EndDrawing End canvas (framebuffer) drawing and swap buffers (double buffering)
ClearBackground color=BLACK Clear background (framebuffer) to color
BeginMode3D camera Initializes 3D mode with custom camera (3D)
EndMode3D End 3D mode and returns to default 2D orthographic mode
GetScreenToWorldRay position, camera Get a ray trace from screen position (i.e mouse)
GetScreenToWorldRayEx position, camera, width=0, height=0 Get a ray trace from the screen position (i.e mouse) within a specific section of the screen
GetWorldToScreen position, camera Get screen space position from a 3d world space position
GetWorldToScreenEx position, camera, width=0, height=0 Get sized screen space position for a 3d world space position (useful for texture drawing)
GetCameraMatrix camera Get transform matrix for camera
UpdateCamera camera, mode=CAMERA_CUSTOM Update camera position for selected mode Camera mode: CAMERA_FREE, CAMERA_FIRST_PERSON, CAMERA_THIRD_PERSON, CAMERA_ORBITAL or CUSTOM
UpdateCameraPro camera, movement=[0, 0, 0], rotation=[0, 0, 0], zoom=0 Update camera movement, movement/rotation values should be provided by user
GetCameraForward camera Returns the cameras forward vector (normalized)
GetCameraUp camera Returns the cameras up vector (normalized) Note: The up vector might not be perpendicular to the forward vector
GetCameraRight camera Returns the cameras right vector (normalized)
CameraMoveForward camera, distance, moveInWorldPlane=1 Moves the camera in its forward direction
CameraMoveUp camera, distance Moves the camera in its up direction
CameraMoveRight camera, distance, moveInWorldPlane=1 Moves the camera target in its current right direction
CameraMoveToTarget camera, delta Moves the camera position closer/farther to/from the camera target
CameraYaw camera, angle, rotateAroundTarget=0 Rotates the camera around its up vector Yaw is "looking left and right" If rotateAroundTarget is false, the camera rotates around its position Note: angle must be provided in radians
CameraPitch camera, angle, lockView=1, rotateAroundTarget=0, rotateUp=0 Rotates the camera around its right vector, pitch is "looking up and down" - lockView prevents camera overrotation (aka "somersaults") - rotateAroundTarget defines if rotation is around target or around its position - rotateUp rotates the up direction as well (typically only useful in CAMERA_FREE) NOTE: [angle] must be provided in radians
CameraRoll camera, angle Rotates the camera around its forward vector Roll is "turning your head sideways to the left or right" Note: angle must be provided in radians
GetCameraViewMatrix camera Returns the camera view matrix
GetCameraProjectionMatrix camera, aspect=0 Returns the camera projection matrix
LoadShader vsFileName=String(), fsFileName=String() Load shader from files and bind default locations NOTE: If shader filename is NULL, using default vertex/fragment shaders
LoadShaderFromMemory vsCode=String(), fsCode=String() Load shader from code strings and bind default locations
IsShaderValid shader Check if shader is valid (loaded on GPU)
BeginShaderMode shader Begin custom shader mode
EndShaderMode End custom shader mode (returns to default shader)
GetShaderLocation shader, uniformName Get shader uniform location
GetShaderLocationAttrib shader, attribName Get shader attribute location
SetShaderValueMatrix shader, locIndex, mat Set shader uniform value (matrix 4x4)
SetShaderValueTexture shader, locIndex, texture Set shader uniform value for texture
SetShaderValue shader, locIndex, value, uniformType=SHADER_UNIFORM_FLOAT Set shader uniform value
SetShaderValueV shader, locIndex, value, uniformType=SHADER_UNIFORM_FLOAT, count=0 Set shader uniform value vector
UnloadShader shader Unload shader from GPU memory (VRAM)
SetTargetFPS fps Set target FPS (maximum)
GetFrameTime Get time in seconds for last frame drawn (delta time)
GetTime Get elapsed time measure in seconds since InitTimer()
GetFPS Get current FPS NOTE: Calculating an average framerate
IsKeyPressed key Check if key has been pressed once
IsKeyPressedRepeat key Check if key has been pressed again
IsKeyDown key Check if key is being pressed (key held down)
IsKeyReleased key Check if key has been released once
IsKeyUp key Check if key is NOT being pressed (key not held down)
GetKeyPressed Get the last key pressed
GetCharPressed Get the last char pressed
GetKeyName key
SetExitKey key Set a custom key to exit program NOTE: default exitKey is set to ESCAPE
IsGamepadAvailable gamepad=0 Check if gamepad is available
GetGamepadName gamepad=0
IsGamepadButtonPressed gamepad=0, button Check if gamepad button has been pressed once
IsGamepadButtonDown gamepad=0, button Check if gamepad button is being pressed
IsGamepadButtonReleased gamepad=0, button Check if gamepad button has NOT been pressed once
IsGamepadButtonUp gamepad=0, button Check if gamepad button is NOT being pressed
GetGamepadButtonPressed Get the last gamepad button pressed NOTE: Returns last gamepad button down, down->up change not considered
GetGamepadAxisCount gamepad=0 Get gamepad axis count
GetGamepadAxisMovement gamepad=0, axis Get axis movement vector for a gamepad
SetGamepadMappings mappings Set internal gamepad mappings
SetGamepadVibration gamepad=0, leftMotor=0.0, rightMotor=0.0, duration=0.0 Set gamepad vibration
IsMouseButtonPressed button Check if mouse button has been pressed once
IsMouseButtonDown button Check if mouse button is being pressed
IsMouseButtonReleased button Check if mouse button has been released once
IsMouseButtonUp button Check if mouse button is NOT being pressed
GetMouseX Get mouse position X
GetMouseY Get mouse position Y
GetMousePosition Get mouse position XY
GetMouseDelta Get mouse delta between frames
GetMouseWheelMove Get mouse wheel movement Y
SetMouseCursor cursor Set mouse cursor
ShowCursor Show mouse cursor
HideCursor Hide mouse cursor
IsCursorHidden Check if cursor is not visible
IsCursorOnScreen Check if cursor is on the current screen
SetWindowTitle caption="raylib-miniscript" Set title for window
SetWindowIcon image Set icon for window NOTE 1: Image must be in RGBA format, 8bit per channel NOTE 2: Image is scaled by the OS for all required sizes
SetWindowIcons images, count=0 Set icon for window, multiple images NOTE 1: Images must be in RGBA format, 8bit per channel NOTE 2: The multiple images are used depending on provided sizes Standard Windows icon sizes: 256, 128, 96, 64, 48, 32, 24, 16
GetScreenWidth Get current screen width
GetScreenHeight Get current screen height
GetRenderWidth Get current render width which is equal to screen width*dpi scale
GetRenderHeight Get current screen height which is equal to screen height*dpi scale
InitWindow width=960, height=640, title="raylib-miniscript" Initialize window and OpenGL context
CloseWindow Close window and unload OpenGL context
WindowShouldClose Check if application should close NOTE: By default, if KEY_ESCAPE pressed or window close icon clicked
IsWindowFullscreen Check if window is currently fullscreen
IsWindowHidden Check if window is currently hidden
IsWindowMinimized Check if window has been minimized
IsWindowMaximized Check if window has been maximized
IsWindowResized Check if window has been resizedLastFrame
IsWindowState flags Check if one specific window flag is enabled
SetWindowState flags Set window configuration state using flags
ClearWindowState flags Clear window configuration state flags
ToggleFullscreen Toggle fullscreen mode
ToggleBorderlessWindowed Toggle borderless windowed mode
MaximizeWindow Set window state: maximized, if resizable
MinimizeWindow Set window state: minimized
RestoreWindow Restore window from being minimized/maximized
SetWindowPosition x, y Set window position on screen (windowed mode)
SetWindowMonitor monitor Set monitor for the current window
SetWindowMinSize width, height Set window minimum dimensions (FLAG_WINDOW_RESIZABLE)
SetWindowMaxSize width, height Set window maximum dimensions (FLAG_WINDOW_RESIZABLE)
SetWindowSize width, height Set window dimensions
SetWindowOpacity opacity Set window opacity, value opacity is between 0.0 and 1.0
SetWindowFocused Set window focused
GetWindowHandle Get native window handle
GetMonitorCount Get number of monitors
GetCurrentMonitor Get current monitor where window is placed
GetMonitorPosition monitor=0 Get selected monitor position
GetMonitorWidth monitor=0 Get selected monitor width (currently used by monitor)
GetMonitorHeight monitor=0 Get selected monitor height (currently used by monitor)
GetMonitorPhysicalWidth monitor=0 Get selected monitor physical width in millimetres
GetMonitorPhysicalHeight monitor=0 Get selected monitor physical height in millimetres
GetMonitorRefreshRate monitor=0 Get selected monitor refresh rate
GetMonitorName monitor=0
GetWindowPosition Get window position XY on monitor
GetWindowScaleDPI Get window scale DPI factor for current monitor
IsWindowFocused Check if window has the focus
IsWindowReady Check if window has been initialized successfully
GetMouseWheelMoveV Get mouse wheel movement X/Y as a vector
SetMousePosition x, y Set mouse position XY
SetMouseOffset offsetX, offsetY Set mouse offset NOTE: Useful when rendering to different size targets
SetMouseScale scaleX, scaleY Set mouse scaling NOTE: Useful when rendering to different size targets
EnableCursor Enable cursor (unlock cursor)
DisableCursor Disable cursor (lock cursor)
GetTouchX Get touch position X for touch point 0 (relative to screen size)
GetTouchY Get touch position Y for touch point 0 (relative to screen size)
GetTouchPosition index=0 Get touch position XY for a touch point index (relative to screen size)
GetTouchPointId index=0 Get touch point identifier for provided index
GetTouchPointCount Get number of touch points
SetGesturesEnabled flags Enable only desired gestures to be detected
IsGestureDetected gesture Check if gesture have been detected
GetGestureDetected Get latest detected gesture
GetGestureHoldDuration Hold time measured in seconds
GetGestureDragVector Get drag vector (between initial touch point to current)
GetGestureDragAngle Get drag angle NOTE: Angle in degrees, horizontal-right is 0, counterclockwise
GetGesturePinchVector Get distance between two pinch points
GetGesturePinchAngle Get angle between two pinch points NOTE: Angle in degrees, horizontal-right is 0, counterclockwise
BeginMode2D camera Initialize 2D mode with custom camera (2D)
EndMode2D End 2D mode with custom camera
GetCameraMatrix2D camera Get camera 2d transform matrix
GetWorldToScreen2D position, camera Get screen space position for a 2d camera world space position
GetScreenToWorld2D position, camera Get world space position for a 2d camera screen space position
BeginBlendMode mode Begin blending mode (alpha, additive, multiplied, subtract, custom) NOTE: Blend modes supported are enumerated in BlendMode enum
EndBlendMode End blending mode (reset to default: alpha blending)
BeginScissorMode x, y, width, height Begin scissor mode (define screen area for following drawing) NOTE: Scissor rec refers to bottom-left corner, changing it to upper-left
EndScissorMode End scissor mode
BeginVrStereoMode config Begin VR drawing configuration
EndVrStereoMode End VR drawing process (and desktop mirror)
LoadVrStereoConfig device Load VR stereo config for VR simulator device parameters
UnloadVrStereoConfig config Unload VR stereo config properties
OpenURL url Open URL with default system browser (if available) WARNING: This function is only safe to use if you control the URL given, a user could craft a malicious string to perform and undesired action NOTE: Some safety checks have been added to mitigate security issues
SetClipboardText text Set clipboard text content
GetClipboardText
EnableEventWaiting Enable waiting for events on EndDrawing(), no automatic event polling
DisableEventWaiting Disable waiting for events on EndDrawing(), automatic events polling
GetClipboardImage Get clipboard image
IsFileExtension fileName, ext Check file extension
TakeScreenshot fileName Takes a screenshot of current screen
SetConfigFlags flags Set up window configuration flags (view FLAGS) NOTE: This function is expected to be called before window creation, because it sets up some flags for the window creation process To configure window states after creation, use SetWindowState()
EncodeDataBase64 data, dataSize Encode data to Base64 string NOTE: Returned string includes NULL terminator, considered on outputSize
WaitTime seconds=1.0 Wait for some time (stop program execution) NOTE: Sleep() granularity could be around 10 ms, it means, Sleep() could take longer than expected... for that reason a busy wait loop is used REF: http://stackoverflow.com/questions/43057578/c-programming-win32-games-sleep-taking-longer-than-expected REF: http://www.geisswerks.com/ryan/FAQS/timing.html --> All about timing on Win32!
SwapScreenBuffer Swap back buffer with front buffer (screen drawing)
PollInputEvents Register all input events
LoadFileText fileName Load text data from file, returns a '\0' terminated string NOTE: text chars array should be freed manually
LoadFileData fileName
UnloadFileData data Unload file data allocated by LoadFileData()
SaveFileData fileName, data, dataSize=0 Save data to file from buffer
ExportDataAsCode data, dataSize, fileName Export data to code (.h), returns true on success
UnloadFileText text Unload file text data allocated by LoadFileText()
SaveFileText fileName, text Save text data to file (write), string must be '\0' terminated
SetLoadFileDataCallback callback=null Set custom file binary data loader
SetSaveFileDataCallback callback=null Set custom file binary data saver
SetLoadFileTextCallback callback=null Set custom file text data loader
SetSaveFileTextCallback callback=null Set custom file text data saver
FileRename fileName, fileRename Rename file (if exists) NOTE: Only rename file name required, not full path
FileRemove fileName Remove file (if exists)
FileCopy srcPath, dstPath Copy file from one path to another NOTE: If destination path does not exist, it is created!
FileMove srcPath, dstPath Move file from one directory to another NOTE: If dst directories do not exists they are created
FileTextReplace fileName, search, replacement Replace text in an existing file WARNING: DEPENDENCY: [rtext] module
FileTextFindIndex fileName, search Find text index position in existing file WARNING: DEPENDENCY: [rtext] module
FileExists fileName Check if the file exists
DirectoryExists dirPath Check if directory path exists
GetFileLength fileName Get file length in bytes NOTE: GetFileSize() conflicts with windows.h
GetFileModTime fileName Get file modification time (last write time)
GetFileExtension fileName
GetFileName filePath
GetFileNameWithoutExt filePath
GetDirectoryPath filePath
GetPrevDirectoryPath dirPath
GetWorkingDirectory
GetApplicationDirectory
MakeDirectory dirPath Create directories (including full path requested), returns 0 on success
ChangeDirectory dirPath Change working directory, returns 0 on success (nonzero on failure)
IsPathFile path Check if provided path point to a file
IsPathDirectory path Check if provided path points to an existing directory
IsPathAbsolute path Check if provided path is an absolute path
IsFileHidden filePath Check if file path (file or directory) is hidden by OS
IsFileNameValid fileName Check if fileName is valid for the platform/OS
LoadDirectoryFiles dirPath Load directory filepaths NOTE: Base path is prepended to the scanned filepaths WARNING: Directory is scanned twice, first time to get paths count Scanneed files and directories, no recursive/subdirs scanning
LoadDirectoryFilesEx basePath, filter, scanSubdirs=0 Load directory filepaths with extension filtering and recursive directory scan Use "." to include all files and directories on scan Use "FILES*" to include only files on scan Use "DIRS*" to include only directories on scan WARNING: Directory is scanned twice, first time to get paths count
UnloadDirectoryFiles files Unload directory filepaths WARNING: files.count is not reseted to 0 after unloading
IsFileDropped Check if file has been dropped into window
LoadDroppedFiles Load dropped filepaths
UnloadDroppedFiles files Unload dropped filepaths
GetDirectoryFileCount dirPath
GetDirectoryFileCountEx basePath, filter, scanSubdirs=0
CompressData data, dataSize=0
DecompressData compData, compDataSize=0
DecodeDataBase64 text
ComputeCRC32 data, dataSize=0
ComputeMD5 data, dataSize=0
ComputeSHA1 data, dataSize=0
ComputeSHA256 data, dataSize=0
LoadAutomationEventList fileName=String() Load automation events list from file, NULL for empty list, capacity = MAX_AUTOMATION_EVENTS
UnloadAutomationEventList list Unload automation events list from file
ExportAutomationEventList list, fileName Export automation events list as text file
SetAutomationEventList list=null Setup automation event list to record to
SetAutomationEventBaseFrame frame Set automation event internal base frame to start recording
StartAutomationEventRecording Start recording automation events (AutomationEventList must be set)
StopAutomationEventRecording Stop recording automation events
PlayAutomationEvent event Play a recorded automation event
SetRandomSeed seed Set the seed for the random number generator
GetRandomValue min, max Get a random value between min and max included
LoadRandomSequence count, min, max Load random values sequence, no values repeated, min and max included
UnloadRandomSequence sequence=null Unload random values sequence
SetTraceLogLevel logLevel Logging and tracing
SetTraceLogCallback callback=null Set custom trace log
TraceLog logLevel, text Show trace log messages (LOG_INFO, LOG_WARNING, LOG_ERROR, LOG_DEBUG)

Clone this wiki locally