Raylib API, limits and errors
ASPL 0.7.0 · Current release
All paired 0.7.0 Raylib declarations, contexts, text/audio owners, numeric limits and failures.
On this page
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
| English / العربية | Policy / القاعدة |
|---|---|
Vector2 / متجه2 |
record / سجل |
Rectangle / مستطيل |
record / سجل |
Color / لون |
record / سجل |
Camera2D / كاميرا2 |
record / سجل |
TextOptions / خيارات_النص |
record / سجل |
TextMetrics / مقاييس_النص |
record / سجل |
Texture / نسيج |
shared opaque owner / مالك مشترك معتم |
Font / خط |
shared opaque owner / مالك مشترك معتم |
Sound / صوت |
shared opaque owner / مالك مشترك معتم |
Music / موسيقى |
shared opaque owner / مالك مشترك معتم |
TextLayout / تخطيط_نص |
shared opaque owner / مالك مشترك معتم |
Key / مفتاح |
nominal enum / تعداد اسمي |
MouseButton / زر_فأرة |
nominal enum / تعداد اسمي |
TextureFilter / مرشح_نسيج |
nominal enum / تعداد اسمي |
TextureWrap / التفاف_نسيج |
nominal enum / تعداد اسمي |
TextDirection / اتجاه_نص |
nominal enum / تعداد اسمي |
TextAlignment / محاذاة_نص |
nominal enum / تعداد اسمي |
WindowFlags / أعلام_نافذة |
bounded flags / أعلام محدودة |
Vector2 / متجه2
| English / العربية | Type / النوع |
|---|---|
x / س |
f32 |
y / ص |
f32 |
Rectangle / مستطيل
| English / العربية | Type / النوع |
|---|---|
x / س |
f32 |
y / ص |
f32 |
width / عرض |
f32 |
height / ارتفاع |
f32 |
Color / لون
| English / العربية | Type / النوع |
|---|---|
r / أحمر |
u8 |
g / أخضر |
u8 |
b / أزرق |
u8 |
a / ألفا |
u8 |
Camera2D / كاميرا2
| English / العربية | Type / النوع |
|---|---|
offset / إزاحة |
Vector2 |
target / هدف |
Vector2 |
rotation / دوران |
f32 |
zoom / تكبير |
f32 |
TextOptions / خيارات_النص
| English / العربية | Type / النوع |
|---|---|
font_size / حجم_الخط |
f32 |
direction / اتجاه |
TextDirection |
has_width / له_عرض |
bool |
width / عرض |
f32 |
alignment / محاذاة |
TextAlignment |
line_spacing / تباعد_الأسطر |
f32 |
TextMetrics / مقاييس_النص
| English / العربية | Type / النوع |
|---|---|
size / حجم |
Vector2 |
ink / حبر |
Rectangle |
Constants
| English / العربية | Type / النوع | Value / القيمة |
|---|---|---|
KEY_NULL / مفتاح_لا_شيء |
Key |
0 |
KEY_APOSTROPHE / مفتاح_اقتباس_مفرد |
Key |
39 |
KEY_COMMA / مفتاح_فاصلة |
Key |
44 |
KEY_MINUS / مفتاح_ناقص |
Key |
45 |
KEY_PERIOD / مفتاح_نقطة |
Key |
46 |
KEY_SLASH / مفتاح_شرطة_مائلة |
Key |
47 |
KEY_ZERO / مفتاح_0 |
Key |
48 |
KEY_ONE / مفتاح_1 |
Key |
49 |
KEY_TWO / مفتاح_2 |
Key |
50 |
KEY_THREE / مفتاح_3 |
Key |
51 |
KEY_FOUR / مفتاح_4 |
Key |
52 |
KEY_FIVE / مفتاح_5 |
Key |
53 |
KEY_SIX / مفتاح_6 |
Key |
54 |
KEY_SEVEN / مفتاح_7 |
Key |
55 |
KEY_EIGHT / مفتاح_8 |
Key |
56 |
KEY_NINE / مفتاح_9 |
Key |
57 |
KEY_SEMICOLON / مفتاح_فاصلة_منقوطة |
Key |
59 |
KEY_EQUAL / مفتاح_يساوي |
Key |
61 |
KEY_A / مفتاح_A |
Key |
65 |
KEY_B / مفتاح_B |
Key |
66 |
KEY_C / مفتاح_C |
Key |
67 |
KEY_D / مفتاح_D |
Key |
68 |
KEY_E / مفتاح_E |
Key |
69 |
KEY_F / مفتاح_F |
Key |
70 |
KEY_G / مفتاح_G |
Key |
71 |
KEY_H / مفتاح_H |
Key |
72 |
KEY_I / مفتاح_I |
Key |
73 |
KEY_J / مفتاح_J |
Key |
74 |
KEY_K / مفتاح_K |
Key |
75 |
KEY_L / مفتاح_L |
Key |
76 |
KEY_M / مفتاح_M |
Key |
77 |
KEY_N / مفتاح_N |
Key |
78 |
KEY_O / مفتاح_O |
Key |
79 |
KEY_P / مفتاح_P |
Key |
80 |
KEY_Q / مفتاح_Q |
Key |
81 |
KEY_R / مفتاح_R |
Key |
82 |
KEY_S / مفتاح_S |
Key |
83 |
KEY_T / مفتاح_T |
Key |
84 |
KEY_U / مفتاح_U |
Key |
85 |
KEY_V / مفتاح_V |
Key |
86 |
KEY_W / مفتاح_W |
Key |
87 |
KEY_X / مفتاح_X |
Key |
88 |
KEY_Y / مفتاح_Y |
Key |
89 |
KEY_Z / مفتاح_Z |
Key |
90 |
KEY_LEFT_BRACKET / مفتاح_قوس_مربع_أيسر |
Key |
91 |
KEY_BACKSLASH / مفتاح_شرطة_مائلة_عكسية |
Key |
92 |
KEY_RIGHT_BRACKET / مفتاح_قوس_مربع_أيمن |
Key |
93 |
KEY_GRAVE / مفتاح_اقتباس_خلفي |
Key |
96 |
KEY_SPACE / مفتاح_مسافة |
Key |
32 |
KEY_ESCAPE / مفتاح_هروب |
Key |
256 |
KEY_ENTER / مفتاح_إدخال |
Key |
257 |
KEY_TAB / مفتاح_جدولة |
Key |
258 |
KEY_BACKSPACE / مفتاح_مسح_خلفي |
Key |
259 |
KEY_INSERT / مفتاح_إدراج |
Key |
260 |
KEY_DELETE / مفتاح_حذف |
Key |
261 |
KEY_RIGHT / مفتاح_يمين |
Key |
262 |
KEY_LEFT / مفتاح_يسار |
Key |
263 |
KEY_DOWN / مفتاح_أسفل |
Key |
264 |
KEY_UP / مفتاح_أعلى |
Key |
265 |
KEY_PAGE_UP / مفتاح_صفحة_لأعلى |
Key |
266 |
KEY_PAGE_DOWN / مفتاح_صفحة_لأسفل |
Key |
267 |
KEY_HOME / مفتاح_بداية |
Key |
268 |
KEY_END / مفتاح_نهاية |
Key |
269 |
KEY_CAPS_LOCK / مفتاح_قفل_الأحرف |
Key |
280 |
KEY_SCROLL_LOCK / مفتاح_قفل_التمرير |
Key |
281 |
KEY_NUM_LOCK / مفتاح_قفل_الأرقام |
Key |
282 |
KEY_PRINT_SCREEN / مفتاح_طباعة_الشاشة |
Key |
283 |
KEY_PAUSE / مفتاح_إيقاف_مؤقت |
Key |
284 |
KEY_F1 / مفتاح_F1 |
Key |
290 |
KEY_F2 / مفتاح_F2 |
Key |
291 |
KEY_F3 / مفتاح_F3 |
Key |
292 |
KEY_F4 / مفتاح_F4 |
Key |
293 |
KEY_F5 / مفتاح_F5 |
Key |
294 |
KEY_F6 / مفتاح_F6 |
Key |
295 |
KEY_F7 / مفتاح_F7 |
Key |
296 |
KEY_F8 / مفتاح_F8 |
Key |
297 |
KEY_F9 / مفتاح_F9 |
Key |
298 |
KEY_F10 / مفتاح_F10 |
Key |
299 |
KEY_F11 / مفتاح_F11 |
Key |
300 |
KEY_F12 / مفتاح_F12 |
Key |
301 |
KEY_LEFT_SHIFT / مفتاح_تبديل_أيسر |
Key |
340 |
KEY_LEFT_CONTROL / مفتاح_تحكم_أيسر |
Key |
341 |
KEY_LEFT_ALT / مفتاح_بديل_أيسر |
Key |
342 |
KEY_LEFT_SUPER / مفتاح_نظام_أيسر |
Key |
343 |
KEY_RIGHT_SHIFT / مفتاح_تبديل_أيمن |
Key |
344 |
KEY_RIGHT_CONTROL / مفتاح_تحكم_أيمن |
Key |
345 |
KEY_RIGHT_ALT / مفتاح_بديل_أيمن |
Key |
346 |
KEY_RIGHT_SUPER / مفتاح_نظام_أيمن |
Key |
347 |
KEY_KB_MENU / مفتاح_قائمة_لوحة_المفاتيح |
Key |
348 |
KEY_KP_0 / مفتاح_لوحة_أرقام_0 |
Key |
320 |
KEY_KP_1 / مفتاح_لوحة_أرقام_1 |
Key |
321 |
KEY_KP_2 / مفتاح_لوحة_أرقام_2 |
Key |
322 |
KEY_KP_3 / مفتاح_لوحة_أرقام_3 |
Key |
323 |
KEY_KP_4 / مفتاح_لوحة_أرقام_4 |
Key |
324 |
KEY_KP_5 / مفتاح_لوحة_أرقام_5 |
Key |
325 |
KEY_KP_6 / مفتاح_لوحة_أرقام_6 |
Key |
326 |
KEY_KP_7 / مفتاح_لوحة_أرقام_7 |
Key |
327 |
KEY_KP_8 / مفتاح_لوحة_أرقام_8 |
Key |
328 |
KEY_KP_9 / مفتاح_لوحة_أرقام_9 |
Key |
329 |
KEY_KP_DECIMAL / مفتاح_لوحة_أرقام_عشرية |
Key |
330 |
KEY_KP_DIVIDE / مفتاح_لوحة_أرقام_قسمة |
Key |
331 |
KEY_KP_MULTIPLY / مفتاح_لوحة_أرقام_ضرب |
Key |
332 |
KEY_KP_SUBTRACT / مفتاح_لوحة_أرقام_طرح |
Key |
333 |
KEY_KP_ADD / مفتاح_لوحة_أرقام_جمع |
Key |
334 |
KEY_KP_ENTER / مفتاح_لوحة_أرقام_إدخال |
Key |
335 |
KEY_KP_EQUAL / مفتاح_لوحة_أرقام_يساوي |
Key |
336 |
KEY_BACK / مفتاح_رجوع |
Key |
4 |
KEY_MENU / مفتاح_قائمة |
Key |
5 |
KEY_VOLUME_UP / مفتاح_رفع_الصوت |
Key |
24 |
KEY_VOLUME_DOWN / مفتاح_خفض_الصوت |
Key |
25 |
MOUSE_BUTTON_LEFT / زر_فأرة_أيسر |
MouseButton |
0 |
MOUSE_BUTTON_RIGHT / زر_فأرة_أيمن |
MouseButton |
1 |
MOUSE_BUTTON_MIDDLE / زر_فأرة_أوسط |
MouseButton |
2 |
MOUSE_BUTTON_SIDE / زر_فأرة_جانبي |
MouseButton |
3 |
MOUSE_BUTTON_EXTRA / زر_فأرة_إضافي |
MouseButton |
4 |
MOUSE_BUTTON_FORWARD / زر_فأرة_تقدم |
MouseButton |
5 |
MOUSE_BUTTON_BACK / زر_فأرة_رجوع |
MouseButton |
6 |
TEXTURE_FILTER_POINT / مرشح_نسيج_نقطي |
TextureFilter |
0 |
TEXTURE_FILTER_BILINEAR / مرشح_نسيج_ثنائي_الخطية |
TextureFilter |
1 |
TEXTURE_WRAP_REPEAT / التفاف_نسيج_تكرار |
TextureWrap |
0 |
TEXTURE_WRAP_CLAMP / التفاف_نسيج_تثبيت |
TextureWrap |
1 |
FLAG_VSYNC_HINT / علم_تلميح_تزامن_رأسي |
WindowFlags |
64 |
FLAG_FULLSCREEN_MODE / علم_ملء_الشاشة |
WindowFlags |
2 |
FLAG_WINDOW_RESIZABLE / علم_نافذة_قابلة_للتحجيم |
WindowFlags |
4 |
FLAG_WINDOW_HIGHDPI / علم_نافذة_عالية_الكثافة |
WindowFlags |
8192 |
FLAG_MSAA_4X_HINT / علم_تلميح_تنعيم_4X |
WindowFlags |
32 |
WINDOW_FLAGS_NONE / أعلام_نافذة_فارغة |
WindowFlags |
0 |
LIGHTGRAY / رمادي_فاتح |
Color |
[200, 200, 200, 255] |
GRAY / رمادي |
Color |
[130, 130, 130, 255] |
DARKGRAY / رمادي_داكن |
Color |
[80, 80, 80, 255] |
YELLOW / أصفر |
Color |
[253, 249, 0, 255] |
GOLD / ذهبي |
Color |
[255, 203, 0, 255] |
ORANGE / برتقالي |
Color |
[255, 161, 0, 255] |
PINK / وردي |
Color |
[255, 109, 194, 255] |
RED / أحمر |
Color |
[230, 41, 55, 255] |
MAROON / عنابي |
Color |
[190, 33, 55, 255] |
GREEN / أخضر |
Color |
[0, 228, 48, 255] |
LIME / أخضر_ليموني |
Color |
[0, 158, 47, 255] |
DARKGREEN / أخضر_داكن |
Color |
[0, 117, 44, 255] |
SKYBLUE / أزرق_سماوي |
Color |
[102, 191, 255, 255] |
BLUE / أزرق |
Color |
[0, 121, 241, 255] |
DARKBLUE / أزرق_داكن |
Color |
[0, 82, 172, 255] |
PURPLE / أرجواني |
Color |
[200, 122, 255, 255] |
VIOLET / بنفسجي |
Color |
[135, 60, 190, 255] |
DARKPURPLE / أرجواني_داكن |
Color |
[112, 31, 126, 255] |
BEIGE / بيج |
Color |
[211, 176, 131, 255] |
BROWN / بني |
Color |
[127, 106, 79, 255] |
DARKBROWN / بني_داكن |
Color |
[76, 63, 47, 255] |
WHITE / أبيض |
Color |
[255, 255, 255, 255] |
BLACK / أسود |
Color |
[0, 0, 0, 255] |
BLANK / شفاف |
Color |
[0, 0, 0, 0] |
MAGENTA / فوشي |
Color |
[255, 0, 255, 255] |
RAYWHITE / أبيض_رايليب |
Color |
[245, 245, 245, 255] |
TEXT_DIRECTION_AUTO / اتجاه_نص_تلقائي |
TextDirection |
Auto |
TEXT_DIRECTION_LTR / اتجاه_نص_من_اليسار_إلى_اليمين |
TextDirection |
LTR |
TEXT_DIRECTION_RTL / اتجاه_نص_من_اليمين_إلى_اليسار |
TextDirection |
RTL |
TEXT_ALIGNMENT_START / محاذاة_نص_بداية |
TextAlignment |
Start |
TEXT_ALIGNMENT_END / محاذاة_نص_نهاية |
TextAlignment |
End |
TEXT_ALIGNMENT_CENTER / محاذاة_نص_وسط |
TextAlignment |
Center |
TEXT_ALIGNMENT_LEFT / محاذاة_نص_يسار |
TextAlignment |
Left |
TEXT_ALIGNMENT_RIGHT / محاذاة_نص_يمين |
TextAlignment |
Right |
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.
Keyboard, mouse and resize input
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.
IsMouseButtonPressed / هل_ضغط_زر_الفأرة
(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.
IsMouseButtonDown / هل_زر_الفأرة_مضغوط
(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.
IsMouseButtonReleased / هل_حرر_زر_الفأرة
(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.
IsMouseButtonUp / هل_زر_الفأرة_غير_مضغوط
(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.
| Code | Meaning in ASPL 0.7.0 |
|---|---|
raylib.invalid_argument |
Invalid range, enum/flag choice, NUL title/path, negative radius or nonpositive zoom/thickness. |
raylib.numeric_overflow |
Unrepresentable conversion or derived geometry, even with finite operands. |
raylib.invalid_order |
Missing window, duplicate init, draw outside a frame, nested/mismatched drawing or camera pair, or forbidden open-frame change. |
raylib.invalid_context |
Wrong execution, thread or effect context. |
raylib.owner_busy |
Another execution holds the device lease. |
raylib.closed_resource |
Access through a logically closed shared resource owner. |
raylib.load_failed |
File read, selected image/audio decode or music seek failed. Decoder seek refusal closes that Music owner. |
raylib.unsupported_asset |
Unselected image/audio format. |
raylib.invalid_font |
Malformed required font directory/tables. |
raylib.unsupported_font |
Font collection, CFF/PostScript, WOFF/WOFF2, bitmap or color profile. |
raylib.invalid_text |
Malformed input or unsupported control such as NUL/tab/DEL. |
raylib.missing_glyph |
No admitted custom/default font covers the cluster or joining sequence. |
raylib.resource_limit |
Shared backend allowance or bounded native capacity exhausted. |
raylib.host_unavailable |
Missing library, unreachable audio facility or display; absent DISPLAY and WAYLAND_DISPLAY has no headless success. |
raylib.host_incompatible |
Missing required symbol, incompatible protocol or graphics context. |
raylib.initialization_failed |
Admitted window/context/audio initialization or playback start failed and safely released. |
raylib.host_failure |
Another native/upload failure. Unprovable native release may instead terminate execution. |
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.