Skip to content
JoeStrout edited this page Apr 15, 2026 · 1 revision

RCore

Name Parameters Purpose
BeginDrawing Setup canvas (framebuffer) to start drawing
EndDrawing End canvas drawing and swap buffers (double buffering)
ClearBackground color=BLACK Set background color (framebuffer clear color)
BeginMode3D camera Initializes 3D mode with custom camera (3D)
EndMode3D Ends 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 the screen space position from a 3d world space position
GetWorldToScreenEx position, camera, width=0, height=0 Get size 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
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 a 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 a key has been pressed once
IsKeyPressedRepeat key Check if a key has been pressed again
IsKeyDown key Check if a key is being pressed (key held down)
IsKeyReleased key Check if a key has been released once
IsKeyUp key Check if a 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 a gamepad is available
GetGamepadName gamepad=0
IsGamepadButtonPressed gamepad=0, button Check if a gamepad button has been pressed once
IsGamepadButtonDown gamepad=0, button Check if a gamepad button is being pressed
IsGamepadButtonReleased gamepad=0, button Check if a gamepad button has NOT been pressed once
IsGamepadButtonUp gamepad=0, button Check if a 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 a mouse button has been pressed once
IsMouseButtonDown button Check if a mouse button is being pressed
IsMouseButtonReleased button Check if a mouse button has been released once
IsMouseButtonUp button Check if a 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 Hides 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 Local storage for the window handle returned by glfwGetX11Window This is needed as X11 handles are integers and may not fit inside a pointer depending on platform Storing the handle locally and returning a pointer in GetWindowHandle allows the code to work regardless of pointer width 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 Enables cursor (unlock cursor)
DisableCursor Disables 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 given index
GetTouchPointCount Get number of touch points
SetGesturesEnabled flags Enable only desired gestures to be detected
IsGestureDetected gesture Check if a 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 Ends 2D mode with custom camera
GetCameraMatrix2D camera Get camera 2d transform matrix
GetWorldToScreen2D position, camera Get the screen space position for a 2d camera world space position
GetScreenToWorld2D position, camera Get the 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)
rlSetBlendFactors glSrcFactor, glDstFactor, glEquation Set blending mode factor and equation
rlSetBlendFactorsSeparate glSrcRGB, glDstRGB, glSrcAlpha, glDstAlpha, glEqRGB, glEqAlpha Set blending mode factor and equation separately for RGB and alpha
rlMatrixMode mode Choose the current matrix to be transformed
rlPushMatrix Push the current matrix into RLGL.State.stack
rlPopMatrix Pop latest inserted matrix from RLGL.State.stack
rlLoadIdentity Reset current matrix to identity matrix
rlTranslatef x=0, y=0, z=0 Multiply the current matrix by a translation matrix
rlRotatef angle=0, x=0, y=0, z=0 Multiply the current matrix by a rotation matrix NOTE: The provided angle must be in degrees
rlScalef x=1, y=1, z=1 Multiply the current matrix by a scaling matrix
rlMultMatrixf matf Multiply the current matrix by another matrix
rlFrustum left, right, bottom, top, znear, zfar Multiply the current matrix by a perspective matrix generated by parameters
rlOrtho left, right, bottom, top, znear, zfar Multiply the current matrix by an orthographic matrix generated by parameters
rlViewport x, y, width, height Set the viewport area (transformation from normalized device coordinates to window coordinates)
rlSetClipPlanes nearPlane, farPlane Set clip planes distances
rlGetCullDistanceNear Get cull plane distance near
rlGetCullDistanceFar Get cull plane distance far
rlEnableBackfaceCulling
rlDisableBackfaceCulling
rlEnableDepthTest
rlDisableDepthTest
rlEnableDepthMask
rlDisableDepthMask
rlEnableWireMode Enable wire mode
rlDisableWireMode Disable wire mode
rlEnableSmoothLines Enable line aliasing
rlDisableSmoothLines Disable line aliasing
rlSetLineWidth width=1
rlGetLineWidth Get the line drawing width
rlDrawRenderBatchActive Update and draw internal render batch
rlGetMatrixModelview Get internal modelview matrix
rlGetMatrixProjection Get internal projection matrix
rlSetMatrixProjection proj Set a custom projection matrix (replaces internal projection matrix)
rlSetMatrixModelview view Set a custom modelview matrix (replaces internal modelview matrix)
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) NOTE: This function is only safe to use if you control the URL given A user could craft a malicious string performing another action Only call this function yourself not with user input or make sure to check the string yourself REF: https://github.com/raysan5/raylib/issues/686
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 NOTE: Provided fileName should not contain paths, saving to working directory
SetConfigFlags flags Setup 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 a 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 true on success
IsPathFile path Check if a given path point to a file
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 files count No recursive scanning is done!
LoadDirectoryFilesEx basePath, filter, scanSubdirs=0 Load directory filepaths with extension filtering and recursive directory scan Use 'DIR*' to include directories on directory scan Use '.' to include all file types and directories on directory scan WARNING: Directory is scanned twice, first time to get files count
UnloadDirectoryFiles files Unload directory filepaths WARNING: files.count is not reseted to 0 after unloading
IsFileDropped Check if a 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