Window, drawing, shaders, timing, files and input. 211 functions, from raylib's rcore.
Window-related functions
Initialize window and OpenGL context
Zigfn initWindow(width: i32, height: i32, title: [:0]const u8) void
Cvoid InitWindow(int width, int height, const char *title);
Used in core_basic_window, core_delta_time, core_input_keys, core_input_mouse, core_input_mouse_wheel, core_input_gamepad and 220 more.
Close window and unload OpenGL context
Zigfn closeWindow() void
Cvoid CloseWindow(void);
Used in core_basic_window, core_delta_time, core_input_keys, core_input_mouse, core_input_mouse_wheel, core_input_gamepad and 220 more.
Check if application should close (KEY_ESCAPE pressed or windows close icon clicked)
Zigfn windowShouldClose() bool
Cbool WindowShouldClose(void);
Used in core_basic_window, core_delta_time, core_input_keys, core_input_mouse, core_input_mouse_wheel, core_input_gamepad and 220 more.
Check if window has been initialized successfully
Zigfn isWindowReady() bool
Cbool IsWindowReady(void);
Check if window is currently fullscreen
Zigfn isWindowFullscreen() bool
Cbool IsWindowFullscreen(void);
Check if window is currently hidden
Zigfn isWindowHidden() bool
Cbool IsWindowHidden(void);
Check if window is currently minimized
Zigfn isWindowMinimized() bool
Cbool IsWindowMinimized(void);
Check if window is currently maximized
Zigfn isWindowMaximized() bool
Cbool IsWindowMaximized(void);
Check if window is currently focused
Zigfn isWindowFocused() bool
Cbool IsWindowFocused(void);
Check if window has been resized last frame
Zigfn isWindowResized() bool
Cbool IsWindowResized(void);
Used in core_viewport_scaling, shaders_raymarching_rendering.
Check if one specific window flag is enabled
Zigfn isWindowState(flag: ConfigFlags) bool
Cbool IsWindowState(unsigned int flag);
Used in core_window_flags.
Set window configuration state using flags
Zigfn setWindowState(flags: ConfigFlags) void
Cvoid SetWindowState(unsigned int flags);
Used in core_window_flags.
Clear window configuration state flags
Zigfn clearWindowState(flags: ConfigFlags) void
Cvoid ClearWindowState(unsigned int flags);
Used in core_window_flags.
Toggle window state: fullscreen/windowed, resizes monitor to match window resolution
Zigfn toggleFullscreen() void
Cvoid ToggleFullscreen(void);
Used in core_window_flags, core_highdpi_testbed.
Toggle window state: borderless windowed, resizes window to match monitor resolution
Zigfn toggleBorderlessWindowed() void
Cvoid ToggleBorderlessWindowed(void);
Used in core_window_flags, core_highdpi_testbed.
Set window state: maximized, if resizable
Zigfn maximizeWindow() void
Cvoid MaximizeWindow(void);
Used in core_window_flags.
Set window state: minimized, if resizable
Zigfn minimizeWindow() void
Cvoid MinimizeWindow(void);
Used in core_window_flags.
Restore window from being minimized/maximized
Zigfn restoreWindow() void
Cvoid RestoreWindow(void);
Used in core_window_flags.
Set icon for window (single image, RGBA 32bit)
Zigfn setWindowIcon(image: Image) void
Cvoid SetWindowIcon(Image image);
Set icon for window (multiple images, RGBA 32bit)
Zigfn setWindowIcons(images: []Image) void
Cvoid SetWindowIcons(Image *images, int count);
Set title for window
Zigfn setWindowTitle(title: [:0]const u8) void
Cvoid SetWindowTitle(const char *title);
Set window position on screen
Zigfn setWindowPosition(x: i32, y: i32) void
Cvoid SetWindowPosition(int x, int y);
Set monitor for the current window
Zigfn setWindowMonitor(monitor: i32) void
Cvoid SetWindowMonitor(int monitor);
Used in core_monitor_detector, core_highdpi_demo.
Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
Zigfn setWindowMinSize(width: i32, height: i32) void
Cvoid SetWindowMinSize(int width, int height);
Used in core_window_letterbox, core_highdpi_demo.
Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)
Zigfn setWindowMaxSize(width: i32, height: i32) void
Cvoid SetWindowMaxSize(int width, int height);
Set window dimensions
Zigfn setWindowSize(width: i32, height: i32) void
Cvoid SetWindowSize(int width, int height);
Set window opacity [0.0f..1.0f]
Zigfn setWindowOpacity(opacity: f32) void
Cvoid SetWindowOpacity(float opacity);
Set window focused
Zigfn setWindowFocused() void
Cvoid SetWindowFocused(void);
Get native window handle
Zigfn getWindowHandle() ?*anyopaque
Cvoid *GetWindowHandle(void);
Get current screen width
Zigfn getScreenWidth() i32
Cint GetScreenWidth(void);
Used in core_2d_camera_mouse_zoom, core_2d_camera_split_screen, core_3d_camera_split_screen, core_window_flags, core_window_letterbox, core_vr_simulator and 51 more.
Get current screen height
Zigfn getScreenHeight() i32
Cint GetScreenHeight(void);
Used in core_2d_camera_mouse_zoom, core_2d_camera_split_screen, core_3d_camera_split_screen, core_window_flags, core_window_letterbox, core_vr_simulator and 49 more.
Get current render width (it considers HiDPI)
Zigfn getRenderWidth() i32
Cint GetRenderWidth(void);
Used in core_2d_camera, core_2d_camera_platformer, core_automation_events, core_highdpi_demo, core_highdpi_testbed, core_screen_recording and 2 more.
Get current render height (it considers HiDPI)
Zigfn getRenderHeight() i32
Cint GetRenderHeight(void);
Used in core_2d_camera, core_2d_camera_platformer, core_automation_events, core_highdpi_testbed, core_screen_recording, shapes_kaleidoscope.
Get number of connected monitors
Zigfn getMonitorCount() i32
Cint GetMonitorCount(void);
Used in core_monitor_detector, core_highdpi_demo, core_highdpi_testbed.
Get current monitor where window is placed
Zigfn getCurrentMonitor() i32
Cint GetCurrentMonitor(void);
Used in core_monitor_detector, core_highdpi_demo, core_highdpi_testbed.
Get specified monitor position
Zigfn getMonitorPosition(monitor: i32) Vector2
CVector2 GetMonitorPosition(int monitor);
Used in core_monitor_detector.
Get specified monitor width (current video mode used by monitor)
Zigfn getMonitorWidth(monitor: i32) i32
Cint GetMonitorWidth(int monitor);
Used in core_monitor_detector, core_highdpi_testbed.
Get specified monitor height (current video mode used by monitor)
Zigfn getMonitorHeight(monitor: i32) i32
Cint GetMonitorHeight(int monitor);
Used in core_monitor_detector, core_highdpi_testbed.
Get specified monitor physical width in millimetres
Zigfn getMonitorPhysicalWidth(monitor: i32) i32
Cint GetMonitorPhysicalWidth(int monitor);
Used in core_monitor_detector.
Get specified monitor physical height in millimetres
Zigfn getMonitorPhysicalHeight(monitor: i32) i32
Cint GetMonitorPhysicalHeight(int monitor);
Used in core_monitor_detector.
Get specified monitor refresh rate
Zigfn getMonitorRefreshRate(monitor: i32) i32
Cint GetMonitorRefreshRate(int monitor);
Used in core_monitor_detector.
Get window position XY on monitor
Zigfn getWindowPosition() Vector2
CVector2 GetWindowPosition(void);
Used in core_monitor_detector, core_highdpi_testbed, shapes_ball_physics.
Get window scale DPI factor
Zigfn getWindowScaleDPI() Vector2
CVector2 GetWindowScaleDPI(void);
Used in core_2d_camera_mouse_zoom, core_2d_camera_split_screen, core_highdpi_demo, core_highdpi_testbed, textures_magnifying_glass.
Get the human-readable, UTF-8 encoded name of the specified monitor
Zigfn getMonitorName(monitor: i32) [:0]const u8
Cconst char *GetMonitorName(int monitor);
Used in core_monitor_detector.
Set clipboard text content
Zigfn setClipboardText(text: [:0]const u8) void
Cvoid SetClipboardText(const char *text);
Used in core_clipboard_text, shapes_rlgl_color_wheel.
Get clipboard text content
Zigfn getClipboardText() ?[:0]const u8
Cconst char *GetClipboardText(void);
Used in core_clipboard_text.
Get clipboard image content
Zigfn getClipboardImage() Image
CImage GetClipboardImage(void);
Used in textures_clipboard_image.
Enable waiting for events on EndDrawing(), no automatic event polling
Zigfn enableEventWaiting() void
Cvoid EnableEventWaiting(void);
Disable waiting for events on EndDrawing(), automatic events polling
Zigfn disableEventWaiting() void
Cvoid DisableEventWaiting(void);
Drawing-related functions
Clear background (framebuffer) to color
Zigfn clearBackground(color: Color) void
Cvoid ClearBackground(Color color);
Used in core_basic_window, core_delta_time, core_input_keys, core_input_mouse, core_input_mouse_wheel, core_input_gamepad and 218 more.
Begin canvas (framebuffer) drawing
Zigfn beginDrawing() void
Cvoid BeginDrawing(void);
Used in core_basic_window, core_delta_time, core_input_keys, core_input_mouse, core_input_mouse_wheel, core_input_gamepad and 220 more.
End canvas (framebuffer) drawing and swap buffers (double buffering)
Zigfn endDrawing() void
Cvoid EndDrawing(void);
Used in core_basic_window, core_delta_time, core_input_keys, core_input_mouse, core_input_mouse_wheel, core_input_gamepad and 220 more.
Begin 2D mode with custom camera (2D)
Zigfn beginMode2D(camera: Camera2D) void
Cvoid BeginMode2D(Camera2D camera);
Used in core_2d_camera, core_2d_camera_mouse_zoom, core_2d_camera_platformer, core_2d_camera_split_screen, core_smooth_pixelperfect, core_automation_events and 4 more.
End 2D mode with custom camera
Zigfn endMode2D() void
Cvoid EndMode2D(void);
Used in core_2d_camera, core_2d_camera_mouse_zoom, core_2d_camera_platformer, core_2d_camera_split_screen, core_smooth_pixelperfect, core_automation_events and 4 more.
Begin 3D mode with custom camera (3D)
Zigfn beginMode3D(camera: Camera3D) void
Cvoid BeginMode3D(Camera3D camera);
Used in core_3d_camera_mode, core_3d_camera_free, core_3d_camera_first_person, core_3d_camera_split_screen, core_3d_camera_fps, core_3d_picking and 57 more.
End 3D mode and returns to default 2D orthographic mode
Zigfn endMode3D() void
Cvoid EndMode3D(void);
Used in core_3d_camera_mode, core_3d_camera_free, core_3d_camera_first_person, core_3d_camera_split_screen, core_3d_camera_fps, core_3d_picking and 57 more.
Begin drawing to render texture
Zigfn beginTextureMode(target: RenderTexture2D) void
Cvoid BeginTextureMode(RenderTexture2D target);
Used in core_2d_camera_split_screen, core_3d_camera_split_screen, core_window_letterbox, core_vr_simulator, core_smooth_pixelperfect, core_render_texture and 23 more.
End drawing to render texture
Zigfn endTextureMode() void
Cvoid EndTextureMode(void);
Used in core_2d_camera_split_screen, core_3d_camera_split_screen, core_window_letterbox, core_vr_simulator, core_smooth_pixelperfect, core_render_texture and 23 more.
Begin custom shader drawing
Zigfn beginShaderMode(shader: Shader) void
Cvoid BeginShaderMode(Shader shader);
Used in core_vr_simulator, text_font_sdf, text_3d_drawing, shaders_ascii_rendering, shaders_basic_lighting, shaders_shapes_textures and 25 more.
End custom shader drawing (use default shader)
Zigfn endShaderMode() void
Cvoid EndShaderMode(void);
Used in core_vr_simulator, text_font_sdf, text_3d_drawing, shaders_ascii_rendering, shaders_basic_lighting, shaders_shapes_textures and 25 more.
Begin blending mode (alpha, additive, multiplied, subtract, custom)
Zigfn beginBlendMode(mode: BlendMode) void
Cvoid BeginBlendMode(int mode);
Used in textures_magnifying_glass, textures_particles_blending, textures_blend_modes, shaders_lightmap_rendering.
End blending mode (reset to default: alpha blending)
Zigfn endBlendMode() void
Cvoid EndBlendMode(void);
Used in textures_magnifying_glass, textures_particles_blending, textures_blend_modes.
Begin scissor mode (define screen area for following drawing)
Zigfn beginScissorMode(x: i32, y: i32, width: i32, height: i32) void
Cvoid BeginScissorMode(int x, int y, int width, int height);
Used in core_scissor_test, shapes_pie_chart.
End scissor mode
Zigfn endScissorMode() void
Cvoid EndScissorMode(void);
Used in core_scissor_test, shapes_pie_chart.
Begin stereo rendering (requires VR simulator)
Zigfn beginVrStereoMode(config: VrStereoConfig) void
Cvoid BeginVrStereoMode(VrStereoConfig config);
Used in core_vr_simulator.
End stereo rendering (requires VR simulator)
Zigfn endVrStereoMode() void
Cvoid EndVrStereoMode(void);
Used in core_vr_simulator.
Shader management functions
Load shader from files and bind default locations
Zigfn loadShader(vsFileName: ?[:0]const u8, fsFileName: ?[:0]const u8) error{LoadFailed}!Shader
CShader LoadShader(const char *vsFileName, const char *fsFileName);
Used in core_vr_simulator, text_font_sdf, text_3d_drawing, models_loading_vox, models_skybox_rendering, models_animation_blend_custom and 38 more.
Load shader from code strings and bind default locations
Zigfn loadShaderFromMemory(vsCode: ?[:0]const u8, fsCode: ?[:0]const u8) error{LoadFailed}!Shader
CShader LoadShaderFromMemory(const char *vsCode, const char *fsCode);
Check if shader is valid (loaded on GPU)
Zigfn isShaderValid(shader: Shader) bool
Cbool IsShaderValid(Shader shader);
Get shader uniform location
Zigfn getShaderLocation(shader: Shader, uniformName: [:0]const u8) i32
Cint GetShaderLocation(Shader shader, const char *uniformName);
Used in core_vr_simulator, models_loading_vox, models_skybox_rendering, shaders_ascii_rendering, shaders_basic_lighting, shaders_custom_uniform and 29 more.
Get shader attribute location
Zigfn getShaderLocationAttrib(shader: Shader, attribName: [:0]const u8) i32
Cint GetShaderLocationAttrib(Shader shader, const char *attribName);
Set shader uniform value
Set shader uniform value. The GLSL type is inferred from `value`: f32, i32, u32, Vector2/3/4 or [2..4] arrays of f32/i32/u32 (float, vec2.., int, ivec2.., uint, uivec2..). Raw C call: `rl.c.SetShaderValue`.
Zigfn setShaderValue(shader: Shader, locIndex: i32, value: anytype) void
Cvoid SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType);
Used in core_vr_simulator, models_loading_vox, models_skybox_rendering, shaders_ascii_rendering, shaders_basic_lighting, shaders_custom_uniform and 27 more.
Set shader uniform value vector
Set shader uniform value array: `values` is a slice (or array pointer) of any type `setShaderValue` accepts; the count is its length.
Zigfn setShaderValueV(shader: Shader, locIndex: i32, values: anytype) void
Cvoid SetShaderValueV(Shader shader, int locIndex, const void *value, int uniformType, int count);
Used in shaders_palette_switch, shaders_lights_bloom.
Set shader uniform value (matrix 4x4)
Zigfn setShaderValueMatrix(shader: Shader, locIndex: i32, mat: Matrix) void
Cvoid SetShaderValueMatrix(Shader shader, int locIndex, Matrix mat);
Used in shaders_shadowmap_rendering.
Set shader uniform value and bind the texture (sampler2d)
Zigfn setShaderValueTexture(shader: Shader, locIndex: i32, texture: Texture2D) void
Cvoid SetShaderValueTexture(Shader shader, int locIndex, Texture2D texture);
Used in shaders_multi_sample2d, shaders_depth_rendering, audio_spectrum_visualizer.
Unload shader from GPU memory (VRAM)
Zigfn unloadShader(shader: Shader) void
Cvoid UnloadShader(Shader shader);
Used in core_vr_simulator, text_font_sdf, text_3d_drawing, models_loading_vox, models_skybox_rendering, models_animation_blend_custom and 37 more.
Screen-space-related functions
Get a ray trace from screen position (i.e mouse)
Zigfn getScreenToWorldRay(position: Vector2, camera: Camera) Ray
CRay GetScreenToWorldRay(Vector2 position, Camera camera);
Used in core_3d_picking, text_3d_drawing, models_mesh_picking, models_loading, models_basic_voxel, models_decals and 2 more.
Get a ray trace from screen position (i.e mouse) in a viewport
Zigfn getScreenToWorldRayEx(position: Vector2, camera: Camera, width: i32, height: i32) Ray
CRay GetScreenToWorldRayEx(Vector2 position, Camera camera, int width, int height);
Get screen space position for a 3d world space position
Zigfn getWorldToScreen(position: Vector3, camera: Camera) Vector2
CVector2 GetWorldToScreen(Vector3 position, Camera camera);
Used in core_world_screen.
Get sized screen space position for a 3d world space position
Zigfn getWorldToScreenEx(position: Vector3, camera: Camera, width: i32, height: i32) Vector2
CVector2 GetWorldToScreenEx(Vector3 position, Camera camera, int width, int height);
Get screen space position for a 2d camera world space position
Zigfn getWorldToScreen2D(position: Vector2, camera: Camera2D) Vector2
CVector2 GetWorldToScreen2D(Vector2 position, Camera2D camera);
Used in core_2d_camera_platformer, core_automation_events.
Get world space position for a 2d camera screen space position
Zigfn getScreenToWorld2D(position: Vector2, camera: Camera2D) Vector2
CVector2 GetScreenToWorld2D(Vector2 position, Camera2D camera);
Used in core_2d_camera_mouse_zoom, core_2d_camera_platformer, shapes_outlines_testbed.
Get camera transform matrix (view matrix)
Zigfn getCameraMatrix(camera: Camera) Matrix
CMatrix GetCameraMatrix(Camera camera);
Used in textures_framebuffer_rendering.
Get camera 2d transform matrix
Zigfn getCameraMatrix2D(camera: Camera2D) Matrix
CMatrix GetCameraMatrix2D(Camera2D camera);
File system management functions
Load file data as byte array (read)
Load file data as byte array (read). Free with `unloadFileData`.
Zigfn loadFileData(fileName: [:0]const u8) error{LoadFailed}![]u8
Cunsigned char *LoadFileData(const char *fileName, int *dataSize);
Used in core_storage_values, text_font_sdf.
Unload file data allocated by LoadFileData()
Unload file data allocated by `loadFileData`.
Zigfn unloadFileData(data: []u8) void
Cvoid UnloadFileData(unsigned char *data);
Used in core_storage_values, text_font_sdf.
Save data to file from byte array (write), returns true on success
Save data to file from byte array (write), returns true on success.
Zigfn saveFileData(fileName: [:0]const u8, data: []const u8) bool
Cbool SaveFileData(const char *fileName, const void *data, int dataSize);
Used in core_storage_values, core_screen_recording.
Export data to code (.h), returns true on success
Zigfn exportDataAsCode(data: []const u8, fileName: [:0]const u8) bool
Cbool ExportDataAsCode(const unsigned char *data, int dataSize, const char *fileName);
Load text data from file (read), returns a '\0' terminated string
Load text data from file (read). Free with `unloadFileText`.
Zigfn loadFileText(fileName: [:0]const u8) error{LoadFailed}![:0]u8
Cchar *LoadFileText(const char *fileName);
Used in core_text_file_loading, shaders_rlgl_compute.
Unload file text data allocated by LoadFileText()
Unload file text data allocated by `loadFileText`.
Zigfn unloadFileText(text: [:0]u8) void
Cvoid UnloadFileText(char *text);
Used in core_text_file_loading, shaders_rlgl_compute.
Save text data to file (write), string must be '\0' terminated, returns true on success
Save text data to file (write), returns true on success.
Zigfn saveFileText(fileName: [:0]const u8, text: [:0]const u8) bool
Cbool SaveFileText(const char *fileName, const char *text);
File access custom callbacks
Set custom file binary data loader
Set custom file binary data loader (raw C callback).
Zigfn setLoadFileDataCallback(callback: LoadFileDataCallback) void
Cvoid SetLoadFileDataCallback(LoadFileDataCallback callback);
Set custom file binary data saver
Set custom file binary data saver (raw C callback).
Zigfn setSaveFileDataCallback(callback: SaveFileDataCallback) void
Cvoid SetSaveFileDataCallback(SaveFileDataCallback callback);
Set custom file text data loader
Set custom file text data loader (raw C callback).
Zigfn setLoadFileTextCallback(callback: LoadFileTextCallback) void
Cvoid SetLoadFileTextCallback(LoadFileTextCallback callback);
Set custom file text data saver
Set custom file text data saver (raw C callback).
Zigfn setSaveFileTextCallback(callback: SaveFileTextCallback) void
Cvoid SetSaveFileTextCallback(SaveFileTextCallback callback);
Rename file (if exists), returns 0 on success
Zigfn fileRename(fileName: [:0]const u8, newFileName: [:0]const u8) i32
Cint FileRename(const char *fileName, const char *fileRename);
Remove file (if exists), returns 0 on success
Zigfn fileRemove(fileName: [:0]const u8) i32
Cint FileRemove(const char *fileName);
Copy file from one path to another, dstPath created if it doesn't exist, returns 0 on success
Zigfn fileCopy(srcPath: [:0]const u8, dstPath: [:0]const u8) i32
Cint FileCopy(const char *srcPath, const char *dstPath);
Move file from one directory to another, dstPath created if it doesn't exist, returns 0 on success
Zigfn fileMove(srcPath: [:0]const u8, dstPath: [:0]const u8) i32
Cint FileMove(const char *srcPath, const char *dstPath);
Replace text in an existing file, returns 0 on success
Zigfn fileTextReplace(fileName: [:0]const u8, search: [:0]const u8, replacement: [:0]const u8) i32
Cint FileTextReplace(const char *fileName, const char *search, const char *replacement);
Find text in existing file, returns -1 if index not found or index otherwise
Zigfn fileTextFindIndex(fileName: [:0]const u8, search: [:0]const u8) i32
Cint FileTextFindIndex(const char *fileName, const char *search);
Check if file exists
Zigfn fileExists(fileName: [:0]const u8) bool
Cbool FileExists(const char *fileName);
Check if directory path exists
Zigfn directoryExists(dirPath: [:0]const u8) bool
Cbool DirectoryExists(const char *dirPath);
Used in core_directory_files.
Check file extension (recommended include point: .png, .wav)
Zigfn isFileExtension(fileName: [:0]const u8, ext: [:0]const u8) bool
Cbool IsFileExtension(const char *fileName, const char *ext);
Used in core_automation_events, text_font_filters, text_3d_drawing, models_loading, models_skybox_rendering.
Check if file path (file or directory) is hidden by OS
Zigfn isFileHidden(filePath: [:0]const u8) bool
Cbool IsFileHidden(const char *filePath);
Get file length in bytes (NOTE: GetFileSize() conflicts with windows.h)
Zigfn getFileLength(fileName: [:0]const u8) i32
Cint GetFileLength(const char *fileName);
Get file modification time (last write time)
Zigfn getFileModTime(fileName: [:0]const u8) i64
Clong GetFileModTime(const char *fileName);
Used in shaders_hot_reloading.
Get pointer to extension for a filename string (includes dot: '.png')
Zigfn getFileExtension(fileName: [:0]const u8) [:0]const u8
Cconst char *GetFileExtension(const char *fileName);
Get pointer to filename for a path string
Zigfn getFileName(filePath: [:0]const u8) [:0]const u8
Cconst char *GetFileName(const char *filePath);
Used in models_loading_vox, models_skybox_rendering.
Get filename string without extension (uses static string)
Zigfn getFileNameWithoutExt(filePath: [:0]const u8) [:0]const u8
Cconst char *GetFileNameWithoutExt(const char *filePath);
Get full path for a provided fileName with path (uses static string)
Zigfn getDirectoryPath(filePath: [:0]const u8) [:0]const u8
Cconst char *GetDirectoryPath(const char *filePath);
Get previous directory path for a provided path (uses static string)
Zigfn getPrevDirectoryPath(dirPath: [:0]const u8) [:0]const u8
Cconst char *GetPrevDirectoryPath(const char *dirPath);
Used in core_directory_files.
Get current working directory (uses static string)
Zigfn getWorkingDirectory() [:0]const u8
Cconst char *GetWorkingDirectory(void);
Used in core_directory_files.
Get the directory of the running application (uses static string)
Zigfn getApplicationDirectory() [:0]const u8
Cconst char *GetApplicationDirectory(void);
Used in core_screen_recording.
Create directories (including full path requested), returns 0 on success
Zigfn makeDirectory(dirPath: [:0]const u8) i32
Cint MakeDirectory(const char *dirPath);
Change working directory, returns 0 on success
Zigfn changeDirectory(dirPath: [:0]const u8) i32
Cint ChangeDirectory(const char *dirPath);
Check if provided path points to a file
Zigfn isPathFile(path: [:0]const u8) bool
Cbool IsPathFile(const char *path);
Check if provided path points to a directory
Zigfn isPathDirectory(path: [:0]const u8) bool
Cbool IsPathDirectory(const char *path);
Check if provided path is an absolute path
Zigfn isPathAbsolute(path: [:0]const u8) bool
Cbool IsPathAbsolute(const char *path);
Check if fileName is valid for the platform/OS
Zigfn isFileNameValid(fileName: [:0]const u8) bool
Cbool IsFileNameValid(const char *fileName);
Load directory filepaths, files and directories, no subdirs scan
Zigfn loadDirectoryFiles(dirPath: [:0]const u8) FilePathList
CFilePathList LoadDirectoryFiles(const char *dirPath);
Load directory filepaths with extension filtering and subdir scan; some filters available: '*.*','FILES*','DIRS*'
Zigfn loadDirectoryFilesEx(basePath: [:0]const u8, filter: [:0]const u8, scanSubdirs: bool) FilePathList
CFilePathList LoadDirectoryFilesEx(const char *basePath, const char *filter, bool scanSubdirs);
Used in core_directory_files.
Unload filepaths
Zigfn unloadDirectoryFiles(files: FilePathList) void
Cvoid UnloadDirectoryFiles(FilePathList files);
Used in core_directory_files.
Check if file has been dropped into window
Zigfn isFileDropped() bool
Cbool IsFileDropped(void);
Used in core_drop_files, core_automation_events, text_font_filters, text_3d_drawing, models_loading, models_skybox_rendering.
Load dropped filepaths
Zigfn loadDroppedFiles() FilePathList
CFilePathList LoadDroppedFiles(void);
Used in core_drop_files, core_automation_events, text_font_filters, text_3d_drawing, models_loading, models_skybox_rendering.
Unload dropped filepaths
Zigfn unloadDroppedFiles(files: FilePathList) void
Cvoid UnloadDroppedFiles(FilePathList files);
Used in core_drop_files, core_automation_events, text_font_filters, text_3d_drawing, models_loading, models_skybox_rendering.
Get the file count in a directory
Zigfn getDirectoryFileCount(dirPath: [:0]const u8) u32
Cunsigned int GetDirectoryFileCount(const char *dirPath);
Get the file count in a directory with extension filtering and recursive directory scan. Use 'DIR' in the filter string to include directories in the result
Zigfn getDirectoryFileCountEx(basePath: [:0]const u8, filter: [:0]const u8, scanSubdirs: bool) u32
Cunsigned int GetDirectoryFileCountEx(const char *basePath, const char *filter, bool scanSubdirs);
Compression/Encoding functionality
Compress data (DEFLATE algorithm), memory must be MemFree()
Compress data (DEFLATE algorithm). Free with `memFree`.
Zigfn compressData(data: []const u8) error{CompressFailed}![]u8
Cunsigned char *CompressData(const unsigned char *data, int dataSize, int *compDataSize);
Decompress data (DEFLATE algorithm), memory must be MemFree()
Decompress data (DEFLATE algorithm). Free with `memFree`.
Zigfn decompressData(compData: []const u8) error{DecompressFailed}![]u8
Cunsigned char *DecompressData(const unsigned char *compData, int compDataSize, int *dataSize);
Encode data to Base64 string (includes NULL terminator), memory must be MemFree()
Encode data to Base64 string (includes NULL terminator). Free with `memFree`.
Zigfn encodeDataBase64(data: []const u8) error{EncodeFailed}![:0]u8
Cchar *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize);
Used in core_compute_hash.
Decode Base64 string (expected NULL terminated), memory must be MemFree()
Decode Base64 string. Free with `memFree`.
Zigfn decodeDataBase64(text: [:0]const u8) error{DecodeFailed}![]u8
Cunsigned char *DecodeDataBase64(const char *text, int *outputSize);
Compute CRC32 hash code
Compute CRC32 hash code.
Zigfn computeCRC32(data: []const u8) u32
Cunsigned int ComputeCRC32(const unsigned char *data, int dataSize);
Used in core_compute_hash.
Compute MD5 hash code, returns static int[4] (16 bytes)
Compute MD5 hash code (returned array lives in a static buffer).
Zigfn computeMD5(data: []const u8) *const [4]u32
Cunsigned int *ComputeMD5(const unsigned char *data, int dataSize);
Used in core_compute_hash.
Compute SHA1 hash code, returns static int[5] (20 bytes)
Compute SHA1 hash code (returned array lives in a static buffer).
Zigfn computeSHA1(data: []const u8) *const [5]u32
Cunsigned int *ComputeSHA1(const unsigned char *data, int dataSize);
Used in core_compute_hash.
Compute SHA256 hash code, returns static int[8] (32 bytes)
Compute SHA256 hash code (returned array lives in a static buffer).
Zigfn computeSHA256(data: []const u8) *const [8]u32
Cunsigned int *ComputeSHA256(const unsigned char *data, int dataSize);
Used in core_compute_hash.
Input-related functions: keyboard
Check if key has been pressed once
Zigfn isKeyPressed(key: KeyboardKey) bool
Cbool IsKeyPressed(int key);
Used in core_delta_time, core_input_mouse, core_input_gamepad, core_2d_camera, core_2d_camera_mouse_zoom, core_2d_camera_platformer and 101 more.
Check if key has been pressed again
Zigfn isKeyPressedRepeat(key: KeyboardKey) bool
Cbool IsKeyPressedRepeat(int key);
Used in shaders_cel_shading.
Check if key is being pressed
Zigfn isKeyDown(key: KeyboardKey) bool
Cbool IsKeyDown(int key);
Used in core_input_keys, core_2d_camera, core_2d_camera_platformer, core_2d_camera_split_screen, core_3d_camera_split_screen, core_3d_camera_fps and 36 more.
Check if key has been released once
Zigfn isKeyReleased(key: KeyboardKey) bool
Cbool IsKeyReleased(int key);
Used in core_input_actions, shapes_rlgl_color_wheel, audio_amp_envelope.
Check if key is NOT being pressed
Zigfn isKeyUp(key: KeyboardKey) bool
Cbool IsKeyUp(int key);
Get key pressed (keycode), call it multiple times for keys queued, returns 0 when the queue is empty
Zigfn getKeyPressed() KeyboardKey
Cint GetKeyPressed(void);
Used in core_keyboard_testbed.
Get char pressed (unicode), call it multiple times for chars queued, returns 0 when the queue is empty
Zigfn getCharPressed() i32
Cint GetCharPressed(void);
Used in core_keyboard_testbed, text_input_box, text_3d_drawing, text_strings_management.
Get name of a QWERTY key on the current keyboard layout (eg returns string 'q' for KEY_A on an AZERTY keyboard)
Zigfn getKeyName(key: KeyboardKey) ?[:0]const u8
Cconst char *GetKeyName(int key);
Set a custom key to exit program (default is ESC)
Zigfn setExitKey(key: KeyboardKey) void
Cvoid SetExitKey(int key);
Used in core_window_should_close, core_keyboard_testbed.
Input-related functions: gamepads
Check if gamepad is available
Zigfn isGamepadAvailable(gamepad: i32) bool
Cbool IsGamepadAvailable(int gamepad);
Used in core_input_gamepad.
Get gamepad internal name id
Zigfn getGamepadName(gamepad: i32) ?[:0]const u8
Cconst char *GetGamepadName(int gamepad);
Used in core_input_gamepad.
Check if gamepad button has been pressed once
Zigfn isGamepadButtonPressed(gamepad: i32, button: GamepadButton) bool
Cbool IsGamepadButtonPressed(int gamepad, int button);
Used in core_input_actions.
Check if gamepad button is being pressed
Zigfn isGamepadButtonDown(gamepad: i32, button: GamepadButton) bool
Cbool IsGamepadButtonDown(int gamepad, int button);
Used in core_input_gamepad, core_input_actions.
Check if gamepad button has been released once
Zigfn isGamepadButtonReleased(gamepad: i32, button: GamepadButton) bool
Cbool IsGamepadButtonReleased(int gamepad, int button);
Used in core_input_actions.
Check if gamepad button is NOT being pressed
Zigfn isGamepadButtonUp(gamepad: i32, button: GamepadButton) bool
Cbool IsGamepadButtonUp(int gamepad, int button);
Get the last gamepad button pressed
Zigfn getGamepadButtonPressed() GamepadButton
Cint GetGamepadButtonPressed(void);
Used in core_input_gamepad.
Get axis count for a gamepad
Zigfn getGamepadAxisCount(gamepad: i32) i32
Cint GetGamepadAxisCount(int gamepad);
Used in core_input_gamepad.
Get movement value for a gamepad axis
Zigfn getGamepadAxisMovement(gamepad: i32, axis: GamepadAxis) f32
Cfloat GetGamepadAxisMovement(int gamepad, int axis);
Used in core_input_gamepad.
Set internal gamepad mappings (SDL_GameControllerDB)
Zigfn setGamepadMappings(mappings: [:0]const u8) i32
Cint SetGamepadMappings(const char *mappings);
Set gamepad vibration for both motors (duration in seconds)
Zigfn setGamepadVibration(gamepad: i32, leftMotor: f32, rightMotor: f32, duration: f32) void
Cvoid SetGamepadVibration(int gamepad, float leftMotor, float rightMotor, float duration);
Used in core_input_gamepad.
Input-related functions: mouse
Check if mouse button has been pressed once
Zigfn isMouseButtonPressed(button: MouseButton) bool
Cbool IsMouseButtonPressed(int button);
Used in core_input_mouse, core_input_gamepad, core_2d_camera_mouse_zoom, core_3d_picking, core_viewport_scaling, shapes_rectangle_scaling and 25 more.
Check if mouse button is being pressed
Zigfn isMouseButtonDown(button: MouseButton) bool
Cbool IsMouseButtonDown(int button);
Used in core_input_virtual_controls, core_2d_camera_mouse_zoom, shapes_lines_bezier, shapes_top_down_lights, shapes_vector_angle, shapes_kaleidoscope and 18 more.
Check if mouse button has been released once
Zigfn isMouseButtonReleased(button: MouseButton) bool
Cbool IsMouseButtonReleased(int button);
Used in core_input_gestures_testbed, shapes_rectangle_scaling, shapes_lines_bezier, shapes_splines_drawing, shapes_rlgl_color_wheel, shapes_rlgl_triangle and 8 more.
Check if mouse button is NOT being pressed
Zigfn isMouseButtonUp(button: MouseButton) bool
Cbool IsMouseButtonUp(int button);
Get mouse position X
Zigfn getMouseX() i32
Cint GetMouseX(void);
Used in core_2d_camera_mouse_zoom, core_scissor_test, core_highdpi_testbed, shapes_collision_area, textures_mouse_painting, shaders_rlgl_compute.
Get mouse position Y
Zigfn getMouseY() i32
Cint GetMouseY(void);
Used in core_2d_camera_mouse_zoom, core_scissor_test, core_highdpi_testbed, shapes_collision_area, textures_mouse_painting, shaders_rlgl_compute.
Get mouse position XY
Zigfn getMousePosition() Vector2
CVector2 GetMousePosition(void);
Used in core_input_mouse, core_input_gamepad, core_input_gestures_testbed, core_input_virtual_controls, core_2d_camera_mouse_zoom, core_3d_picking and 52 more.
Get mouse delta between frames
Zigfn getMouseDelta() Vector2
CVector2 GetMouseDelta(void);
Used in core_2d_camera_mouse_zoom, core_3d_camera_fps, shapes_rlgl_triangle, shapes_outlines_testbed, textures_textured_curve, models_loading_vox.
Set mouse position XY
Zigfn setMousePosition(x: i32, y: i32) void
Cvoid SetMousePosition(int x, int y);
Used in shapes_outlines_testbed.
Set mouse offset
Zigfn setMouseOffset(offsetX: i32, offsetY: i32) void
Cvoid SetMouseOffset(int offsetX, int offsetY);
Used in core_window_letterbox.
Set mouse scaling
Zigfn setMouseScale(scaleX: f32, scaleY: f32) void
Cvoid SetMouseScale(float scaleX, float scaleY);
Used in core_window_letterbox.
Get mouse wheel movement for X or Y, whichever is larger
Zigfn getMouseWheelMove() f32
Cfloat GetMouseWheelMove(void);
Used in core_delta_time, core_input_mouse_wheel, core_2d_camera, core_2d_camera_mouse_zoom, core_2d_camera_platformer, core_automation_events and 13 more.
Get mouse wheel movement for both X and Y
Zigfn getMouseWheelMoveV() Vector2
CVector2 GetMouseWheelMoveV(void);
Used in shapes_outlines_testbed.
Set mouse cursor
Zigfn setMouseCursor(cursor: MouseCursor) void
Cvoid SetMouseCursor(int cursor);
Used in text_input_box.