Native contract
Native only, published ASPL 0.7.0. Import core::raylib or أساسي::رايليب in every source module using it. Each imported short prefix admits both member vocabularies; import both spellings to use both prefixes. User identifiers, record fields, strings and paths keep their identity. These supplied operations require no unsafe declaration and expose no native descriptors.
Read the drawing, text and audio guide and example collection. Checking and building require no display or C compiler. Window operations require supported Linux graphics with OpenGL 3.3 core; audio needs a reachable PulseAudio-compatible or ALSA device. CPU text requires neither. See the deployment requirements. The browser and private embedding reject this supplied library with unsupported-supplied-library-profile, including unused imports.
All ordinary calls return checked results; the seven total probes are IsWindowReady, IsTextureValid, IsFontValid, IsTextLayoutValid, IsAudioDeviceReady, IsSoundValid and IsMusicValid, returning bool. Read only the selected result arm. Numeric widths are exact. Convert an already typed wider value explicitly. Tables below retain the accepted paired declarations checked against the production catalog. Context rules apply transitively through helpers and callable values.
Records require every field exactly once. Both aliases of one field count as a duplicate. Records copy by value and mutation needs a mutable root. Key, mouse, filter, wrap, text direction and alignment enums permit storage and same-type equality, without integer construction, arithmetic or ordering. WindowFlags permits same-type |, &, ^, bounded ~ and equality using the five supported bits and the empty set. TextureFilter admits POINT/BILINEAR; TextureWrap admits REPEAT/CLAMP. Texture, Font, TextLayout, Sound and Music are shared opaque managed owners.
Types and fields
Vector2 / متجه2
Rectangle / مستطيل
Color / لون
Camera2D / كاميرا2
TextOptions / خيارات_النص
TextMetrics / مقاييس_النص
Constants
Window and lifecycle
SetConfigFlags / اضبط_أعلام_الإعداد
(flags: WindowFlags) -> result<unit>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
Replaces saved next-window flags. Call before opening a window; flags survive reopen.
InitWindow / هيئ_نافذة
(width: i32, height: i32, title: string) -> result<unit>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
Positive dimensions; title bytes are copied and retained. New generations reset Escape, input and timing.
IsWindowReady / هل_النافذة_جاهزة
() -> bool
Total probe; handlers/callbacks allowed; no native device entry.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
WindowShouldClose / هل_يجب_إغلاق_النافذة
() -> result<bool>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
CloseWindow / أغلق_النافذة
() -> result<unit>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
Closes texture aliases and GPU caches before destroying the context. CPU fonts/layouts survive.
SetWindowTitle / اضبط_عنوان_النافذة
(title: string) -> result<unit>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
Retains copied title backing until replacement/native quiescence. Refusal preserves the current title; NUL is refused.
GetScreenWidth / عرض_الشاشة
() -> result<i32>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetScreenHeight / ارتفاع_الشاشة
() -> result<i32>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetRenderWidth / عرض_التصيير
() -> result<i32>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetRenderHeight / ارتفاع_التصيير
() -> result<i32>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
IsWindowResized / هل_تغير_حجم_النافذة
() -> result<bool>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
Drawing frames and timing
BeginDrawing / ابدأ_الرسم
() -> result<unit>
Application, main thread; obey the drawing/mode pair rules.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
EndDrawing / أنه_الرسم
() -> result<unit>
Application, main thread; obey the drawing/mode pair rules.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
ClearBackground / امسح_الخلفية
(color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
SetTargetFPS / اضبط_معدل_الإطارات
(fps: i32) -> result<unit>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
Nonnegative FPS; zero is uncapped. Saved pacing survives reopen.
GetFrameTime / زمن_الإطار
() -> result<f32>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetTime / الزمن
() -> result<f64>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetFPS / معدل_الإطارات
() -> result<i32>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
IsKeyPressed / هل_ضغط_المفتاح
(key: Key) -> result<bool>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
IsKeyPressedRepeat / هل_تكرر_ضغط_المفتاح
(key: Key) -> result<bool>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
IsKeyDown / هل_المفتاح_مضغوط
(key: Key) -> result<bool>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
IsKeyReleased / هل_حرر_المفتاح
(key: Key) -> result<bool>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
IsKeyUp / هل_المفتاح_غير_مضغوط
(key: Key) -> result<bool>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetKeyPressed / المفتاح_المضغوط
() -> result<Key>
Application, main thread, live window; sampled observations allowed inside a frame.
Consumes one queue entry; an empty queue returns KEY_NULL.
GetCharPressed / المحرف_المدخل
() -> result<i32>
Application, main thread, live window; sampled observations allowed inside a frame.
Consumes one queue entry; returns i32 zero or a checked Unicode scalar.
SetExitKey / اضبط_مفتاح_الخروج
(key: Key) -> result<unit>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
KEY_NULL disables the exit key. Reopen restores Escape.
(button: MouseButton) -> result<bool>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
(button: MouseButton) -> result<bool>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
(button: MouseButton) -> result<bool>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
(button: MouseButton) -> result<bool>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetMousePosition / موضع_الفأرة
() -> result<Vector2>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetMouseDelta / تغير_موضع_الفأرة
() -> result<Vector2>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetMouseWheelMove / حركة_عجلة_الفأرة
() -> result<f32>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetMouseWheelMoveV / حركة_عجلة_الفأرة_بمتجه
() -> result<Vector2>
Application, main thread, live window; sampled observations allowed inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
2D drawing
DrawPixel / ارسم_بكسلا
(posX: i32, posY: i32, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawPixelV / ارسم_بكسلا_بمتجه
(position: Vector2, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawLine / ارسم_خطا
(startPosX: i32, startPosY: i32, endPosX: i32, endPosY: i32, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawLineV / ارسم_خطا_بمتجه
(startPos: Vector2, endPos: Vector2, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawLineEx / ارسم_خطا_موسعا
(startPos: Vector2, endPos: Vector2, thick: f32, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawCircle / ارسم_دائرة
(centerX: i32, centerY: i32, radius: f32, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawCircleV / ارسم_دائرة_بمتجه
(center: Vector2, radius: f32, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawCircleLines / ارسم_محيط_دائرة
(centerX: i32, centerY: i32, radius: f32, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawRectangle / ارسم_مستطيلا
(posX: i32, posY: i32, width: i32, height: i32, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawRectangleV / ارسم_مستطيلا_بمتجه
(position: Vector2, size: Vector2, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawRectangleRec / ارسم_مستطيلا_بسجل
(rec: Rectangle, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawRectanglePro / ارسم_مستطيلا_متقدما
(rec: Rectangle, origin: Vector2, rotation: f32, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawRectangleLines / ارسم_محيط_مستطيل
(posX: i32, posY: i32, width: i32, height: i32, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawRectangleLinesEx / ارسم_محيط_مستطيل_موسعا
(rec: Rectangle, lineThick: f32, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawTriangle / ارسم_مثلثا
(v1: Vector2, v2: Vector2, v3: Vector2, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawTriangleLines / ارسم_محيط_مثلث
(v1: Vector2, v2: Vector2, v3: Vector2, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
Textures and sprites
LoadTexture / حمل_نسيجا
(fileName: string) -> result<Texture>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
PNG only, with process-working-directory paths and copied path bytes. Requires a live window.
IsTextureValid / هل_النسيج_صالح
(texture: Texture) -> bool
Total probe; handlers/callbacks allowed; no native device entry.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
UnloadTexture / حرر_النسيج
(texture: Texture) -> result<unit>
Application, main thread; logical close may occur in a frame. Already closed unload succeeds.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
SetTextureFilter / اضبط_مرشح_النسيج
(texture: Texture, filter: TextureFilter) -> result<unit>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
SetTextureWrap / اضبط_التفاف_النسيج
(texture: Texture, wrap: TextureWrap) -> result<unit>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
DrawTexture / ارسم_نسيجا
(texture: Texture, posX: i32, posY: i32, tint: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Signed source rectangles preserve flipping; zero/negative scale and signed destinations retain admitted Raylib behavior. Derived geometry must remain representable.
DrawTextureV / ارسم_نسيجا_بمتجه
(texture: Texture, position: Vector2, tint: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Signed source rectangles preserve flipping; zero/negative scale and signed destinations retain admitted Raylib behavior. Derived geometry must remain representable.
DrawTextureEx / ارسم_نسيجا_موسعا
(texture: Texture, position: Vector2, rotation: f32, scale: f32, tint: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Signed source rectangles preserve flipping; zero/negative scale and signed destinations retain admitted Raylib behavior. Derived geometry must remain representable.
DrawTextureRec / ارسم_جزء_نسيج
(texture: Texture, source: Rectangle, position: Vector2, tint: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Signed source rectangles preserve flipping; zero/negative scale and signed destinations retain admitted Raylib behavior. Derived geometry must remain representable.
DrawTexturePro / ارسم_نسيجا_متقدما
(texture: Texture, source: Rectangle, dest: Rectangle, origin: Vector2, rotation: f32, tint: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Signed source rectangles preserve flipping; zero/negative scale and signed destinations retain admitted Raylib behavior. Derived geometry must remain representable.
GetTextureWidth / عرض_النسيج
(texture: Texture) -> result<i32>
Read-only owner metadata; handlers/callbacks allowed; closed-owner checks apply.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetTextureHeight / ارتفاع_النسيج
(texture: Texture) -> result<i32>
Read-only owner metadata; handlers/callbacks allowed; closed-owner checks apply.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
Camera2D modes and transforms
BeginMode2D / ابدأ_وضع_ثنائي_الأبعاد
(camera: Camera2D) -> result<unit>
Application, main thread; obey the drawing/mode pair rules.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
EndMode2D / أنه_وضع_ثنائي_الأبعاد
() -> result<unit>
Application, main thread; obey the drawing/mode pair rules.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetWorldToScreen2D / من_العالم_إلى_الشاشة
(position: Vector2, camera: Camera2D) -> result<Vector2>
Pure checked math; handlers/callbacks allowed; no device/frame prerequisite.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetScreenToWorld2D / من_الشاشة_إلى_العالم
(position: Vector2, camera: Camera2D) -> result<Vector2>
Pure checked math; handlers/callbacks allowed; no device/frame prerequisite.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
Collision geometry
CheckCollisionRecs / هل_يتداخل_مستطيلان
(rec1: Rectangle, rec2: Rectangle) -> result<bool>
Pure checked math; handlers/callbacks allowed; no device/frame prerequisite.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
CheckCollisionCircles / هل_تتداخل_دائرتان
(center1: Vector2, radius1: f32, center2: Vector2, radius2: f32) -> result<bool>
Pure checked math; handlers/callbacks allowed; no device/frame prerequisite.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
CheckCollisionCircleRec / هل_تتداخل_دائرة_ومستطيل
(center: Vector2, radius: f32, rec: Rectangle) -> result<bool>
Pure checked math; handlers/callbacks allowed; no device/frame prerequisite.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
CheckCollisionPointRec / هل_النقطة_في_مستطيل
(point: Vector2, rec: Rectangle) -> result<bool>
Pure checked math; handlers/callbacks allowed; no device/frame prerequisite.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
CheckCollisionPointCircle / هل_النقطة_في_دائرة
(point: Vector2, center: Vector2, radius: f32) -> result<bool>
Pure checked math; handlers/callbacks allowed; no device/frame prerequisite.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
CheckCollisionPointTriangle / هل_النقطة_في_مثلث
(point: Vector2, p1: Vector2, p2: Vector2, p3: Vector2) -> result<bool>
Pure checked math; handlers/callbacks allowed; no device/frame prerequisite.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetCollisionRec / مستطيل_التداخل
(rec1: Rectangle, rec2: Rectangle) -> result<Rectangle>
Pure checked math; handlers/callbacks allowed; no device/frame prerequisite.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
Font selection and ownership
GetFontDefault / الخط_الافتراضي
() -> result<Font>
CPU text; handlers/callbacks allowed; no window required.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
LoadFont / حمل_خطا
(fileName: string) -> result<Font>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
Single-face TrueType outlines; copied file bytes survive file replacement. Default fallback remains available.
LoadFontEx / حمل_خطا_موسعا
(fileName: string, fontSize: i32, codepoints: list<i32>) -> result<Font>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
Base size 1..4096. list<i32> contains copied scalar prewarming hints; empty means no hints, never restricted coverage.
IsFontValid / هل_الخط_صالح
(font: Font) -> bool
Total probe; handlers/callbacks allowed; no native device entry.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
UnloadFont / حرر_الخط
(font: Font) -> result<unit>
CPU text; handlers/callbacks allowed; no window required.
Alias-safe close. Existing layouts retain independent font backing; unloading the default Font succeeds without closing it.
GetFontBaseSize / حجم_الخط_الأساسي
(font: Font) -> result<i32>
CPU text; handlers/callbacks allowed; no window required.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
Immutable text layouts
CreateTextLayout / أنشئ_تخطيط_نص
(font: Font, text: string, options: TextOptions) -> result<TextLayout>
CPU text; handlers/callbacks allowed; no window required.
Immutable CPU layout; options supply every field. It retains fonts and survives window recreation.
MeasureTextLayout / قس_تخطيط_النص
(layout: TextLayout) -> result<TextMetrics>
CPU text; handlers/callbacks allowed; no window required.
size is the logical box, ink is the local glyph bounds. Measurement and drawing share positions.
IsTextLayoutValid / هل_تخطيط_النص_صالح
(layout: TextLayout) -> bool
Total probe; handlers/callbacks allowed; no native device entry.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
UnloadTextLayout / حرر_تخطيط_النص
(layout: TextLayout) -> result<unit>
CPU text; handlers/callbacks allowed; no window required.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
Shaped text measurement
MeasureText / قس_النص
(text: string, fontSize: i32) -> result<i32>
CPU text; handlers/callbacks allowed; no window required.
Shaped default-font width, rounded upward to checked i32; size 1..4096.
MeasureTextEx / قس_النص_موسعا
(font: Font, text: string, fontSize: f32, spacing: f32) -> result<Vector2>
CPU text; handlers/callbacks allowed; no window required.
Shaped logical size; spacing must be zero and size 0.5..4096.
Shaped text drawing
DrawText / ارسم_نصا
(text: string, posX: i32, posY: i32, fontSize: i32, color: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Shaped Arabic/Latin text in logical order; known preparation failure submits none of this text request. Ex/Pro spacing must be zero.
DrawTextEx / ارسم_نصا_موسعا
(font: Font, text: string, position: Vector2, fontSize: f32, spacing: f32, tint: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Shaped Arabic/Latin text in logical order; known preparation failure submits none of this text request. Ex/Pro spacing must be zero.
DrawTextPro / ارسم_نصا_متقدما
(font: Font, text: string, position: Vector2, origin: Vector2, rotation: f32, fontSize: f32, spacing: f32, tint: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Shaped Arabic/Latin text in logical order; known preparation failure submits none of this text request. Ex/Pro spacing must be zero.
DrawTextLayout / ارسم_تخطيط_النص
(layout: TextLayout, position: Vector2, tint: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Shaped Arabic/Latin text in logical order; known preparation failure submits none of this text request. Ex/Pro spacing must be zero.
DrawTextLayoutPro / ارسم_تخطيط_النص_متقدما
(layout: TextLayout, position: Vector2, origin: Vector2, rotation: f32, tint: Color) -> result<unit>
Application, main thread, inside a drawing frame.
Shaped Arabic/Latin text in logical order; known preparation failure submits none of this text request. Ex/Pro spacing must be zero.
Audio device and sound
InitAudioDevice / هيئ_جهاز_الصوت
() -> result<unit>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
CloseAudioDevice / أغلق_جهاز_الصوت
() -> result<unit>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
Stops and closes dependent Sound/Music aliases before releasing the device.
IsAudioDeviceReady / هل_جهاز_الصوت_جاهز
() -> bool
Total probe; handlers/callbacks allowed; no native device entry.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
SetMasterVolume / اضبط_مستوى_الصوت_العام
(volume: f32) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Volume 0..1.
GetMasterVolume / مستوى_الصوت_العام
() -> result<f32>
Application, main thread, live audio device/owner; permitted inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
LoadSound / حمل_صوتا
(fileName: string) -> result<Sound>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
WAV/OGG/MP3 files; paths resolve from the process working directory. Resource belongs to the current audio generation.
IsSoundValid / هل_الصوت_صالح
(sound: Sound) -> bool
Total probe; handlers/callbacks allowed; no native device entry.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
UnloadSound / حرر_الصوت
(sound: Sound) -> result<unit>
Application, main thread; logical close may occur in a frame. Already closed unload succeeds.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
PlaySound / شغل_الصوت
(sound: Sound) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
StopSound / أوقف_الصوت
(sound: Sound) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
PauseSound / أوقف_الصوت_مؤقتا
(sound: Sound) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
ResumeSound / استأنف_الصوت
(sound: Sound) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
IsSoundPlaying / هل_الصوت_يعمل
(sound: Sound) -> result<bool>
Application, main thread, live audio device/owner; permitted inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
SetSoundVolume / اضبط_مستوى_الصوت
(sound: Sound, volume: f32) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Volume 0..1.
SetSoundPitch / اضبط_حدة_الصوت
(sound: Sound, pitch: f32) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Positive finite pitch and checked derived resampling rate. Refusal before native entry preserves the previous pitch.
SetSoundPan / اضبط_توازن_الصوت
(sound: Sound, pan: f32) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Pan -1..1.
Explicit streamed music
LoadMusicStream / حمل_تدفق_موسيقى
(fileName: string) -> result<Music>
Application, main thread, outside drawing frames; device/owner prerequisites apply.
WAV/OGG/MP3 files; paths resolve from the process working directory. Resource belongs to the current audio generation.
IsMusicValid / هل_الموسيقى_صالحة
(music: Music) -> bool
Total probe; handlers/callbacks allowed; no native device entry.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
UnloadMusicStream / حرر_تدفق_الموسيقى
(music: Music) -> result<unit>
Application, main thread; logical close may occur in a frame. Already closed unload succeeds.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
PlayMusicStream / شغل_تدفق_الموسيقى
(music: Music) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
IsMusicStreamPlaying / هل_تدفق_الموسيقى_يعمل
(music: Music) -> result<bool>
Application, main thread, live audio device/owner; permitted inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
UpdateMusicStream / حدث_تدفق_الموسيقى
(music: Music) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Explicit application update; no automatic streaming loop or source callback.
StopMusicStream / أوقف_تدفق_الموسيقى
(music: Music) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
PauseMusicStream / أوقف_تدفق_الموسيقى_مؤقتا
(music: Music) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
ResumeMusicStream / استأنف_تدفق_الموسيقى
(music: Music) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
SeekMusicStream / اضبط_موضع_تدفق_الموسيقى
(music: Music, position: f32) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Finite seconds 0..reported length inclusive. Endpoint means logical EOF; later update loops playing music or stops nonlooping/empty music. Decoder refusal closes the owner.
SetMusicVolume / اضبط_مستوى_الموسيقى
(music: Music, volume: f32) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Volume 0..1.
SetMusicPitch / اضبط_حدة_الموسيقى
(music: Music, pitch: f32) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Positive finite pitch and checked derived resampling rate. Refusal before native entry preserves the previous pitch.
SetMusicPan / اضبط_توازن_الموسيقى
(music: Music, pan: f32) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
Pan -1..1.
GetMusicTimeLength / مدة_الموسيقى
(music: Music) -> result<f32>
Application, main thread, live audio device/owner; permitted inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetMusicTimePlayed / زمن_الموسيقى_المنقضي
(music: Music) -> result<f32>
Application, main thread, live audio device/owner; permitted inside a frame.
Checked widths, owner generations and results follow the guide. Refusal before native entry preserves state.
GetMusicLooping / هل_الموسيقى_تتكرر
(music: Music) -> result<bool>
Read-only owner metadata; handlers/callbacks allowed; closed-owner checks apply.
Reads retained metadata without entering the audio device.
SetMusicLooping / اضبط_تكرار_الموسيقى
(music: Music, looping: bool) -> result<unit>
Application, main thread, live audio device/owner; permitted inside a frame.
An audio control requiring application admission and a live audio owner.
Numeric and resource limits
Active floating inputs must be finite. Window dimensions and camera zoom are positive. Radius and target FPS are nonnegative; line thickness is positive. Derived coordinates and arithmetic must remain representable even when individual inputs are finite. Signed texture rectangles, zero/negative texture scale and admitted degenerate geometry retain the pinned behavior. Records use f32 coordinates, u8 color channels and the exact scalar widths in each signature.
Title and path strings reject NUL. Audio accepts WAV/OGG/MP3; custom fonts accept the selected single-face TrueType outline profile. LoadTexture accepts PNG only. Paths resolve from the process working directory. The sprite family supplies the exact 32 by 16 RGBA atlas and its Apache-2.0 OR MIT notice. Loads and filter/wrap changes need a closed frame. No system Raylib or source-module helpers are required by these public families.
Default allowances are 256 MiB for VM memory and one shared 128 MiB Raylib/HTTP backend account. Native allocations, copied titles/path backing, texture storage and retained backing count against the relevant allowance. Logical close does not release a charge until native use ends. General VM instruction, time, call-frame and slot limits still apply.
Only one execution holds the process device lease. Texture belongs to its window generation; copies share closure. CloseWindow invalidates aliases before destroying the context, and reopen cannot revive them. UnloadTexture is idempotent, including inside a frame; accepted draws may retain backing until presentation/quiescence. Closed-owner checks precede a missing former device. Read-only metadata, total probes, pure transforms and collision helpers are allowed in handlers/callbacks. Device entry and drawing are application-only on the main thread.
BeginDrawing/EndDrawing and BeginMode2D/EndMode2D must pair without nesting. End camera mode before ending a frame. Lifecycle, loads, title/exit/FPS and filter/wrap changes require a closed frame. Sampled input/timing observations are allowed inside one. Refusal before native entry leaves current state unchanged. Failure after effects guarantees owned cleanup rather than rollback. Return, trap, limits or cancellation abandon an open frame; cleanup releases GPU work before its window. Native release that cannot be proved retains backing and lease. Driver hangs have no hard in-process preemption guarantee.
Text sizes are integer 1..4096 or finite f32 0.5..4096, rounded to 1/64 with ties to even. Ex/Pro character spacing must be zero. TextOptions supplies all six fields; active width is finite and positive and extra line spacing finite and nonnegative. Auto direction uses first-strong/LTR-neutral paragraphs; Start/End follow that direction. Logical metrics and ink bounds share drawing positions. Paragraph/line controls, wrapping and oversized clusters follow the text layout guide. Text diagnostic messages include scalar_index/scalar or native byte_offset details, not new result fields.
Font loads copy licensed file bytes and scalar hints. Font and TextLayout are CPU owners surviving window recreation; layout backing survives custom font closure. Default Font unload succeeds without closing it. Sound/Music belong to an audio generation; unload/device close invalidates aliases. Playback controls and explicit streaming updates may run inside frames. Volume is 0..1, pan -1..1, pitch positive with checked resampling rate. Seek admits the reported endpoint as logical EOF; a decoder refusal closes the Music owner. Total probes and retained GetMusicLooping metadata are allowed in handlers, while playback observations are application-only.
Font/decoder/mixer/glyph/cache allocations and retained backing share the backend account. Audio reserves a checked 1 MiB worker stack and 64 KiB guard until successful join. Text drawing preparation failures submit no part of the failed request. Cleanup releases mixer/decoder work before audio closure. See cleanup and interruption for the single nonrenewing deadline and signal drain.
Errors and refusals
Check ok before value or error; inspect error::code and error::message. Wrong-arm access traps. Stable ASCII codes identify failures; new Raylib messages contain both languages. Source diagnostics use the selected CLI language rather than source vocabulary.
Invalid dimensions or NUL title fail before display acquisition. A safely released candidate may fall back to another configured display endpoint. Invalid arguments and exhausted budgets do not trigger host fallback. If every display candidate safely fails, the final candidate's category describes all attempted backends.
Meaningful examples include InitWindow(0, 240, "x") returning raylib.invalid_argument, SetWindowTitle without a window returning raylib.invalid_order, and a camera with zero zoom returning raylib.invalid_argument. Nested camera begin and EndDrawing with camera mode still active return raylib.invalid_order while preserving the current pair. Texture alias unload closes all aliases; later width access returns raylib.closed_resource. Comparing or constructing nominal enums from integers fails source checking with type-mismatch; device calls inside HTTP handlers fail transitive effect checking.
MeasureText("bad\ttext", 32) returns raylib.invalid_text with scalar_index=3 and scalar=U+0009. Nonzero MeasureTextEx spacing and active layout width zero return raylib.invalid_argument. Missing custom font files return raylib.load_failed; malformed required data returns raylib.invalid_font. UnloadTextLayout closes all aliases and later measurement returns raylib.closed_resource. Audio load without initialization returns raylib.invalid_order; nominal TextDirection/TextAlignment cannot be constructed from integers. See the headless identity program and shaped/audio program.
Terminal statuses retain trap 5, limit 6, cancellation 7 and host failure 8. Earlier primary outcomes retain separate cleanup attribution. Select CLI diagnostics with --diagnostic-language=en and generated-program diagnostics with --aspl-diagnostic-language=en.
This current reference covers all 123 Raylib operations, 18 types, six schemas and 161 constants. Explicit HTTP sessions/state/progress keep their HTTP reference authority; the combined workflow explains frame/effect ordering. The original complete reference (opens in a new tab) retains its published raw path and bytes. Contributor adapter inventories and fixtures do not grant public runnable status.