@dayme/bunraylib 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/Raylib.ts ADDED
@@ -0,0 +1,3679 @@
1
+ import { getSymbols } from "./symbols";
2
+ export { configure } from "./symbols";
3
+ export type { RaylibConfig } from "./symbols";
4
+
5
+ const r = () => getSymbols();
6
+ import type {
7
+ Vec2,
8
+ Vec3,
9
+ Rectangle,
10
+ Camera2D,
11
+ Camera3D,
12
+ Ray,
13
+ Texture2D,
14
+ RenderTexture2D,
15
+ Model,
16
+ BoundingBox,
17
+ Font,
18
+ Image,
19
+ Shader,
20
+ Wave,
21
+ Sound,
22
+ Music,
23
+ AudioStream,
24
+ Material,
25
+ Mesh,
26
+ ModelAnimation,
27
+ RayCollision,
28
+ GlyphInfo,
29
+ } from "./types";
30
+ import { cstr, f2i, i2f } from "./utils";
31
+ import { CString } from "bun:ffi";
32
+ import type { Color } from "./types";
33
+
34
+ const _vec2Buf = new Float32Array(2);
35
+ const _recBuf = new Float32Array(4);
36
+ const _colPtBuf = new Float32Array(2);
37
+
38
+ export class Raylib {
39
+ private static _rcHit = new Uint8Array(1);
40
+ private static _rcDist = new Float32Array(1);
41
+ private static _rcPt = new Float32Array(3);
42
+ private static _rcNorm = new Float32Array(3);
43
+ private static initialized = false;
44
+ private static _texOutId = new Uint32Array(1);
45
+ private static _texOutTexId = new Uint32Array(1);
46
+ private static _texOutW = new Int32Array(1);
47
+ private static _texOutH = new Int32Array(1);
48
+ private static _shapesTexId = new Uint32Array(1);
49
+ private static _shapesTexW = new Int32Array(1);
50
+ private static _shapesTexH = new Int32Array(1);
51
+ private static _rayPosBuf2 = new Float32Array(3);
52
+ private static _rayDirBuf2 = new Float32Array(3);
53
+ private static _animSlotStart = new Int32Array(1);
54
+ private static _animCount = new Int32Array(1);
55
+
56
+ /** Initialize window and OpenGL context */
57
+ static initWindow(width: number, height: number, title: string): void {
58
+ r().symbols.InitWindowW(width, height, cstr(title));
59
+ Raylib.initialized = true;
60
+ }
61
+
62
+ /** Close window and unload OpenGL context */
63
+ static closeWindow(): void {
64
+ r().symbols.CloseWindowW();
65
+ Raylib.initialized = false;
66
+ }
67
+
68
+ /** Check if application should close (KEY_ESCAPE pressed or window close button) */
69
+ static windowShouldClose(): boolean {
70
+ return r().symbols.WindowShouldCloseW();
71
+ }
72
+
73
+ /** Setup canvas (framebuffer) to start drawing */
74
+ static beginDrawing(): void {
75
+ r().symbols.BeginDrawingW();
76
+ }
77
+
78
+ /** End canvas drawing and swap buffers (double buffering) */
79
+ static endDrawing(): void {
80
+ r().symbols.EndDrawingW();
81
+ }
82
+
83
+ /** Begin 2D mode with custom camera */
84
+ static beginMode2D(camera: Camera2D): void {
85
+ r().symbols.BeginMode2DW(
86
+ camera.offset.x,
87
+ camera.offset.y,
88
+ camera.target.x,
89
+ camera.target.y,
90
+ f2i(camera.rotation),
91
+ f2i(camera.zoom),
92
+ );
93
+ }
94
+
95
+ /** Ends 2D mode with custom camera */
96
+ static endMode2D(): void {
97
+ r().symbols.EndMode2DW();
98
+ }
99
+
100
+ /** Begin 3D mode with custom camera */
101
+ static beginMode3D(camera: Camera3D): void {
102
+ r().symbols.BeginMode3DW(
103
+ f2i(camera.position.x),
104
+ f2i(camera.position.y),
105
+ f2i(camera.position.z),
106
+ f2i(camera.target.x),
107
+ f2i(camera.target.y),
108
+ f2i(camera.target.z),
109
+ f2i(camera.up.x),
110
+ f2i(camera.up.y),
111
+ f2i(camera.up.z),
112
+ f2i(camera.fovy),
113
+ camera.projection,
114
+ );
115
+ }
116
+
117
+ /** Ends 3D mode with custom camera */
118
+ static endMode3D(): void {
119
+ r().symbols.EndMode3DW();
120
+ }
121
+
122
+ /** Set background color (used before drawing) */
123
+ static clearBackground(col: Color): void {
124
+ r().symbols.ClearBackgroundW(col);
125
+ }
126
+
127
+ /** Set target FPS (frames per second) */
128
+ static setTargetFPS(fps: number): void {
129
+ r().symbols.SetTargetFPSW(fps);
130
+ }
131
+
132
+ /** Get time in seconds for last frame drawn (delta time) */
133
+ static getFrameTime(): number {
134
+ return r().symbols.GetFrameTimeW();
135
+ }
136
+
137
+ /** Draw a color-filled rectangle */
138
+ static drawRectangle(x: number, y: number, width: number, height: number, col: Color): void {
139
+ r().symbols.DrawRectangleW(x, y, width, height, col);
140
+ }
141
+
142
+ /** Draw text (using default font) */
143
+ static drawText(text: string, x: number, y: number, fontSize: number, col: Color): void {
144
+ r().symbols.DrawTextW(cstr(text), x, y, fontSize, col);
145
+ }
146
+
147
+ /** Draw a pixel */
148
+ static drawPixel(x: number, y: number, col: Color): void {
149
+ r().symbols.DrawPixelW(x, y, col);
150
+ }
151
+
152
+ /** Draw a pixel (using vector position) */
153
+ static drawPixelV(position: Vec2, col: Color): void {
154
+ r().symbols.DrawPixelVW(position.x, position.y, col);
155
+ }
156
+
157
+ /** Draw a line */
158
+ static drawLine(startX: number, startY: number, endX: number, endY: number, col: Color): void {
159
+ r().symbols.DrawLineW(startX, startY, endX, endY, col);
160
+ }
161
+
162
+ /** Draw a line (using vector positions) */
163
+ static drawLineV(startPos: Vec2, endPos: Vec2, col: Color): void {
164
+ r().symbols.DrawLineVW(startPos.x, startPos.y, endPos.x, endPos.y, col);
165
+ }
166
+
167
+ /** Draw a line with defined thickness */
168
+ static drawLineEx(startPos: Vec2, endPos: Vec2, thick: number, col: Color): void {
169
+ r().symbols.DrawLineExW(startPos.x, startPos.y, endPos.x, endPos.y, thick, col);
170
+ }
171
+
172
+ /** Draw lines sequence as a strip. Points are packed as [x0,y0, x1,y1, ...] in Float32Array */
173
+ static drawLineStrip(points: Float32Array, col: Color): void {
174
+ r().symbols.DrawLineStripW(points, points.length / 2, col);
175
+ }
176
+
177
+ /** Draw line segment with Bezier easing */
178
+ static drawLineBezier(startPos: Vec2, endPos: Vec2, thick: number, col: Color): void {
179
+ r().symbols.DrawLineBezierW(startPos.x, startPos.y, endPos.x, endPos.y, thick, col);
180
+ }
181
+
182
+ /** Draw a color-filled circle */
183
+ static drawCircle(centerX: number, centerY: number, radius: number, col: Color): void {
184
+ r().symbols.DrawCircleW(centerX, centerY, radius, col);
185
+ }
186
+
187
+ /** Draw a color-filled circle (using vector center) */
188
+ static drawCircleV(center: Vec2, radius: number, col: Color): void {
189
+ r().symbols.DrawCircleVW(center.x, center.y, f2i(radius), col);
190
+ }
191
+
192
+ /**
193
+ * Draw a circle sector (pie slice).
194
+ * @param center - Center position
195
+ * @param radius - Circle radius
196
+ * @param startAngle - Start angle in degrees
197
+ * @param endAngle - End angle in degrees
198
+ * @param segments - Number of segments (higher = smoother)
199
+ * @param col - Fill color
200
+ */
201
+ static drawCircleSector(
202
+ center: Vec2,
203
+ radius: number,
204
+ startAngle: number,
205
+ endAngle: number,
206
+ segments: number,
207
+ col: Color,
208
+ ): void {
209
+ r().symbols.DrawCircleSectorW(
210
+ center.x,
211
+ center.y,
212
+ radius,
213
+ f2i(startAngle),
214
+ f2i(endAngle),
215
+ segments,
216
+ col,
217
+ );
218
+ }
219
+
220
+ /**
221
+ * Draw a circle sector outline.
222
+ * @param center - Center position
223
+ * @param radius - Circle radius
224
+ * @param startAngle - Start angle in degrees
225
+ * @param endAngle - End angle in degrees
226
+ * @param segments - Number of segments (higher = smoother)
227
+ * @param col - Outline color
228
+ */
229
+ static drawCircleSectorLines(
230
+ center: Vec2,
231
+ radius: number,
232
+ startAngle: number,
233
+ endAngle: number,
234
+ segments: number,
235
+ col: Color,
236
+ ): void {
237
+ r().symbols.DrawCircleSectorLinesW(
238
+ center.x,
239
+ center.y,
240
+ radius,
241
+ f2i(startAngle),
242
+ f2i(endAngle),
243
+ segments,
244
+ col,
245
+ );
246
+ }
247
+
248
+ /** Draw a gradient-filled circle */
249
+ static drawCircleGradient(
250
+ centerX: number,
251
+ centerY: number,
252
+ radius: number,
253
+ inner: Color,
254
+ outer: Color,
255
+ ): void {
256
+ r().symbols.DrawCircleGradientW(centerX, centerY, f2i(radius), inner, outer);
257
+ }
258
+
259
+ /** Draw circle outline */
260
+ static drawCircleLines(centerX: number, centerY: number, radius: number, col: Color): void {
261
+ r().symbols.DrawCircleLinesW(centerX, centerY, radius, col);
262
+ }
263
+
264
+ /** Draw circle outline (using vector center) */
265
+ static drawCircleLinesV(center: Vec2, radius: number, col: Color): void {
266
+ r().symbols.DrawCircleLinesVW(center.x, center.y, f2i(radius), col);
267
+ }
268
+
269
+ /** Draw a color-filled ellipse */
270
+ static drawEllipse(
271
+ centerX: number,
272
+ centerY: number,
273
+ radiusH: number,
274
+ radiusV: number,
275
+ col: Color,
276
+ ): void {
277
+ r().symbols.DrawEllipseW(centerX, centerY, radiusH, radiusV, col);
278
+ }
279
+
280
+ /** Draw ellipse outline */
281
+ static drawEllipseLines(
282
+ centerX: number,
283
+ centerY: number,
284
+ radiusH: number,
285
+ radiusV: number,
286
+ col: Color,
287
+ ): void {
288
+ r().symbols.DrawEllipseLinesW(centerX, centerY, radiusH, radiusV, col);
289
+ }
290
+
291
+ /**
292
+ * Draw a ring (donut shape).
293
+ * @param center - Center position
294
+ * @param innerRadius - Inner circle radius
295
+ * @param outerRadius - Outer circle radius
296
+ * @param startAngle - Start angle in degrees
297
+ * @param endAngle - End angle in degrees
298
+ * @param segments - Number of segments (higher = smoother)
299
+ * @param col - Fill color
300
+ */
301
+ static drawRing(
302
+ center: Vec2,
303
+ innerRadius: number,
304
+ outerRadius: number,
305
+ startAngle: number,
306
+ endAngle: number,
307
+ segments: number,
308
+ col: Color,
309
+ ): void {
310
+ r().symbols.DrawRingW(
311
+ center.x,
312
+ center.y,
313
+ innerRadius,
314
+ outerRadius,
315
+ f2i(startAngle),
316
+ f2i(endAngle),
317
+ segments,
318
+ col,
319
+ );
320
+ }
321
+
322
+ /**
323
+ * Draw a ring outline.
324
+ * @param center - Center position
325
+ * @param innerRadius - Inner circle radius
326
+ * @param outerRadius - Outer circle radius
327
+ * @param startAngle - Start angle in degrees
328
+ * @param endAngle - End angle in degrees
329
+ * @param segments - Number of segments (higher = smoother)
330
+ * @param col - Outline color
331
+ */
332
+ static drawRingLines(
333
+ center: Vec2,
334
+ innerRadius: number,
335
+ outerRadius: number,
336
+ startAngle: number,
337
+ endAngle: number,
338
+ segments: number,
339
+ col: Color,
340
+ ): void {
341
+ r().symbols.DrawRingLinesW(
342
+ center.x,
343
+ center.y,
344
+ innerRadius,
345
+ outerRadius,
346
+ f2i(startAngle),
347
+ f2i(endAngle),
348
+ segments,
349
+ col,
350
+ );
351
+ }
352
+
353
+ /** Draw a color-filled rectangle (using vector position and size) */
354
+ static drawRectangleV(pos: Vec2, size: Vec2, col: Color): void {
355
+ r().symbols.DrawRectangleVW(pos.x, pos.y, size.x, size.y, col);
356
+ }
357
+
358
+ static drawRectangleRec(rec: Rectangle, col: Color): void {
359
+ r().symbols.DrawRectangleRecW(rec.x, rec.y, rec.width, rec.height, col);
360
+ }
361
+
362
+ /** Draw a color-filled rectangle with pro parameters (rotation and origin) */
363
+ static drawRectanglePro(rec: Rectangle, origin: Vec2, rotation: number, col: Color): void {
364
+ r().symbols.DrawRectangleProW(
365
+ rec.x,
366
+ rec.y,
367
+ rec.width,
368
+ rec.height,
369
+ origin.x,
370
+ origin.y,
371
+ rotation,
372
+ col,
373
+ );
374
+ }
375
+
376
+ /** Draw a vertical-gradient-filled rectangle */
377
+ static drawRectangleGradientV(
378
+ x: number,
379
+ y: number,
380
+ width: number,
381
+ height: number,
382
+ top: Color,
383
+ bottom: Color,
384
+ ): void {
385
+ r().symbols.DrawRectangleGradientVW(x, y, width, height, top, bottom);
386
+ }
387
+
388
+ /** Draw a horizontal-gradient-filled rectangle */
389
+ static drawRectangleGradientH(
390
+ x: number,
391
+ y: number,
392
+ width: number,
393
+ height: number,
394
+ left: Color,
395
+ right: Color,
396
+ ): void {
397
+ r().symbols.DrawRectangleGradientHW(x, y, width, height, left, right);
398
+ }
399
+
400
+ /** Draw a gradient-filled rectangle with custom gradient colors for each corner */
401
+ static drawRectangleGradientEx(
402
+ rec: Rectangle,
403
+ topLeft: Color,
404
+ bottomLeft: Color,
405
+ topRight: Color,
406
+ bottomRight: Color,
407
+ ): void {
408
+ r().symbols.DrawRectangleGradientExW(
409
+ rec.x,
410
+ rec.y,
411
+ rec.width,
412
+ rec.height,
413
+ topLeft,
414
+ bottomLeft,
415
+ topRight,
416
+ bottomRight,
417
+ );
418
+ }
419
+
420
+ /** Draw rectangle outline */
421
+ static drawRectangleLines(x: number, y: number, width: number, height: number, col: Color): void {
422
+ r().symbols.DrawRectangleLinesW(x, y, width, height, col);
423
+ }
424
+
425
+ /** Draw rectangle outline with extended parameters (custom line thickness) */
426
+ static drawRectangleLinesEx(rec: Rectangle, lineThick: number, col: Color): void {
427
+ r().symbols.DrawRectangleLinesExW(rec.x, rec.y, rec.width, rec.height, lineThick, col);
428
+ }
429
+
430
+ /** Draw rectangle with rounded edges */
431
+ static drawRectangleRounded(
432
+ rec: Rectangle,
433
+ roundness: number,
434
+ segments: number,
435
+ col: Color,
436
+ ): void {
437
+ r().symbols.DrawRectangleRoundedW(
438
+ rec.x,
439
+ rec.y,
440
+ rec.width,
441
+ rec.height,
442
+ roundness,
443
+ segments,
444
+ col,
445
+ );
446
+ }
447
+
448
+ /** Draw rectangle with rounded edges outline */
449
+ static drawRectangleRoundedLines(
450
+ rec: Rectangle,
451
+ roundness: number,
452
+ segments: number,
453
+ col: Color,
454
+ ): void {
455
+ r().symbols.DrawRectangleRoundedLinesW(
456
+ rec.x,
457
+ rec.y,
458
+ rec.width,
459
+ rec.height,
460
+ roundness,
461
+ segments,
462
+ col,
463
+ );
464
+ }
465
+
466
+ /** Draw rectangle with rounded edges outline (custom line thickness) */
467
+ static drawRectangleRoundedLinesEx(
468
+ rec: Rectangle,
469
+ roundness: number,
470
+ segments: number,
471
+ lineThick: number,
472
+ col: Color,
473
+ ): void {
474
+ r().symbols.DrawRectangleRoundedLinesExW(
475
+ rec.x,
476
+ rec.y,
477
+ rec.width,
478
+ rec.height,
479
+ roundness,
480
+ segments,
481
+ lineThick,
482
+ col,
483
+ );
484
+ }
485
+
486
+ /** Draw a color-filled triangle */
487
+ static drawTriangle(v1: Vec2, v2: Vec2, v3: Vec2, col: Color): void {
488
+ r().symbols.DrawTriangleW(v1.x, v1.y, v2.x, v2.y, v3.x, v3.y, col);
489
+ }
490
+
491
+ /** Draw triangle outline */
492
+ static drawTriangleLines(v1: Vec2, v2: Vec2, v3: Vec2, col: Color): void {
493
+ r().symbols.DrawTriangleLinesW(v1.x, v1.y, v2.x, v2.y, v3.x, v3.y, col);
494
+ }
495
+
496
+ /** Draw a triangle fan. Points are packed as [x0,y0, x1,y1, ...] in Float32Array */
497
+ static drawTriangleFan(points: Float32Array, col: Color): void {
498
+ r().symbols.DrawTriangleFanW(points, points.length / 2, col);
499
+ }
500
+
501
+ /** Draw a triangle strip. Points are packed as [x0,y0, x1,y1, ...] in Float32Array */
502
+ static drawTriangleStrip(points: Float32Array, col: Color): void {
503
+ r().symbols.DrawTriangleStripW(points, points.length / 2, col);
504
+ }
505
+
506
+ /** Draw a regular polygon (color-filled) */
507
+ static drawPoly(center: Vec2, sides: number, radius: number, rotation: number, col: Color): void {
508
+ r().symbols.DrawPolyW(center.x, center.y, sides, radius, rotation, col);
509
+ }
510
+
511
+ /** Draw a regular polygon outline */
512
+ static drawPolyLines(
513
+ center: Vec2,
514
+ sides: number,
515
+ radius: number,
516
+ rotation: number,
517
+ col: Color,
518
+ ): void {
519
+ r().symbols.DrawPolyLinesW(center.x, center.y, sides, radius, rotation, col);
520
+ }
521
+
522
+ /** Draw a regular polygon outline with custom line thickness */
523
+ static drawPolyLinesEx(
524
+ center: Vec2,
525
+ sides: number,
526
+ radius: number,
527
+ rotation: number,
528
+ lineThick: number,
529
+ col: Color,
530
+ ): void {
531
+ r().symbols.DrawPolyLinesExW(center.x, center.y, sides, radius, rotation, lineThick, col);
532
+ }
533
+
534
+ /**
535
+ * Draw spline: Linear. Minimum 2 points.
536
+ * Points are packed as [x0,y0, x1,y1, ...] in Float32Array.
537
+ */
538
+ static drawSplineLinear(points: Float32Array, thick: number, col: Color): void {
539
+ r().symbols.DrawSplineLinearW(points, points.length / 2, f2i(thick), col);
540
+ }
541
+
542
+ /**
543
+ * Draw spline: B-Spline. Minimum 4 points.
544
+ * Points are packed as [x0,y0, x1,y1, ...] in Float32Array.
545
+ */
546
+ static drawSplineBasis(points: Float32Array, thick: number, col: Color): void {
547
+ r().symbols.DrawSplineBasisW(points, points.length / 2, f2i(thick), col);
548
+ }
549
+
550
+ /**
551
+ * Draw spline: Catmull-Rom. Minimum 4 points.
552
+ * Points are packed as [x0,y0, x1,y1, ...] in Float32Array.
553
+ */
554
+ static drawSplineCatmullRom(points: Float32Array, thick: number, col: Color): void {
555
+ r().symbols.DrawSplineCatmullRomW(points, points.length / 2, f2i(thick), col);
556
+ }
557
+
558
+ /**
559
+ * Draw spline: Quadratic Bezier. Minimum 3 points (1 control point).
560
+ * Points layout: [p1, c2, p3, c4, ...] packed as [x0,y0, x1,y1, ...] in Float32Array.
561
+ */
562
+ static drawSplineBezierQuadratic(points: Float32Array, thick: number, col: Color): void {
563
+ r().symbols.DrawSplineBezierQuadraticW(points, points.length / 2, f2i(thick), col);
564
+ }
565
+
566
+ /**
567
+ * Draw spline: Cubic Bezier. Minimum 4 points (2 control points).
568
+ * Points layout: [p1, c2, c3, p4, c5, c6, ...] packed as [x0,y0, x1,y1, ...] in Float32Array.
569
+ */
570
+ static drawSplineBezierCubic(points: Float32Array, thick: number, col: Color): void {
571
+ r().symbols.DrawSplineBezierCubicW(points, points.length / 2, f2i(thick), col);
572
+ }
573
+
574
+ /** Draw spline segment: Linear, 2 points */
575
+ static drawSplineSegmentLinear(p1: Vec2, p2: Vec2, thick: number, col: Color): void {
576
+ r().symbols.DrawSplineSegmentLinearW(p1.x, p1.y, p2.x, p2.y, f2i(thick), col);
577
+ }
578
+
579
+ /** Draw spline segment: B-Spline, 4 points */
580
+ static drawSplineSegmentBasis(
581
+ p1: Vec2,
582
+ p2: Vec2,
583
+ p3: Vec2,
584
+ p4: Vec2,
585
+ thick: number,
586
+ col: Color,
587
+ ): void {
588
+ r().symbols.DrawSplineSegmentBasisW(
589
+ p1.x,
590
+ p1.y,
591
+ p2.x,
592
+ p2.y,
593
+ p3.x,
594
+ p3.y,
595
+ p4.x,
596
+ p4.y,
597
+ f2i(thick),
598
+ col,
599
+ );
600
+ }
601
+
602
+ /** Draw spline segment: Catmull-Rom, 4 points */
603
+ static drawSplineSegmentCatmullRom(
604
+ p1: Vec2,
605
+ p2: Vec2,
606
+ p3: Vec2,
607
+ p4: Vec2,
608
+ thick: number,
609
+ col: Color,
610
+ ): void {
611
+ r().symbols.DrawSplineSegmentCatmullRomW(
612
+ p1.x,
613
+ p1.y,
614
+ p2.x,
615
+ p2.y,
616
+ p3.x,
617
+ p3.y,
618
+ p4.x,
619
+ p4.y,
620
+ f2i(thick),
621
+ col,
622
+ );
623
+ }
624
+
625
+ /** Draw spline segment: Quadratic Bezier, 2 points + 1 control point */
626
+ static drawSplineSegmentBezierQuadratic(
627
+ p1: Vec2,
628
+ c2: Vec2,
629
+ p3: Vec2,
630
+ thick: number,
631
+ col: Color,
632
+ ): void {
633
+ r().symbols.DrawSplineSegmentBezierQuadraticW(
634
+ p1.x,
635
+ p1.y,
636
+ c2.x,
637
+ c2.y,
638
+ p3.x,
639
+ p3.y,
640
+ f2i(thick),
641
+ col,
642
+ );
643
+ }
644
+
645
+ /** Draw spline segment: Cubic Bezier, 2 points + 2 control points */
646
+ static drawSplineSegmentBezierCubic(
647
+ p1: Vec2,
648
+ c2: Vec2,
649
+ c3: Vec2,
650
+ p4: Vec2,
651
+ thick: number,
652
+ col: Color,
653
+ ): void {
654
+ r().symbols.DrawSplineSegmentBezierCubicW(
655
+ p1.x,
656
+ p1.y,
657
+ c2.x,
658
+ c2.y,
659
+ c3.x,
660
+ c3.y,
661
+ p4.x,
662
+ p4.y,
663
+ f2i(thick),
664
+ col,
665
+ );
666
+ }
667
+
668
+ /**
669
+ * Get (evaluate) spline point: Linear.
670
+ * @param startPos - Start position
671
+ * @param endPos - End position
672
+ * @param t - Interpolation factor [0.0 .. 1.0]
673
+ * @returns Evaluated point as Vec2
674
+ */
675
+ static getSplinePointLinear(startPos: Vec2, endPos: Vec2, t: number): Vec2 {
676
+ r().symbols.GetSplinePointLinearW(_vec2Buf, startPos.x, startPos.y, endPos.x, endPos.y, f2i(t));
677
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
678
+ }
679
+
680
+ /**
681
+ * Get (evaluate) spline point: B-Spline.
682
+ * @param p1 - Point 1
683
+ * @param p2 - Point 2
684
+ * @param p3 - Point 3
685
+ * @param p4 - Point 4
686
+ * @param t - Interpolation factor [0.0 .. 1.0]
687
+ * @returns Evaluated point as Vec2
688
+ */
689
+ static getSplinePointBasis(p1: Vec2, p2: Vec2, p3: Vec2, p4: Vec2, t: number): Vec2 {
690
+ r().symbols.GetSplinePointBasisW(
691
+ _vec2Buf,
692
+ p1.x,
693
+ p1.y,
694
+ p2.x,
695
+ p2.y,
696
+ p3.x,
697
+ p3.y,
698
+ p4.x,
699
+ p4.y,
700
+ f2i(t),
701
+ );
702
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
703
+ }
704
+
705
+ /**
706
+ * Get (evaluate) spline point: Catmull-Rom.
707
+ * @param p1 - Point 1
708
+ * @param p2 - Point 2
709
+ * @param p3 - Point 3
710
+ * @param p4 - Point 4
711
+ * @param t - Interpolation factor [0.0 .. 1.0]
712
+ * @returns Evaluated point as Vec2
713
+ */
714
+ static getSplinePointCatmullRom(p1: Vec2, p2: Vec2, p3: Vec2, p4: Vec2, t: number): Vec2 {
715
+ r().symbols.GetSplinePointCatmullRomW(
716
+ _vec2Buf,
717
+ p1.x,
718
+ p1.y,
719
+ p2.x,
720
+ p2.y,
721
+ p3.x,
722
+ p3.y,
723
+ p4.x,
724
+ p4.y,
725
+ f2i(t),
726
+ );
727
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
728
+ }
729
+
730
+ /**
731
+ * Get (evaluate) spline point: Quadratic Bezier.
732
+ * @param p1 - Start point
733
+ * @param c2 - Control point
734
+ * @param p3 - End point
735
+ * @param t - Interpolation factor [0.0 .. 1.0]
736
+ * @returns Evaluated point as Vec2
737
+ */
738
+ static getSplinePointBezierQuad(p1: Vec2, c2: Vec2, p3: Vec2, t: number): Vec2 {
739
+ r().symbols.GetSplinePointBezierQuadW(_vec2Buf, p1.x, p1.y, c2.x, c2.y, p3.x, p3.y, f2i(t));
740
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
741
+ }
742
+
743
+ /**
744
+ * Get (evaluate) spline point: Cubic Bezier.
745
+ * @param p1 - Start point
746
+ * @param c2 - Control point 1
747
+ * @param c3 - Control point 2
748
+ * @param p4 - End point
749
+ * @param t - Interpolation factor [0.0 .. 1.0]
750
+ * @returns Evaluated point as Vec2
751
+ */
752
+ static getSplinePointBezierCubic(p1: Vec2, c2: Vec2, c3: Vec2, p4: Vec2, t: number): Vec2 {
753
+ r().symbols.GetSplinePointBezierCubicW(
754
+ _vec2Buf,
755
+ p1.x,
756
+ p1.y,
757
+ c2.x,
758
+ c2.y,
759
+ c3.x,
760
+ c3.y,
761
+ p4.x,
762
+ p4.y,
763
+ f2i(t),
764
+ );
765
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
766
+ }
767
+
768
+ /** Check collision between two rectangles */
769
+ static checkCollisionRecs(rec1: Rectangle, rec2: Rectangle): boolean {
770
+ return r().symbols.CheckCollisionRecsW(
771
+ rec1.x,
772
+ rec1.y,
773
+ rec1.width,
774
+ rec1.height,
775
+ rec2.x,
776
+ rec2.y,
777
+ rec2.width,
778
+ rec2.height,
779
+ );
780
+ }
781
+
782
+ /** Check collision between two circles */
783
+ static checkCollisionCircles(
784
+ center1: Vec2,
785
+ radius1: number,
786
+ center2: Vec2,
787
+ radius2: number,
788
+ ): boolean {
789
+ return r().symbols.CheckCollisionCirclesW(
790
+ center1.x,
791
+ center1.y,
792
+ radius1,
793
+ center2.x,
794
+ center2.y,
795
+ radius2,
796
+ );
797
+ }
798
+
799
+ /** Check collision between circle and rectangle */
800
+ static checkCollisionCircleRec(center: Vec2, radius: number, rec: Rectangle): boolean {
801
+ return r().symbols.CheckCollisionCircleRecW(
802
+ center.x,
803
+ center.y,
804
+ radius,
805
+ rec.x,
806
+ rec.y,
807
+ rec.width,
808
+ rec.height,
809
+ );
810
+ }
811
+
812
+ /** Check if circle collides with a line created between two points [p1] and [p2] */
813
+ static checkCollisionCircleLine(center: Vec2, radius: number, p1: Vec2, p2: Vec2): boolean {
814
+ return r().symbols.CheckCollisionCircleLineW(
815
+ center.x,
816
+ center.y,
817
+ radius,
818
+ p1.x,
819
+ p1.y,
820
+ p2.x,
821
+ p2.y,
822
+ );
823
+ }
824
+
825
+ /** Check if point is inside rectangle */
826
+ static checkCollisionPointRec(point: Vec2, rec: Rectangle): boolean {
827
+ return r().symbols.CheckCollisionPointRecW(
828
+ point.x,
829
+ point.y,
830
+ rec.x,
831
+ rec.y,
832
+ rec.width,
833
+ rec.height,
834
+ );
835
+ }
836
+
837
+ /** Check if point is inside circle */
838
+ static checkCollisionPointCircle(point: Vec2, center: Vec2, radius: number): boolean {
839
+ return r().symbols.CheckCollisionPointCircleW(point.x, point.y, center.x, center.y, radius);
840
+ }
841
+
842
+ /** Check if point is inside a triangle */
843
+ static checkCollisionPointTriangle(point: Vec2, p1: Vec2, p2: Vec2, p3: Vec2): boolean {
844
+ return r().symbols.CheckCollisionPointTriangleW(
845
+ point.x,
846
+ point.y,
847
+ p1.x,
848
+ p1.y,
849
+ p2.x,
850
+ p2.y,
851
+ p3.x,
852
+ p3.y,
853
+ );
854
+ }
855
+
856
+ /** Check if point belongs to line created between two points [p1] and [p2] with defined margin [threshold] */
857
+ static checkCollisionPointLine(point: Vec2, p1: Vec2, p2: Vec2, threshold: number): boolean {
858
+ return r().symbols.CheckCollisionPointLineW(
859
+ point.x,
860
+ point.y,
861
+ p1.x,
862
+ p1.y,
863
+ p2.x,
864
+ p2.y,
865
+ threshold,
866
+ );
867
+ }
868
+
869
+ /**
870
+ * Check if point is within a polygon described by array of vertices.
871
+ * Points are packed as [x0,y0, x1,y1, ...] in Float32Array.
872
+ */
873
+ static checkCollisionPointPoly(point: Vec2, points: Float32Array): boolean {
874
+ return r().symbols.CheckCollisionPointPolyW(point.x, point.y, points, points.length / 2);
875
+ }
876
+
877
+ /**
878
+ * Check collision between two lines defined by two points each.
879
+ * @returns Object with `collides` boolean and `collisionPoint` Vec2 (valid only if collides is true)
880
+ */
881
+ static checkCollisionLines(
882
+ startPos1: Vec2,
883
+ endPos1: Vec2,
884
+ startPos2: Vec2,
885
+ endPos2: Vec2,
886
+ ): { collides: boolean; collisionPoint: Vec2 } {
887
+ const collides = r().symbols.CheckCollisionLinesW(
888
+ _colPtBuf,
889
+ startPos1.x,
890
+ startPos1.y,
891
+ endPos1.x,
892
+ endPos1.y,
893
+ startPos2.x,
894
+ startPos2.y,
895
+ endPos2.x,
896
+ endPos2.y,
897
+ );
898
+ return { collides, collisionPoint: { x: _colPtBuf[0]!, y: _colPtBuf[1]! } };
899
+ }
900
+
901
+ /** Get collision rectangle for two rectangles collision. Returns null if no overlap */
902
+ static getCollisionRec(rec1: Rectangle, rec2: Rectangle): Rectangle {
903
+ r().symbols.GetCollisionRecW(
904
+ _recBuf,
905
+ rec1.x,
906
+ rec1.y,
907
+ rec1.width,
908
+ rec1.height,
909
+ rec2.x,
910
+ rec2.y,
911
+ rec2.width,
912
+ rec2.height,
913
+ );
914
+ return {
915
+ x: _recBuf[0]!,
916
+ y: _recBuf[1]!,
917
+ width: _recBuf[2]!,
918
+ height: _recBuf[3]!,
919
+ };
920
+ }
921
+
922
+ /** Draw a line in 3D world space */
923
+ static drawLine3D(startPos: Vec3, endPos: Vec3, col: Color): void {
924
+ r().symbols.DrawLine3DW(
925
+ f2i(startPos.x),
926
+ f2i(startPos.y),
927
+ f2i(startPos.z),
928
+ f2i(endPos.x),
929
+ f2i(endPos.y),
930
+ f2i(endPos.z),
931
+ col,
932
+ );
933
+ }
934
+
935
+ /** Draw a point in 3D space */
936
+ static drawPoint3D(position: Vec3, col: Color): void {
937
+ r().symbols.DrawPoint3DW(f2i(position.x), f2i(position.y), f2i(position.z), col);
938
+ }
939
+
940
+ /** Draw a circle in 3D world space */
941
+ static drawCircle3D(
942
+ center: Vec3,
943
+ radius: number,
944
+ rotationAxis: Vec3,
945
+ rotationAngle: number,
946
+ col: Color,
947
+ ): void {
948
+ r().symbols.DrawCircle3DW(
949
+ f2i(center.x),
950
+ f2i(center.y),
951
+ f2i(center.z),
952
+ f2i(radius),
953
+ f2i(rotationAxis.x),
954
+ f2i(rotationAxis.y),
955
+ f2i(rotationAxis.z),
956
+ f2i(rotationAngle),
957
+ col,
958
+ );
959
+ }
960
+
961
+ /** Draw a color-filled triangle (vertex in counter-clockwise order!) */
962
+ static drawTriangle3D(v1: Vec3, v2: Vec3, v3: Vec3, col: Color): void {
963
+ r().symbols.DrawTriangle3DW(
964
+ f2i(v1.x),
965
+ f2i(v1.y),
966
+ f2i(v1.z),
967
+ f2i(v2.x),
968
+ f2i(v2.y),
969
+ f2i(v2.z),
970
+ f2i(v3.x),
971
+ f2i(v3.y),
972
+ f2i(v3.z),
973
+ col,
974
+ );
975
+ }
976
+
977
+ /** Draw a triangle strip defined by points. Points packed as [x0,y0,z0, x1,y1,z1, ...] in Float32Array */
978
+ static drawTriangleStrip3D(points: Float32Array, col: Color): void {
979
+ r().symbols.DrawTriangleStrip3DW(points, points.length / 3, col);
980
+ }
981
+
982
+ /** Draw cube */
983
+ static drawCube(position: Vec3, width: number, height: number, length: number, col: Color): void {
984
+ r().symbols.DrawCubeW(
985
+ f2i(position.x),
986
+ f2i(position.y),
987
+ f2i(position.z),
988
+ f2i(width),
989
+ f2i(height),
990
+ f2i(length),
991
+ col,
992
+ );
993
+ }
994
+
995
+ /** Draw cube (Vector version) */
996
+ static drawCubeV(position: Vec3, size: Vec3, col: Color): void {
997
+ r().symbols.DrawCubeVW(
998
+ f2i(position.x),
999
+ f2i(position.y),
1000
+ f2i(position.z),
1001
+ f2i(size.x),
1002
+ f2i(size.y),
1003
+ f2i(size.z),
1004
+ col,
1005
+ );
1006
+ }
1007
+
1008
+ /** Draw cube wires */
1009
+ static drawCubeWires(
1010
+ position: Vec3,
1011
+ width: number,
1012
+ height: number,
1013
+ length: number,
1014
+ col: Color,
1015
+ ): void {
1016
+ r().symbols.DrawCubeWiresW(
1017
+ f2i(position.x),
1018
+ f2i(position.y),
1019
+ f2i(position.z),
1020
+ f2i(width),
1021
+ f2i(height),
1022
+ f2i(length),
1023
+ col,
1024
+ );
1025
+ }
1026
+
1027
+ /** Draw cube wires (Vector version) */
1028
+ static drawCubeWiresV(position: Vec3, size: Vec3, col: Color): void {
1029
+ r().symbols.DrawCubeWiresVW(
1030
+ f2i(position.x),
1031
+ f2i(position.y),
1032
+ f2i(position.z),
1033
+ f2i(size.x),
1034
+ f2i(size.y),
1035
+ f2i(size.z),
1036
+ col,
1037
+ );
1038
+ }
1039
+
1040
+ /** Draw sphere */
1041
+ static drawSphere(centerPos: Vec3, radius: number, col: Color): void {
1042
+ r().symbols.DrawSphereW(f2i(centerPos.x), f2i(centerPos.y), f2i(centerPos.z), f2i(radius), col);
1043
+ }
1044
+
1045
+ /** Draw sphere with extended parameters */
1046
+ static drawSphereEx(
1047
+ centerPos: Vec3,
1048
+ radius: number,
1049
+ rings: number,
1050
+ slices: number,
1051
+ col: Color,
1052
+ ): void {
1053
+ r().symbols.DrawSphereExW(
1054
+ f2i(centerPos.x),
1055
+ f2i(centerPos.y),
1056
+ f2i(centerPos.z),
1057
+ f2i(radius),
1058
+ rings,
1059
+ slices,
1060
+ col,
1061
+ );
1062
+ }
1063
+
1064
+ /** Draw sphere wires */
1065
+ static drawSphereWires(
1066
+ centerPos: Vec3,
1067
+ radius: number,
1068
+ rings: number,
1069
+ slices: number,
1070
+ col: Color,
1071
+ ): void {
1072
+ r().symbols.DrawSphereWiresW(
1073
+ f2i(centerPos.x),
1074
+ f2i(centerPos.y),
1075
+ f2i(centerPos.z),
1076
+ f2i(radius),
1077
+ rings,
1078
+ slices,
1079
+ col,
1080
+ );
1081
+ }
1082
+
1083
+ /** Draw a cylinder/cone */
1084
+ static drawCylinder(
1085
+ position: Vec3,
1086
+ radiusTop: number,
1087
+ radiusBottom: number,
1088
+ height: number,
1089
+ slices: number,
1090
+ col: Color,
1091
+ ): void {
1092
+ r().symbols.DrawCylinderW(
1093
+ f2i(position.x),
1094
+ f2i(position.y),
1095
+ f2i(position.z),
1096
+ f2i(radiusTop),
1097
+ f2i(radiusBottom),
1098
+ f2i(height),
1099
+ slices,
1100
+ col,
1101
+ );
1102
+ }
1103
+
1104
+ /** Draw a cylinder with base at startPos and top at endPos */
1105
+ static drawCylinderEx(
1106
+ startPos: Vec3,
1107
+ endPos: Vec3,
1108
+ startRadius: number,
1109
+ endRadius: number,
1110
+ sides: number,
1111
+ col: Color,
1112
+ ): void {
1113
+ r().symbols.DrawCylinderExW(
1114
+ f2i(startPos.x),
1115
+ f2i(startPos.y),
1116
+ f2i(startPos.z),
1117
+ f2i(endPos.x),
1118
+ f2i(endPos.y),
1119
+ f2i(endPos.z),
1120
+ f2i(startRadius),
1121
+ f2i(endRadius),
1122
+ sides,
1123
+ col,
1124
+ );
1125
+ }
1126
+
1127
+ /** Draw a cylinder/cone wires */
1128
+ static drawCylinderWires(
1129
+ position: Vec3,
1130
+ radiusTop: number,
1131
+ radiusBottom: number,
1132
+ height: number,
1133
+ slices: number,
1134
+ col: Color,
1135
+ ): void {
1136
+ r().symbols.DrawCylinderWiresW(
1137
+ f2i(position.x),
1138
+ f2i(position.y),
1139
+ f2i(position.z),
1140
+ f2i(radiusTop),
1141
+ f2i(radiusBottom),
1142
+ f2i(height),
1143
+ slices,
1144
+ col,
1145
+ );
1146
+ }
1147
+
1148
+ /** Draw a cylinder wires with base at startPos and top at endPos */
1149
+ static drawCylinderWiresEx(
1150
+ startPos: Vec3,
1151
+ endPos: Vec3,
1152
+ startRadius: number,
1153
+ endRadius: number,
1154
+ sides: number,
1155
+ col: Color,
1156
+ ): void {
1157
+ r().symbols.DrawCylinderWiresExW(
1158
+ f2i(startPos.x),
1159
+ f2i(startPos.y),
1160
+ f2i(startPos.z),
1161
+ f2i(endPos.x),
1162
+ f2i(endPos.y),
1163
+ f2i(endPos.z),
1164
+ f2i(startRadius),
1165
+ f2i(endRadius),
1166
+ sides,
1167
+ col,
1168
+ );
1169
+ }
1170
+
1171
+ /** Draw a capsule with the center of its sphere caps at startPos and endPos */
1172
+ static drawCapsule(
1173
+ startPos: Vec3,
1174
+ endPos: Vec3,
1175
+ radius: number,
1176
+ slices: number,
1177
+ rings: number,
1178
+ col: Color,
1179
+ ): void {
1180
+ r().symbols.DrawCapsuleW(
1181
+ f2i(startPos.x),
1182
+ f2i(startPos.y),
1183
+ f2i(startPos.z),
1184
+ f2i(endPos.x),
1185
+ f2i(endPos.y),
1186
+ f2i(endPos.z),
1187
+ f2i(radius),
1188
+ slices,
1189
+ rings,
1190
+ col,
1191
+ );
1192
+ }
1193
+
1194
+ /** Draw capsule wireframe */
1195
+ static drawCapsuleWires(
1196
+ startPos: Vec3,
1197
+ endPos: Vec3,
1198
+ radius: number,
1199
+ slices: number,
1200
+ rings: number,
1201
+ col: Color,
1202
+ ): void {
1203
+ r().symbols.DrawCapsuleWiresW(
1204
+ f2i(startPos.x),
1205
+ f2i(startPos.y),
1206
+ f2i(startPos.z),
1207
+ f2i(endPos.x),
1208
+ f2i(endPos.y),
1209
+ f2i(endPos.z),
1210
+ f2i(radius),
1211
+ slices,
1212
+ rings,
1213
+ col,
1214
+ );
1215
+ }
1216
+
1217
+ /** Draw a plane XZ */
1218
+ static drawPlane(centerPos: Vec3, size: Vec2, col: Color): void {
1219
+ r().symbols.DrawPlaneW(
1220
+ f2i(centerPos.x),
1221
+ f2i(centerPos.y),
1222
+ f2i(centerPos.z),
1223
+ f2i(size.x),
1224
+ f2i(size.y),
1225
+ col,
1226
+ );
1227
+ }
1228
+
1229
+ /** Draw a ray line */
1230
+ static drawRay(ray: Ray, col: Color): void {
1231
+ r().symbols.DrawRayW(
1232
+ f2i(ray.position.x),
1233
+ f2i(ray.position.y),
1234
+ f2i(ray.position.z),
1235
+ f2i(ray.direction.x),
1236
+ f2i(ray.direction.y),
1237
+ f2i(ray.direction.z),
1238
+ col,
1239
+ );
1240
+ }
1241
+
1242
+ /** Draw a grid */
1243
+ static drawGrid(slices: number, spacing: number): void {
1244
+ r().symbols.DrawGridW(slices, spacing);
1245
+ }
1246
+
1247
+ // --- Window state ---
1248
+
1249
+ static isWindowReady(): boolean {
1250
+ return r().symbols.IsWindowReadyW();
1251
+ }
1252
+ static isWindowFullscreen(): boolean {
1253
+ return r().symbols.IsWindowFullscreenW();
1254
+ }
1255
+ static isWindowHidden(): boolean {
1256
+ return r().symbols.IsWindowHiddenW();
1257
+ }
1258
+ static isWindowMinimized(): boolean {
1259
+ return r().symbols.IsWindowMinimizedW();
1260
+ }
1261
+ static isWindowMaximized(): boolean {
1262
+ return r().symbols.IsWindowMaximizedW();
1263
+ }
1264
+ static isWindowFocused(): boolean {
1265
+ return r().symbols.IsWindowFocusedW();
1266
+ }
1267
+ static isWindowResized(): boolean {
1268
+ return r().symbols.IsWindowResizedW();
1269
+ }
1270
+ static isWindowState(flag: number): boolean {
1271
+ return r().symbols.IsWindowStateW(flag);
1272
+ }
1273
+ static setWindowState(flags: number): void {
1274
+ r().symbols.SetWindowStateW(flags);
1275
+ }
1276
+ static clearWindowState(flags: number): void {
1277
+ r().symbols.ClearWindowStateW(flags);
1278
+ }
1279
+ static toggleFullscreen(): void {
1280
+ r().symbols.ToggleFullscreenW();
1281
+ }
1282
+ static toggleBorderlessWindowed(): void {
1283
+ r().symbols.ToggleBorderlessWindowedW();
1284
+ }
1285
+ static maximizeWindow(): void {
1286
+ r().symbols.MaximizeWindowW();
1287
+ }
1288
+ static minimizeWindow(): void {
1289
+ r().symbols.MinimizeWindowW();
1290
+ }
1291
+ static restoreWindow(): void {
1292
+ r().symbols.RestoreWindowW();
1293
+ }
1294
+ static setWindowTitle(title: string): void {
1295
+ r().symbols.SetWindowTitleW(cstr(title));
1296
+ }
1297
+ static setWindowPosition(x: number, y: number): void {
1298
+ r().symbols.SetWindowPositionW(x, y);
1299
+ }
1300
+ static setWindowMonitor(monitor: number): void {
1301
+ r().symbols.SetWindowMonitorW(monitor);
1302
+ }
1303
+ static setWindowMinSize(w: number, h: number): void {
1304
+ r().symbols.SetWindowMinSizeW(w, h);
1305
+ }
1306
+ static setWindowMaxSize(w: number, h: number): void {
1307
+ r().symbols.SetWindowMaxSizeW(w, h);
1308
+ }
1309
+ static setWindowSize(w: number, h: number): void {
1310
+ r().symbols.SetWindowSizeW(w, h);
1311
+ }
1312
+ static setWindowOpacity(opacity: number): void {
1313
+ r().symbols.SetWindowOpacityW(opacity);
1314
+ }
1315
+ static setWindowFocused(): void {
1316
+ r().symbols.SetWindowFocusedW();
1317
+ }
1318
+ static getScreenWidth(): number {
1319
+ return r().symbols.GetScreenWidthW();
1320
+ }
1321
+ static getScreenHeight(): number {
1322
+ return r().symbols.GetScreenHeightW();
1323
+ }
1324
+ static getRenderWidth(): number {
1325
+ return r().symbols.GetRenderWidthW();
1326
+ }
1327
+ static getRenderHeight(): number {
1328
+ return r().symbols.GetRenderHeightW();
1329
+ }
1330
+ static getMonitorCount(): number {
1331
+ return r().symbols.GetMonitorCountW();
1332
+ }
1333
+ static getCurrentMonitor(): number {
1334
+ return r().symbols.GetCurrentMonitorW();
1335
+ }
1336
+
1337
+ static getMonitorPosition(monitor: number): Vec2 {
1338
+ r().symbols.GetMonitorPositionW(_vec2Buf, monitor);
1339
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
1340
+ }
1341
+
1342
+ static getMonitorWidth(monitor: number): number {
1343
+ return r().symbols.GetMonitorWidthW(monitor);
1344
+ }
1345
+ static getMonitorHeight(monitor: number): number {
1346
+ return r().symbols.GetMonitorHeightW(monitor);
1347
+ }
1348
+ static getMonitorPhysicalWidth(monitor: number): number {
1349
+ return r().symbols.GetMonitorPhysicalWidthW(monitor);
1350
+ }
1351
+ static getMonitorPhysicalHeight(monitor: number): number {
1352
+ return r().symbols.GetMonitorPhysicalHeightW(monitor);
1353
+ }
1354
+ static getMonitorRefreshRate(monitor: number): number {
1355
+ return r().symbols.GetMonitorRefreshRateW(monitor);
1356
+ }
1357
+
1358
+ static getWindowPosition(): Vec2 {
1359
+ r().symbols.GetWindowPositionW(_vec2Buf);
1360
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
1361
+ }
1362
+
1363
+ static getWindowScaleDPI(): Vec2 {
1364
+ r().symbols.GetWindowScaleDPIW(_vec2Buf);
1365
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
1366
+ }
1367
+
1368
+ static getMonitorName(monitor: number): string {
1369
+ const ptr = r().symbols.GetMonitorNameW(monitor);
1370
+ if (!ptr) return "";
1371
+ return new CString(ptr).toString();
1372
+ }
1373
+
1374
+ static setClipboardText(text: string): void {
1375
+ r().symbols.SetClipboardTextW(cstr(text));
1376
+ }
1377
+
1378
+ static getClipboardText(): string {
1379
+ const ptr = r().symbols.GetClipboardTextW();
1380
+ if (!ptr) return "";
1381
+ return new CString(ptr).toString();
1382
+ }
1383
+
1384
+ static enableEventWaiting(): void {
1385
+ r().symbols.EnableEventWaitingW();
1386
+ }
1387
+ static disableEventWaiting(): void {
1388
+ r().symbols.DisableEventWaitingW();
1389
+ }
1390
+
1391
+ // --- Cursor ---
1392
+
1393
+ static showCursor(): void {
1394
+ r().symbols.ShowCursorW();
1395
+ }
1396
+ static hideCursor(): void {
1397
+ r().symbols.HideCursorW();
1398
+ }
1399
+ static isCursorHidden(): boolean {
1400
+ return r().symbols.IsCursorHiddenW();
1401
+ }
1402
+ static enableCursor(): void {
1403
+ r().symbols.EnableCursorW();
1404
+ }
1405
+ static disableCursor(): void {
1406
+ r().symbols.DisableCursorW();
1407
+ }
1408
+ static isCursorOnScreen(): boolean {
1409
+ return r().symbols.IsCursorOnScreenW();
1410
+ }
1411
+
1412
+ // --- Drawing modes ---
1413
+
1414
+ static beginTextureMode(target: RenderTexture2D): void {
1415
+ r().symbols.BeginTextureModeW(target.id, target.texture.width, target.texture.height);
1416
+ }
1417
+ static endTextureMode(): void {
1418
+ r().symbols.EndTextureModeW();
1419
+ }
1420
+ static beginBlendMode(mode: number): void {
1421
+ r().symbols.BeginBlendModeW(mode);
1422
+ }
1423
+ static endBlendMode(): void {
1424
+ r().symbols.EndBlendModeW();
1425
+ }
1426
+ static beginScissorMode(x: number, y: number, w: number, h: number): void {
1427
+ r().symbols.BeginScissorModeW(x, y, w, h);
1428
+ }
1429
+ static endScissorMode(): void {
1430
+ r().symbols.EndScissorModeW();
1431
+ }
1432
+
1433
+ // --- Timing ---
1434
+
1435
+ static getTime(): number {
1436
+ return r().symbols.GetTimeW();
1437
+ }
1438
+ static getFPS(): number {
1439
+ return r().symbols.GetFPSW();
1440
+ }
1441
+ static swapScreenBuffer(): void {
1442
+ r().symbols.SwapScreenBufferW();
1443
+ }
1444
+ static pollInputEvents(): void {
1445
+ r().symbols.PollInputEventsW();
1446
+ }
1447
+ static waitTime(seconds: number): void {
1448
+ r().symbols.WaitTimeW(seconds);
1449
+ }
1450
+
1451
+ // --- Random ---
1452
+
1453
+ static setRandomSeed(seed: number): void {
1454
+ r().symbols.SetRandomSeedW(seed);
1455
+ }
1456
+ static getRandomValue(min: number, max: number): number {
1457
+ return r().symbols.GetRandomValueW(min, max);
1458
+ }
1459
+
1460
+ // --- Misc ---
1461
+
1462
+ static takeScreenshot(fileName: string): void {
1463
+ r().symbols.TakeScreenshotW(cstr(fileName));
1464
+ }
1465
+ static setConfigFlags(flags: number): void {
1466
+ r().symbols.SetConfigFlagsW(flags);
1467
+ }
1468
+ static openURL(url: string): void {
1469
+ r().symbols.OpenURLW(cstr(url));
1470
+ }
1471
+
1472
+ // --- Input: Keyboard ---
1473
+
1474
+ static isKeyPressed(key: number): boolean {
1475
+ return r().symbols.IsKeyPressedW(key);
1476
+ }
1477
+ static isKeyPressedRepeat(key: number): boolean {
1478
+ return r().symbols.IsKeyPressedRepeatW(key);
1479
+ }
1480
+ static isKeyDown(key: number): boolean {
1481
+ return r().symbols.IsKeyDownW(key);
1482
+ }
1483
+ static isKeyReleased(key: number): boolean {
1484
+ return r().symbols.IsKeyReleasedW(key);
1485
+ }
1486
+ static isKeyUp(key: number): boolean {
1487
+ return r().symbols.IsKeyUpW(key);
1488
+ }
1489
+ static getKeyPressed(): number {
1490
+ return r().symbols.GetKeyPressedW();
1491
+ }
1492
+ static getCharPressed(): number {
1493
+ return r().symbols.GetCharPressedW();
1494
+ }
1495
+ static setExitKey(key: number): void {
1496
+ r().symbols.SetExitKeyW(key);
1497
+ }
1498
+
1499
+ // --- Input: Gamepad ---
1500
+
1501
+ static isGamepadAvailable(gamepad: number): boolean {
1502
+ return r().symbols.IsGamepadAvailableW(gamepad);
1503
+ }
1504
+ static getGamepadName(gamepad: number): string {
1505
+ const cstr = r().symbols.GetGamepadNameW(gamepad);
1506
+ if (!cstr) return "";
1507
+ return cstr.toString();
1508
+ }
1509
+ static isGamepadButtonPressed(gamepad: number, button: number): boolean {
1510
+ return r().symbols.IsGamepadButtonPressedW(gamepad, button);
1511
+ }
1512
+ static isGamepadButtonDown(gamepad: number, button: number): boolean {
1513
+ return r().symbols.IsGamepadButtonDownW(gamepad, button);
1514
+ }
1515
+ static isGamepadButtonReleased(gamepad: number, button: number): boolean {
1516
+ return r().symbols.IsGamepadButtonReleasedW(gamepad, button);
1517
+ }
1518
+ static isGamepadButtonUp(gamepad: number, button: number): boolean {
1519
+ return r().symbols.IsGamepadButtonUpW(gamepad, button);
1520
+ }
1521
+ static getGamepadButtonPressed(): number {
1522
+ return r().symbols.GetGamepadButtonPressedW();
1523
+ }
1524
+ static getGamepadAxisCount(gamepad: number): number {
1525
+ return r().symbols.GetGamepadAxisCountW(gamepad);
1526
+ }
1527
+ static getGamepadAxisMovement(gamepad: number, axis: number): number {
1528
+ return r().symbols.GetGamepadAxisMovementW(gamepad, axis);
1529
+ }
1530
+ static setGamepadMappings(mappings: string): number {
1531
+ return r().symbols.SetGamepadMappingsW(cstr(mappings));
1532
+ }
1533
+
1534
+ // --- Input: Mouse ---
1535
+
1536
+ static isMouseButtonPressed(button: number): boolean {
1537
+ return r().symbols.IsMouseButtonPressedW(button);
1538
+ }
1539
+ static isMouseButtonDown(button: number): boolean {
1540
+ return r().symbols.IsMouseButtonDownW(button);
1541
+ }
1542
+ static isMouseButtonReleased(button: number): boolean {
1543
+ return r().symbols.IsMouseButtonReleasedW(button);
1544
+ }
1545
+ static isMouseButtonUp(button: number): boolean {
1546
+ return r().symbols.IsMouseButtonUpW(button);
1547
+ }
1548
+ static getMouseX(): number {
1549
+ return r().symbols.GetMouseXW();
1550
+ }
1551
+ static getMouseY(): number {
1552
+ return r().symbols.GetMouseYW();
1553
+ }
1554
+
1555
+ static getMousePosition(): Vec2 {
1556
+ r().symbols.GetMousePositionW(_vec2Buf);
1557
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
1558
+ }
1559
+
1560
+ static getMouseDelta(): Vec2 {
1561
+ r().symbols.GetMouseDeltaW(_vec2Buf);
1562
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
1563
+ }
1564
+
1565
+ static setMousePosition(x: number, y: number): void {
1566
+ r().symbols.SetMousePositionW(x, y);
1567
+ }
1568
+ static setMouseOffset(x: number, y: number): void {
1569
+ r().symbols.SetMouseOffsetW(x, y);
1570
+ }
1571
+ static setMouseScale(scaleX: number, scaleY: number): void {
1572
+ r().symbols.SetMouseScaleW(scaleX, scaleY);
1573
+ }
1574
+ static getMouseWheelMove(): number {
1575
+ return r().symbols.GetMouseWheelMoveW();
1576
+ }
1577
+
1578
+ static getMouseWheelMoveV(): Vec2 {
1579
+ r().symbols.GetMouseWheelMoveVW(_vec2Buf);
1580
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
1581
+ }
1582
+
1583
+ static setMouseCursor(cursor: number): void {
1584
+ r().symbols.SetMouseCursorW(cursor);
1585
+ }
1586
+
1587
+ // --- Input: Touch ---
1588
+
1589
+ static getTouchX(): number {
1590
+ return r().symbols.GetTouchXW();
1591
+ }
1592
+ static getTouchY(): number {
1593
+ return r().symbols.GetTouchYW();
1594
+ }
1595
+
1596
+ static getTouchPosition(index: number): Vec2 {
1597
+ r().symbols.GetTouchPositionW(_vec2Buf, index);
1598
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
1599
+ }
1600
+
1601
+ static getTouchPointId(index: number): number {
1602
+ return r().symbols.GetTouchPointIdW(index);
1603
+ }
1604
+ static getTouchPointCount(): number {
1605
+ return r().symbols.GetTouchPointCountW();
1606
+ }
1607
+
1608
+ // --- Gestures ---
1609
+
1610
+ static setGesturesEnabled(flags: number): void {
1611
+ r().symbols.SetGesturesEnabledW(flags);
1612
+ }
1613
+ static isGestureDetected(gesture: number): boolean {
1614
+ return r().symbols.IsGestureDetectedW(gesture);
1615
+ }
1616
+ static getGestureDetected(): number {
1617
+ return r().symbols.GetGestureDetectedW();
1618
+ }
1619
+ static getGestureHoldDuration(): number {
1620
+ return r().symbols.GetGestureHoldDurationW();
1621
+ }
1622
+
1623
+ static getGestureDragVector(): Vec2 {
1624
+ r().symbols.GetGestureDragVectorW(_vec2Buf);
1625
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
1626
+ }
1627
+
1628
+ static getGestureDragAngle(): number {
1629
+ return r().symbols.GetGestureDragAngleW();
1630
+ }
1631
+
1632
+ static getGesturePinchVector(): Vec2 {
1633
+ r().symbols.GetGesturePinchVectorW(_vec2Buf);
1634
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
1635
+ }
1636
+
1637
+ static getGesturePinchAngle(): number {
1638
+ return r().symbols.GetGesturePinchAngleW();
1639
+ }
1640
+
1641
+ // --- Camera ---
1642
+
1643
+ static updateCamera(camera: Camera3D, mode: number): Camera3D {
1644
+ const pos = new Float32Array([camera.position.x, camera.position.y, camera.position.z]);
1645
+ const tar = new Float32Array([camera.target.x, camera.target.y, camera.target.z]);
1646
+ const up = new Float32Array([camera.up.x, camera.up.y, camera.up.z]);
1647
+ const fovy = new Float32Array([camera.fovy]);
1648
+ const proj = new Int32Array([camera.projection]);
1649
+ r().symbols.UpdateCameraW(pos, tar, up, fovy, proj, mode);
1650
+ return {
1651
+ position: { x: pos[0]!, y: pos[1]!, z: pos[2]! },
1652
+ target: { x: tar[0]!, y: tar[1]!, z: tar[2]! },
1653
+ up: { x: up[0]!, y: up[1]!, z: up[2]! },
1654
+ fovy: fovy[0]!,
1655
+ projection: proj[0]! as Camera3D["projection"],
1656
+ };
1657
+ }
1658
+
1659
+ static updateCameraPro(camera: Camera3D, movement: Vec3, rotation: Vec3, zoom: number): Camera3D {
1660
+ const pos = new Float32Array([camera.position.x, camera.position.y, camera.position.z]);
1661
+ const tar = new Float32Array([camera.target.x, camera.target.y, camera.target.z]);
1662
+ const up = new Float32Array([camera.up.x, camera.up.y, camera.up.z]);
1663
+ const fovy = new Float32Array([camera.fovy]);
1664
+ const proj = new Int32Array([camera.projection]);
1665
+ r().symbols.UpdateCameraProW(
1666
+ pos,
1667
+ tar,
1668
+ up,
1669
+ fovy,
1670
+ proj,
1671
+ movement.x,
1672
+ movement.y,
1673
+ movement.z,
1674
+ rotation.x,
1675
+ rotation.y,
1676
+ rotation.z,
1677
+ zoom,
1678
+ );
1679
+ return {
1680
+ position: { x: pos[0]!, y: pos[1]!, z: pos[2]! },
1681
+ target: { x: tar[0]!, y: tar[1]!, z: tar[2]! },
1682
+ up: { x: up[0]!, y: up[1]!, z: up[2]! },
1683
+ fovy: fovy[0]!,
1684
+ projection: proj[0]! as Camera3D["projection"],
1685
+ };
1686
+ }
1687
+
1688
+ // --- Screen-space ---
1689
+
1690
+ static getScreenToWorldRay(position: Vec2, camera: Camera3D): Ray {
1691
+ const outPos = new Float32Array(3);
1692
+ const outDir = new Float32Array(3);
1693
+ r().symbols.GetScreenToWorldRayW(
1694
+ outPos,
1695
+ outDir,
1696
+ position.x,
1697
+ position.y,
1698
+ f2i(camera.position.x),
1699
+ f2i(camera.position.y),
1700
+ f2i(camera.position.z),
1701
+ f2i(camera.target.x),
1702
+ f2i(camera.target.y),
1703
+ f2i(camera.target.z),
1704
+ f2i(camera.up.x),
1705
+ f2i(camera.up.y),
1706
+ f2i(camera.up.z),
1707
+ f2i(camera.fovy),
1708
+ camera.projection,
1709
+ );
1710
+ return {
1711
+ position: { x: outPos[0]!, y: outPos[1]!, z: outPos[2]! },
1712
+ direction: { x: outDir[0]!, y: outDir[1]!, z: outDir[2]! },
1713
+ };
1714
+ }
1715
+
1716
+ static getWorldToScreen(position: Vec3, camera: Camera3D): Vec2 {
1717
+ r().symbols.GetWorldToScreenW(
1718
+ _vec2Buf,
1719
+ f2i(position.x),
1720
+ f2i(position.y),
1721
+ f2i(position.z),
1722
+ f2i(camera.position.x),
1723
+ f2i(camera.position.y),
1724
+ f2i(camera.position.z),
1725
+ f2i(camera.target.x),
1726
+ f2i(camera.target.y),
1727
+ f2i(camera.target.z),
1728
+ f2i(camera.up.x),
1729
+ f2i(camera.up.y),
1730
+ f2i(camera.up.z),
1731
+ f2i(camera.fovy),
1732
+ camera.projection,
1733
+ );
1734
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
1735
+ }
1736
+
1737
+ static getWorldToScreen2D(position: Vec2, camera: Camera2D): Vec2 {
1738
+ r().symbols.GetWorldToScreen2DW(
1739
+ _vec2Buf,
1740
+ position.x,
1741
+ position.y,
1742
+ camera.offset.x,
1743
+ camera.offset.y,
1744
+ camera.target.x,
1745
+ camera.target.y,
1746
+ f2i(camera.rotation),
1747
+ f2i(camera.zoom),
1748
+ );
1749
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
1750
+ }
1751
+
1752
+ static getScreenToWorld2D(position: Vec2, camera: Camera2D): Vec2 {
1753
+ r().symbols.GetScreenToWorld2DW(
1754
+ _vec2Buf,
1755
+ position.x,
1756
+ position.y,
1757
+ camera.offset.x,
1758
+ camera.offset.y,
1759
+ camera.target.x,
1760
+ camera.target.y,
1761
+ f2i(camera.rotation),
1762
+ f2i(camera.zoom),
1763
+ );
1764
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
1765
+ }
1766
+
1767
+ // --- DrawFPS ---
1768
+
1769
+ static drawFPS(posX: number, posY: number): void {
1770
+ r().symbols.DrawFPSW(posX, posY);
1771
+ }
1772
+
1773
+ // --- Texture ---
1774
+ static loadTexture(fileName: string): Texture2D {
1775
+ r().symbols.LoadTextureW(this._texOutId, this._texOutW, this._texOutH, cstr(fileName));
1776
+ return {
1777
+ id: this._texOutId[0]!,
1778
+ width: this._texOutW[0]!,
1779
+ height: this._texOutH[0]!,
1780
+ };
1781
+ }
1782
+
1783
+ static unloadTexture(texture: Texture2D): void {
1784
+ r().symbols.UnloadTextureW(texture.id);
1785
+ }
1786
+
1787
+ static isTextureValid(texture: Texture2D): boolean {
1788
+ return r().symbols.IsTextureValidW(texture.id, texture.width, texture.height);
1789
+ }
1790
+
1791
+ static loadRenderTexture(width: number, height: number): RenderTexture2D {
1792
+ r().symbols.LoadRenderTextureW(
1793
+ this._texOutId,
1794
+ this._texOutTexId,
1795
+ this._texOutW,
1796
+ this._texOutH,
1797
+ width,
1798
+ height,
1799
+ );
1800
+ return {
1801
+ id: this._texOutId[0]!,
1802
+ texture: {
1803
+ id: this._texOutTexId[0]!,
1804
+ width: this._texOutW[0]!,
1805
+ height: this._texOutH[0]!,
1806
+ },
1807
+ };
1808
+ }
1809
+
1810
+ static unloadRenderTexture(target: RenderTexture2D): void {
1811
+ r().symbols.UnloadRenderTextureW(target.id);
1812
+ }
1813
+
1814
+ static isRenderTextureValid(target: RenderTexture2D): boolean {
1815
+ return r().symbols.IsRenderTextureValidW(target.id);
1816
+ }
1817
+
1818
+ static genTextureMipmaps(texture: Texture2D): void {
1819
+ r().symbols.GenTextureMipmapsW(texture.id);
1820
+ }
1821
+
1822
+ static setTextureFilter(texture: Texture2D, filter: number): void {
1823
+ r().symbols.SetTextureFilterW(texture.id, filter);
1824
+ }
1825
+
1826
+ static setTextureWrap(texture: Texture2D, wrap: number): void {
1827
+ r().symbols.SetTextureWrapW(texture.id, wrap);
1828
+ }
1829
+
1830
+ static drawTexture(texture: Texture2D, posX: number, posY: number, tint: Color): void {
1831
+ r().symbols.DrawTextureW(texture.id, texture.width, texture.height, posX, posY, tint);
1832
+ }
1833
+
1834
+ static drawTextureEx(
1835
+ texture: Texture2D,
1836
+ position: Vec2,
1837
+ rotation: number,
1838
+ scale: number,
1839
+ tint: Color,
1840
+ ): void {
1841
+ r().symbols.DrawTextureExW(
1842
+ texture.id,
1843
+ texture.width,
1844
+ texture.height,
1845
+ position.x,
1846
+ position.y,
1847
+ f2i(rotation),
1848
+ f2i(scale),
1849
+ tint,
1850
+ );
1851
+ }
1852
+
1853
+ static drawTextureRec(texture: Texture2D, source: Rectangle, position: Vec2, tint: Color): void {
1854
+ r().symbols.DrawTextureRecW(
1855
+ texture.id,
1856
+ texture.width,
1857
+ texture.height,
1858
+ source.x,
1859
+ source.y,
1860
+ source.width,
1861
+ source.height,
1862
+ position.x,
1863
+ position.y,
1864
+ tint,
1865
+ );
1866
+ }
1867
+
1868
+ static drawTexturePro(
1869
+ texture: Texture2D,
1870
+ source: Rectangle,
1871
+ dest: Rectangle,
1872
+ origin: Vec2,
1873
+ rotation: number,
1874
+ tint: Color,
1875
+ ): void {
1876
+ r().symbols.DrawTextureProW(
1877
+ texture.id,
1878
+ texture.width,
1879
+ texture.height,
1880
+ source.x,
1881
+ source.y,
1882
+ source.width,
1883
+ source.height,
1884
+ dest.x,
1885
+ dest.y,
1886
+ dest.width,
1887
+ dest.height,
1888
+ origin.x,
1889
+ origin.y,
1890
+ f2i(rotation),
1891
+ tint,
1892
+ );
1893
+ }
1894
+
1895
+ // --- Model ---
1896
+
1897
+ private static _bbMin = new Float32Array(3);
1898
+ private static _bbMax = new Float32Array(3);
1899
+
1900
+ static loadModel(fileName: string): Model {
1901
+ return r().symbols.LoadModelW(cstr(fileName));
1902
+ }
1903
+
1904
+ static unloadModel(model: Model): void {
1905
+ r().symbols.UnloadModelW(model);
1906
+ }
1907
+
1908
+ static isModelValid(model: Model): boolean {
1909
+ return r().symbols.IsModelValidW(model);
1910
+ }
1911
+
1912
+ static getModelBoundingBox(model: Model): BoundingBox {
1913
+ r().symbols.GetModelBoundingBoxW(this._bbMin, this._bbMax, model);
1914
+ return {
1915
+ min: { x: this._bbMin[0]!, y: this._bbMin[1]!, z: this._bbMin[2]! },
1916
+ max: { x: this._bbMax[0]!, y: this._bbMax[1]!, z: this._bbMax[2]! },
1917
+ };
1918
+ }
1919
+
1920
+ static drawModel(model: Model, position: Vec3, scale: number, tint: Color): void {
1921
+ r().symbols.DrawModelW(
1922
+ model,
1923
+ f2i(position.x),
1924
+ f2i(position.y),
1925
+ f2i(position.z),
1926
+ f2i(scale),
1927
+ tint,
1928
+ );
1929
+ }
1930
+
1931
+ static drawModelEx(
1932
+ model: Model,
1933
+ position: Vec3,
1934
+ rotationAxis: Vec3,
1935
+ rotationAngle: number,
1936
+ scale: Vec3,
1937
+ tint: Color,
1938
+ ): void {
1939
+ r().symbols.DrawModelExW(
1940
+ model,
1941
+ f2i(position.x),
1942
+ f2i(position.y),
1943
+ f2i(position.z),
1944
+ f2i(rotationAxis.x),
1945
+ f2i(rotationAxis.y),
1946
+ f2i(rotationAxis.z),
1947
+ f2i(rotationAngle),
1948
+ f2i(scale.x),
1949
+ f2i(scale.y),
1950
+ f2i(scale.z),
1951
+ tint,
1952
+ );
1953
+ }
1954
+
1955
+ static drawModelWires(model: Model, position: Vec3, scale: number, tint: Color): void {
1956
+ r().symbols.DrawModelWiresW(
1957
+ model,
1958
+ f2i(position.x),
1959
+ f2i(position.y),
1960
+ f2i(position.z),
1961
+ f2i(scale),
1962
+ tint,
1963
+ );
1964
+ }
1965
+
1966
+ static drawModelWiresEx(
1967
+ model: Model,
1968
+ position: Vec3,
1969
+ rotationAxis: Vec3,
1970
+ rotationAngle: number,
1971
+ scale: Vec3,
1972
+ tint: Color,
1973
+ ): void {
1974
+ r().symbols.DrawModelWiresExW(
1975
+ model,
1976
+ f2i(position.x),
1977
+ f2i(position.y),
1978
+ f2i(position.z),
1979
+ f2i(rotationAxis.x),
1980
+ f2i(rotationAxis.y),
1981
+ f2i(rotationAxis.z),
1982
+ f2i(rotationAngle),
1983
+ f2i(scale.x),
1984
+ f2i(scale.y),
1985
+ f2i(scale.z),
1986
+ tint,
1987
+ );
1988
+ }
1989
+
1990
+ // --- Shapes texture ---
1991
+
1992
+ static setShapesTexture(texture: Texture2D, source: Rectangle): void {
1993
+ r().symbols.SetShapesTextureW(
1994
+ texture.id,
1995
+ texture.width,
1996
+ texture.height,
1997
+ source.x,
1998
+ source.y,
1999
+ source.width,
2000
+ source.height,
2001
+ );
2002
+ }
2003
+
2004
+ static getShapesTexture(): Texture2D {
2005
+ r().symbols.GetShapesTextureW(this._shapesTexId, this._shapesTexW, this._shapesTexH);
2006
+ return { id: this._shapesTexId[0]!, width: this._shapesTexW[0]!, height: this._shapesTexH[0]! };
2007
+ }
2008
+
2009
+ static getShapesTextureRectangle(): Rectangle {
2010
+ r().symbols.GetShapesTextureRectangleW(_recBuf);
2011
+ return { x: _recBuf[0]!, y: _recBuf[1]!, width: _recBuf[2]!, height: _recBuf[3]! };
2012
+ }
2013
+
2014
+ // --- Color utilities ---
2015
+
2016
+ private static _vec4Buf = new Float32Array(4);
2017
+ private static _vec3Buf2 = new Float32Array(3);
2018
+
2019
+ static colorToInt(c: Color): number {
2020
+ return r().symbols.ColorToIntW(c);
2021
+ }
2022
+
2023
+ static colorNormalize(c: Color): { x: number; y: number; z: number; w: number } {
2024
+ r().symbols.ColorNormalizeW(this._vec4Buf, c);
2025
+ return {
2026
+ x: this._vec4Buf[0]!,
2027
+ y: this._vec4Buf[1]!,
2028
+ z: this._vec4Buf[2]!,
2029
+ w: this._vec4Buf[3]!,
2030
+ };
2031
+ }
2032
+
2033
+ static colorFromNormalized(normalized: { x: number; y: number; z: number; w: number }): Color {
2034
+ return r().symbols.ColorFromNormalizedW(
2035
+ f2i(normalized.x),
2036
+ f2i(normalized.y),
2037
+ f2i(normalized.z),
2038
+ f2i(normalized.w),
2039
+ );
2040
+ }
2041
+
2042
+ static colorToHSV(c: Color): { h: number; s: number; v: number } {
2043
+ r().symbols.ColorToHSVW(this._vec3Buf2, c);
2044
+ return { h: this._vec3Buf2[0]!, s: this._vec3Buf2[1]!, v: this._vec3Buf2[2]! };
2045
+ }
2046
+
2047
+ static colorFromHSV(hue: number, saturation: number, value: number): Color {
2048
+ return r().symbols.ColorFromHSVW(f2i(hue), f2i(saturation), f2i(value));
2049
+ }
2050
+
2051
+ static colorTint(color: Color, tint: Color): Color {
2052
+ return r().symbols.ColorTintW(color, tint);
2053
+ }
2054
+ static colorBrightness(color: Color, factor: number): Color {
2055
+ return r().symbols.ColorBrightnessW(color, f2i(factor));
2056
+ }
2057
+ static colorContrast(color: Color, contrast: number): Color {
2058
+ return r().symbols.ColorContrastW(color, f2i(contrast));
2059
+ }
2060
+ static colorAlpha(color: Color, alpha: number): Color {
2061
+ return r().symbols.ColorAlphaW(color, f2i(alpha));
2062
+ }
2063
+ static colorAlphaBlend(dst: Color, src: Color, tint: Color): Color {
2064
+ return r().symbols.ColorAlphaBlendW(dst, src, tint);
2065
+ }
2066
+ static colorLerp(color1: Color, color2: Color, factor: number): Color {
2067
+ return r().symbols.ColorLerpW(color1, color2, f2i(factor));
2068
+ }
2069
+ static getColor(hexValue: number): Color {
2070
+ return r().symbols.GetColorW(hexValue);
2071
+ }
2072
+ static fade(color: Color, alpha: number): Color {
2073
+ return r().symbols.FadeW(color, f2i(alpha));
2074
+ }
2075
+ static colorIsEqual(col1: Color, col2: Color): boolean {
2076
+ return r().symbols.ColorIsEqualW(col1, col2);
2077
+ }
2078
+ static getPixelDataSize(width: number, height: number, format: number): number {
2079
+ return r().symbols.GetPixelDataSizeW(width, height, format);
2080
+ }
2081
+
2082
+ // --- Font ---
2083
+
2084
+ private static _vec2Buf2 = new Float32Array(2);
2085
+
2086
+ static loadFont(fileName: string): Font {
2087
+ return r().symbols.LoadFontW(cstr(fileName));
2088
+ }
2089
+
2090
+ static loadFontEx(fileName: string, fontSize: number): Font {
2091
+ return r().symbols.LoadFontExW(cstr(fileName), fontSize);
2092
+ }
2093
+
2094
+ static getFontDefault(): Font {
2095
+ return r().symbols.GetFontDefaultW();
2096
+ }
2097
+
2098
+ static unloadFont(font: Font): void {
2099
+ r().symbols.UnloadFontW(font);
2100
+ }
2101
+
2102
+ static isFontValid(font: Font): boolean {
2103
+ return r().symbols.IsFontValidW(font);
2104
+ }
2105
+
2106
+ static measureText(text: string, fontSize: number): number {
2107
+ return r().symbols.MeasureTextW(cstr(text), fontSize);
2108
+ }
2109
+
2110
+ static measureTextEx(font: Font, text: string, fontSize: number, spacing: number): Vec2 {
2111
+ r().symbols.MeasureTextExW(this._vec2Buf2, font, cstr(text), fontSize, f2i(spacing));
2112
+ return { x: this._vec2Buf2[0]!, y: this._vec2Buf2[1]! };
2113
+ }
2114
+
2115
+ static drawTextEx(
2116
+ font: Font,
2117
+ text: string,
2118
+ position: Vec2,
2119
+ fontSize: number,
2120
+ spacing: number,
2121
+ tint: Color,
2122
+ ): void {
2123
+ r().symbols.DrawTextExW(font, cstr(text), position.x, position.y, fontSize, f2i(spacing), tint);
2124
+ }
2125
+
2126
+ static drawTextPro(
2127
+ font: Font,
2128
+ text: string,
2129
+ position: Vec2,
2130
+ origin: Vec2,
2131
+ rotation: number,
2132
+ fontSize: number,
2133
+ spacing: number,
2134
+ tint: Color,
2135
+ ): void {
2136
+ r().symbols.DrawTextProW(
2137
+ font,
2138
+ cstr(text),
2139
+ position.x,
2140
+ position.y,
2141
+ origin.x,
2142
+ origin.y,
2143
+ f2i(rotation),
2144
+ fontSize,
2145
+ f2i(spacing),
2146
+ tint,
2147
+ );
2148
+ }
2149
+
2150
+ static setTextLineSpacing(spacing: number): void {
2151
+ r().symbols.SetTextLineSpacingW(spacing);
2152
+ }
2153
+
2154
+ // --- Core extensions ---
2155
+
2156
+ static setGamepadVibration(
2157
+ gamepad: number,
2158
+ leftMotor: number,
2159
+ rightMotor: number,
2160
+ duration: number,
2161
+ ): void {
2162
+ r().symbols.SetGamepadVibrationW(gamepad, leftMotor, rightMotor, duration);
2163
+ }
2164
+
2165
+ static traceLog(logLevel: number, text: string): void {
2166
+ r().symbols.TraceLogW(logLevel, cstr(text));
2167
+ }
2168
+
2169
+ static setTraceLogLevel(logLevel: number): void {
2170
+ r().symbols.SetTraceLogLevelW(logLevel);
2171
+ }
2172
+
2173
+ static setWindowIcon(image: Image): void {
2174
+ r().symbols.SetWindowIconW(image);
2175
+ }
2176
+
2177
+ static getClipboardImage(): Image {
2178
+ return r().symbols.GetClipboardImageW();
2179
+ }
2180
+
2181
+ // --- Screen-space extended ---
2182
+
2183
+ static getScreenToWorldRayEx(
2184
+ position: Vec2,
2185
+ camera: Camera3D,
2186
+ width: number,
2187
+ height: number,
2188
+ ): Ray {
2189
+ r().symbols.GetScreenToWorldRayExW(
2190
+ this._rayPosBuf2,
2191
+ this._rayDirBuf2,
2192
+ position.x,
2193
+ position.y,
2194
+ width,
2195
+ height,
2196
+ f2i(camera.position.x),
2197
+ f2i(camera.position.y),
2198
+ f2i(camera.position.z),
2199
+ f2i(camera.target.x),
2200
+ f2i(camera.target.y),
2201
+ f2i(camera.target.z),
2202
+ f2i(camera.up.x),
2203
+ f2i(camera.up.y),
2204
+ f2i(camera.up.z),
2205
+ f2i(camera.fovy),
2206
+ camera.projection,
2207
+ );
2208
+ return {
2209
+ position: { x: this._rayPosBuf2[0]!, y: this._rayPosBuf2[1]!, z: this._rayPosBuf2[2]! },
2210
+ direction: { x: this._rayDirBuf2[0]!, y: this._rayDirBuf2[1]!, z: this._rayDirBuf2[2]! },
2211
+ };
2212
+ }
2213
+
2214
+ static getWorldToScreenEx(position: Vec3, camera: Camera3D, width: number, height: number): Vec2 {
2215
+ r().symbols.GetWorldToScreenExW(
2216
+ _vec2Buf,
2217
+ f2i(position.x),
2218
+ f2i(position.y),
2219
+ f2i(position.z),
2220
+ f2i(camera.position.x),
2221
+ f2i(camera.position.y),
2222
+ f2i(camera.position.z),
2223
+ f2i(camera.target.x),
2224
+ f2i(camera.target.y),
2225
+ f2i(camera.target.z),
2226
+ f2i(camera.up.x),
2227
+ f2i(camera.up.y),
2228
+ f2i(camera.up.z),
2229
+ f2i(camera.fovy),
2230
+ camera.projection,
2231
+ width,
2232
+ height,
2233
+ );
2234
+ return { x: _vec2Buf[0]!, y: _vec2Buf[1]! };
2235
+ }
2236
+
2237
+ private static _matBuf = new Float32Array(16);
2238
+
2239
+ static getCameraMatrix(camera: Camera3D): Float32Array {
2240
+ r().symbols.GetCameraMatrixW(
2241
+ this._matBuf,
2242
+ f2i(camera.position.x),
2243
+ f2i(camera.position.y),
2244
+ f2i(camera.position.z),
2245
+ f2i(camera.target.x),
2246
+ f2i(camera.target.y),
2247
+ f2i(camera.target.z),
2248
+ f2i(camera.up.x),
2249
+ f2i(camera.up.y),
2250
+ f2i(camera.up.z),
2251
+ f2i(camera.fovy),
2252
+ camera.projection,
2253
+ );
2254
+ return new Float32Array(this._matBuf);
2255
+ }
2256
+
2257
+ static getCameraMatrix2D(camera: Camera2D): Float32Array {
2258
+ r().symbols.GetCameraMatrix2DW(
2259
+ this._matBuf,
2260
+ camera.offset.x,
2261
+ camera.offset.y,
2262
+ camera.target.x,
2263
+ camera.target.y,
2264
+ f2i(camera.rotation),
2265
+ f2i(camera.zoom),
2266
+ );
2267
+ return new Float32Array(this._matBuf);
2268
+ }
2269
+
2270
+ // --- File system ---
2271
+
2272
+ static fileExists(fileName: string): boolean {
2273
+ return r().symbols.FileExistsW(cstr(fileName));
2274
+ }
2275
+ static directoryExists(dirPath: string): boolean {
2276
+ return r().symbols.DirectoryExistsW(cstr(dirPath));
2277
+ }
2278
+ static isFileExtension(fileName: string, ext: string): boolean {
2279
+ return r().symbols.IsFileExtensionW(cstr(fileName), cstr(ext));
2280
+ }
2281
+ static getFileLength(fileName: string): number {
2282
+ return r().symbols.GetFileLengthW(cstr(fileName));
2283
+ }
2284
+
2285
+ static getFileExtension(fileName: string): string {
2286
+ const ptr = r().symbols.GetFileExtensionW(cstr(fileName));
2287
+ if (!ptr) return "";
2288
+ return new CString(ptr).toString();
2289
+ }
2290
+
2291
+ static getFileName(filePath: string): string {
2292
+ const ptr = r().symbols.GetFileNameW(cstr(filePath));
2293
+ if (!ptr) return "";
2294
+ return new CString(ptr).toString();
2295
+ }
2296
+
2297
+ static getFileNameWithoutExt(filePath: string): string {
2298
+ const ptr = r().symbols.GetFileNameWithoutExtW(cstr(filePath));
2299
+ if (!ptr) return "";
2300
+ return new CString(ptr).toString();
2301
+ }
2302
+
2303
+ static getDirectoryPath(filePath: string): string {
2304
+ const ptr = r().symbols.GetDirectoryPathW(cstr(filePath));
2305
+ if (!ptr) return "";
2306
+ return new CString(ptr).toString();
2307
+ }
2308
+
2309
+ static getPrevDirectoryPath(dirPath: string): string {
2310
+ const ptr = r().symbols.GetPrevDirectoryPathW(cstr(dirPath));
2311
+ if (!ptr) return "";
2312
+ return new CString(ptr).toString();
2313
+ }
2314
+
2315
+ static getWorkingDirectory(): string {
2316
+ const ptr = r().symbols.GetWorkingDirectoryW();
2317
+ if (!ptr) return "";
2318
+ return new CString(ptr).toString();
2319
+ }
2320
+
2321
+ static getApplicationDirectory(): string {
2322
+ const ptr = r().symbols.GetApplicationDirectoryW();
2323
+ if (!ptr) return "";
2324
+ return new CString(ptr).toString();
2325
+ }
2326
+
2327
+ static makeDirectory(dirPath: string): number {
2328
+ return r().symbols.MakeDirectoryW(cstr(dirPath));
2329
+ }
2330
+ static changeDirectory(dir: string): boolean {
2331
+ return r().symbols.ChangeDirectoryW(cstr(dir));
2332
+ }
2333
+ static isPathFile(path: string): boolean {
2334
+ return r().symbols.IsPathFileW(cstr(path));
2335
+ }
2336
+ static isFileNameValid(fileName: string): boolean {
2337
+ return r().symbols.IsFileNameValidW(cstr(fileName));
2338
+ }
2339
+ static getFileModTime(fileName: string): number {
2340
+ return Number(r().symbols.GetFileModTimeW(cstr(fileName)));
2341
+ }
2342
+
2343
+ static loadFileText(fileName: string): string {
2344
+ const ptr = r().symbols.LoadFileTextW(cstr(fileName));
2345
+ if (!ptr) return "";
2346
+ return new CString(ptr).toString();
2347
+ }
2348
+
2349
+ static unloadFileText(text: string): void {
2350
+ r().symbols.UnloadFileTextW(Buffer.from(text));
2351
+ }
2352
+ static saveFileText(fileName: string, text: string): boolean {
2353
+ return r().symbols.SaveFileTextW(cstr(fileName), cstr(text));
2354
+ }
2355
+
2356
+ static computeCRC32(data: Uint8Array, dataSize: number): number {
2357
+ return r().symbols.ComputeCRC32W(data, dataSize);
2358
+ }
2359
+
2360
+ // --- Shader ---
2361
+
2362
+ static loadShader(vsFileName: string | null, fsFileName: string | null): Shader {
2363
+ return r().symbols.LoadShaderW(
2364
+ vsFileName ? cstr(vsFileName) : null,
2365
+ fsFileName ? cstr(fsFileName) : null,
2366
+ );
2367
+ }
2368
+
2369
+ static loadShaderFromMemory(vsCode: string | null, fsCode: string | null): Shader {
2370
+ return r().symbols.LoadShaderFromMemoryW(
2371
+ vsCode ? cstr(vsCode) : null,
2372
+ fsCode ? cstr(fsCode) : null,
2373
+ );
2374
+ }
2375
+
2376
+ static isShaderValid(shader: Shader): boolean {
2377
+ return r().symbols.IsShaderValidW(shader);
2378
+ }
2379
+ static getShaderLocation(shader: Shader, uniformName: string): number {
2380
+ return r().symbols.GetShaderLocationW(shader, cstr(uniformName));
2381
+ }
2382
+ static getShaderLocationAttrib(shader: Shader, attribName: string): number {
2383
+ return r().symbols.GetShaderLocationAttribW(shader, cstr(attribName));
2384
+ }
2385
+
2386
+ static setShaderValueMatrix(shader: Shader, locIndex: number, mat: Float32Array): void {
2387
+ r().symbols.SetShaderValueMatrixW(shader, locIndex, mat);
2388
+ }
2389
+
2390
+ static setShaderValueTexture(shader: Shader, locIndex: number, texture: Texture2D): void {
2391
+ r().symbols.SetShaderValueTextureW(shader, locIndex, texture.id, texture.width, texture.height);
2392
+ }
2393
+
2394
+ static unloadShader(shader: Shader): void {
2395
+ r().symbols.UnloadShaderW(shader);
2396
+ }
2397
+ static beginShaderMode(shader: Shader): void {
2398
+ r().symbols.BeginShaderModeW(shader);
2399
+ }
2400
+ static endShaderMode(): void {
2401
+ r().symbols.EndShaderModeW();
2402
+ }
2403
+
2404
+ // --- Image loading ---
2405
+
2406
+ static loadImage(fileName: string): Image {
2407
+ return r().symbols.LoadImageW(cstr(fileName));
2408
+ }
2409
+ static loadImageRaw(
2410
+ fileName: string,
2411
+ width: number,
2412
+ height: number,
2413
+ format: number,
2414
+ headerSize: number,
2415
+ ): Image {
2416
+ return r().symbols.LoadImageRawW(cstr(fileName), width, height, format, headerSize);
2417
+ }
2418
+
2419
+ private static _imgAnimSlot = new Int32Array(1);
2420
+ private static _imgAnimFrames = new Int32Array(1);
2421
+
2422
+ static loadImageAnim(fileName: string): { image: Image; frames: number } {
2423
+ r().symbols.LoadImageAnimW(this._imgAnimSlot, this._imgAnimFrames, cstr(fileName));
2424
+ return { image: this._imgAnimSlot[0]!, frames: this._imgAnimFrames[0]! };
2425
+ }
2426
+
2427
+ static loadImageFromMemory(fileType: string, fileData: Uint8Array, dataSize: number): Image {
2428
+ return r().symbols.LoadImageFromMemoryW(cstr(fileType), fileData, dataSize);
2429
+ }
2430
+
2431
+ static loadImageFromTexture(texture: Texture2D): Image {
2432
+ return r().symbols.LoadImageFromTextureW(texture.id, texture.width, texture.height);
2433
+ }
2434
+
2435
+ static loadImageFromScreen(): Image {
2436
+ return r().symbols.LoadImageFromScreenW();
2437
+ }
2438
+ static isImageValid(image: Image): boolean {
2439
+ return r().symbols.IsImageValidW(image);
2440
+ }
2441
+ static unloadImage(image: Image): void {
2442
+ r().symbols.UnloadImageW(image);
2443
+ }
2444
+ static exportImage(image: Image, fileName: string): boolean {
2445
+ return r().symbols.ExportImageW(image, cstr(fileName));
2446
+ }
2447
+ static exportImageAsCode(image: Image, fileName: string): boolean {
2448
+ return r().symbols.ExportImageAsCodeW(image, cstr(fileName));
2449
+ }
2450
+
2451
+ // --- Image generation ---
2452
+
2453
+ static genImageColor(width: number, height: number, color: Color): Image {
2454
+ return r().symbols.GenImageColorW(width, height, color);
2455
+ }
2456
+ static genImageGradientLinear(
2457
+ width: number,
2458
+ height: number,
2459
+ direction: number,
2460
+ start: Color,
2461
+ end: Color,
2462
+ ): Image {
2463
+ return r().symbols.GenImageGradientLinearW(width, height, direction, start, end);
2464
+ }
2465
+ static genImageGradientRadial(
2466
+ width: number,
2467
+ height: number,
2468
+ density: number,
2469
+ inner: Color,
2470
+ outer: Color,
2471
+ ): Image {
2472
+ return r().symbols.GenImageGradientRadialW(width, height, f2i(density), inner, outer);
2473
+ }
2474
+ static genImageGradientSquare(
2475
+ width: number,
2476
+ height: number,
2477
+ density: number,
2478
+ inner: Color,
2479
+ outer: Color,
2480
+ ): Image {
2481
+ return r().symbols.GenImageGradientSquareW(width, height, f2i(density), inner, outer);
2482
+ }
2483
+ static genImageChecked(
2484
+ width: number,
2485
+ height: number,
2486
+ checksX: number,
2487
+ checksY: number,
2488
+ col1: Color,
2489
+ col2: Color,
2490
+ ): Image {
2491
+ return r().symbols.GenImageCheckedW(width, height, checksX, checksY, col1, col2);
2492
+ }
2493
+ static genImageWhiteNoise(width: number, height: number, factor: number): Image {
2494
+ return r().symbols.GenImageWhiteNoiseW(width, height, f2i(factor));
2495
+ }
2496
+ static genImagePerlinNoise(
2497
+ width: number,
2498
+ height: number,
2499
+ offsetX: number,
2500
+ offsetY: number,
2501
+ scale: number,
2502
+ ): Image {
2503
+ return r().symbols.GenImagePerlinNoiseW(width, height, offsetX, offsetY, f2i(scale));
2504
+ }
2505
+ static genImageCellular(width: number, height: number, tileSize: number): Image {
2506
+ return r().symbols.GenImageCellularW(width, height, tileSize);
2507
+ }
2508
+ static genImageText(width: number, height: number, text: string): Image {
2509
+ return r().symbols.GenImageTextW(width, height, cstr(text));
2510
+ }
2511
+
2512
+ // --- Image manipulation ---
2513
+
2514
+ static imageCopy(image: Image): Image {
2515
+ return r().symbols.ImageCopyW(image);
2516
+ }
2517
+ static imageFromImage(image: Image, rec: Rectangle): Image {
2518
+ return r().symbols.ImageFromImageW(image, rec.x, rec.y, rec.width, rec.height);
2519
+ }
2520
+ static imageFromChannel(image: Image, selectedChannel: number): Image {
2521
+ return r().symbols.ImageFromChannelW(image, selectedChannel);
2522
+ }
2523
+ static imageText(text: string, fontSize: number, color: Color): Image {
2524
+ return r().symbols.ImageTextW(cstr(text), fontSize, color);
2525
+ }
2526
+ static imageTextEx(
2527
+ font: Font,
2528
+ text: string,
2529
+ fontSize: number,
2530
+ spacing: number,
2531
+ tint: Color,
2532
+ ): Image {
2533
+ return r().symbols.ImageTextExW(font, cstr(text), fontSize, f2i(spacing), tint);
2534
+ }
2535
+
2536
+ static imageFormat(image: Image, newFormat: number): void {
2537
+ r().symbols.ImageFormatW(image, newFormat);
2538
+ }
2539
+ static imageCrop(image: Image, rec: Rectangle): void {
2540
+ r().symbols.ImageCropW(image, rec.x, rec.y, rec.width, rec.height);
2541
+ }
2542
+ static imageAlphaCrop(image: Image, threshold: number): void {
2543
+ r().symbols.ImageAlphaCropW(image, f2i(threshold));
2544
+ }
2545
+ static imageAlphaClear(image: Image, color: Color, threshold: number): void {
2546
+ r().symbols.ImageAlphaClearW(image, color, f2i(threshold));
2547
+ }
2548
+ static imageAlphaMask(image: Image, alphaMask: Image): void {
2549
+ r().symbols.ImageAlphaMaskW(image, alphaMask);
2550
+ }
2551
+ static imageAlphaPremultiply(image: Image): void {
2552
+ r().symbols.ImageAlphaPremultiplyW(image);
2553
+ }
2554
+ static imageBlurGaussian(image: Image, blurSize: number): void {
2555
+ r().symbols.ImageBlurGaussianW(image, blurSize);
2556
+ }
2557
+ static imageResize(image: Image, newWidth: number, newHeight: number): void {
2558
+ r().symbols.ImageResizeW(image, newWidth, newHeight);
2559
+ }
2560
+ static imageResizeNN(image: Image, newWidth: number, newHeight: number): void {
2561
+ r().symbols.ImageResizeNNW(image, newWidth, newHeight);
2562
+ }
2563
+ static imageResizeCanvas(
2564
+ image: Image,
2565
+ newWidth: number,
2566
+ newHeight: number,
2567
+ offsetX: number,
2568
+ offsetY: number,
2569
+ fill: Color,
2570
+ ): void {
2571
+ r().symbols.ImageResizeCanvasW(image, newWidth, newHeight, offsetX, offsetY, fill);
2572
+ }
2573
+ static imageMipmaps(image: Image): void {
2574
+ r().symbols.ImageMipmapsW(image);
2575
+ }
2576
+ static imageDither(image: Image, rBpp: number, gBpp: number, bBpp: number, aBpp: number): void {
2577
+ r().symbols.ImageDitherW(image, rBpp, gBpp, bBpp, aBpp);
2578
+ }
2579
+ static imageFlipVertical(image: Image): void {
2580
+ r().symbols.ImageFlipVerticalW(image);
2581
+ }
2582
+ static imageFlipHorizontal(image: Image): void {
2583
+ r().symbols.ImageFlipHorizontalW(image);
2584
+ }
2585
+ static imageRotate(image: Image, degrees: number): void {
2586
+ r().symbols.ImageRotateW(image, f2i(degrees));
2587
+ }
2588
+ static imageRotateCW(image: Image): void {
2589
+ r().symbols.ImageRotateCWW(image);
2590
+ }
2591
+ static imageRotateCCW(image: Image): void {
2592
+ r().symbols.ImageRotateCCWW(image);
2593
+ }
2594
+ static imageColorTint(image: Image, color: Color): void {
2595
+ r().symbols.ImageColorTintW(image, color);
2596
+ }
2597
+ static imageColorInvert(image: Image): void {
2598
+ r().symbols.ImageColorInvertW(image);
2599
+ }
2600
+ static imageColorGrayscale(image: Image): void {
2601
+ r().symbols.ImageColorGrayscaleW(image);
2602
+ }
2603
+ static imageColorContrast(image: Image, contrast: number): void {
2604
+ r().symbols.ImageColorContrastW(image, f2i(contrast));
2605
+ }
2606
+ static imageColorBrightness(image: Image, brightness: number): void {
2607
+ r().symbols.ImageColorBrightnessW(image, brightness);
2608
+ }
2609
+ static imageColorReplace(image: Image, color: Color, replace: Color): void {
2610
+ r().symbols.ImageColorReplaceW(image, color, replace);
2611
+ }
2612
+
2613
+ // --- Image info ---
2614
+
2615
+ static getImageAlphaBorder(image: Image, threshold: number): Rectangle {
2616
+ r().symbols.GetImageAlphaBorderW(_recBuf, image, f2i(threshold));
2617
+ return { x: _recBuf[0]!, y: _recBuf[1]!, width: _recBuf[2]!, height: _recBuf[3]! };
2618
+ }
2619
+
2620
+ static getImageColor(image: Image, x: number, y: number): Color {
2621
+ return r().symbols.GetImageColorW(image, x, y);
2622
+ }
2623
+
2624
+ // --- Image drawing ---
2625
+
2626
+ static imageClearBackground(dst: Image, color: Color): void {
2627
+ r().symbols.ImageClearBackgroundW(dst, color);
2628
+ }
2629
+ static imageDrawPixel(dst: Image, posX: number, posY: number, color: Color): void {
2630
+ r().symbols.ImageDrawPixelW(dst, posX, posY, color);
2631
+ }
2632
+ static imageDrawPixelV(dst: Image, position: Vec2, color: Color): void {
2633
+ r().symbols.ImageDrawPixelVW(dst, position.x, position.y, color);
2634
+ }
2635
+ static imageDrawLine(
2636
+ dst: Image,
2637
+ startX: number,
2638
+ startY: number,
2639
+ endX: number,
2640
+ endY: number,
2641
+ color: Color,
2642
+ ): void {
2643
+ r().symbols.ImageDrawLineW(dst, startX, startY, endX, endY, color);
2644
+ }
2645
+ static imageDrawLineV(dst: Image, start: Vec2, end: Vec2, color: Color): void {
2646
+ r().symbols.ImageDrawLineVW(dst, start.x, start.y, end.x, end.y, color);
2647
+ }
2648
+ static imageDrawLineEx(dst: Image, start: Vec2, end: Vec2, thick: number, color: Color): void {
2649
+ r().symbols.ImageDrawLineExW(dst, start.x, start.y, end.x, end.y, thick, color);
2650
+ }
2651
+ static imageDrawCircle(
2652
+ dst: Image,
2653
+ centerX: number,
2654
+ centerY: number,
2655
+ radius: number,
2656
+ color: Color,
2657
+ ): void {
2658
+ r().symbols.ImageDrawCircleW(dst, centerX, centerY, radius, color);
2659
+ }
2660
+ static imageDrawCircleV(dst: Image, center: Vec2, radius: number, color: Color): void {
2661
+ r().symbols.ImageDrawCircleVW(dst, center.x, center.y, radius, color);
2662
+ }
2663
+ static imageDrawCircleLines(
2664
+ dst: Image,
2665
+ centerX: number,
2666
+ centerY: number,
2667
+ radius: number,
2668
+ color: Color,
2669
+ ): void {
2670
+ r().symbols.ImageDrawCircleLinesW(dst, centerX, centerY, radius, color);
2671
+ }
2672
+ static imageDrawCircleLinesV(dst: Image, center: Vec2, radius: number, color: Color): void {
2673
+ r().symbols.ImageDrawCircleLinesVW(dst, center.x, center.y, radius, color);
2674
+ }
2675
+ static imageDrawRectangle(
2676
+ dst: Image,
2677
+ posX: number,
2678
+ posY: number,
2679
+ w: number,
2680
+ h: number,
2681
+ color: Color,
2682
+ ): void {
2683
+ r().symbols.ImageDrawRectangleW(dst, posX, posY, w, h, color);
2684
+ }
2685
+ static imageDrawRectangleV(dst: Image, position: Vec2, size: Vec2, color: Color): void {
2686
+ r().symbols.ImageDrawRectangleVW(dst, position.x, position.y, size.x, size.y, color);
2687
+ }
2688
+ static imageDrawRectangleRec(dst: Image, rec: Rectangle, color: Color): void {
2689
+ r().symbols.ImageDrawRectangleRecW(dst, rec.x, rec.y, rec.width, rec.height, color);
2690
+ }
2691
+ static imageDrawRectangleLines(dst: Image, rec: Rectangle, thick: number, color: Color): void {
2692
+ r().symbols.ImageDrawRectangleLinesW(dst, rec.x, rec.y, rec.width, rec.height, thick, color);
2693
+ }
2694
+ static imageDrawTriangle(dst: Image, v1: Vec2, v2: Vec2, v3: Vec2, color: Color): void {
2695
+ r().symbols.ImageDrawTriangleW(dst, v1.x, v1.y, v2.x, v2.y, v3.x, v3.y, color);
2696
+ }
2697
+ static imageDrawTriangleEx(
2698
+ dst: Image,
2699
+ v1: Vec2,
2700
+ v2: Vec2,
2701
+ v3: Vec2,
2702
+ c1: Color,
2703
+ c2: Color,
2704
+ c3: Color,
2705
+ ): void {
2706
+ r().symbols.ImageDrawTriangleExW(dst, v1.x, v1.y, v2.x, v2.y, v3.x, v3.y, c1, c2, c3);
2707
+ }
2708
+ static imageDrawTriangleLines(dst: Image, v1: Vec2, v2: Vec2, v3: Vec2, color: Color): void {
2709
+ r().symbols.ImageDrawTriangleLinesW(dst, v1.x, v1.y, v2.x, v2.y, v3.x, v3.y, color);
2710
+ }
2711
+ static imageDrawTriangleFan(dst: Image, points: Float32Array, color: Color): void {
2712
+ r().symbols.ImageDrawTriangleFanW(dst, points, points.length / 2, color);
2713
+ }
2714
+ static imageDrawTriangleStrip(dst: Image, points: Float32Array, color: Color): void {
2715
+ r().symbols.ImageDrawTriangleStripW(dst, points, points.length / 2, color);
2716
+ }
2717
+ static imageDraw(
2718
+ dst: Image,
2719
+ src: Image,
2720
+ srcRec: Rectangle,
2721
+ dstRec: Rectangle,
2722
+ tint: Color,
2723
+ ): void {
2724
+ r().symbols.ImageDrawW(
2725
+ dst,
2726
+ src,
2727
+ srcRec.x,
2728
+ srcRec.y,
2729
+ srcRec.width,
2730
+ srcRec.height,
2731
+ dstRec.x,
2732
+ dstRec.y,
2733
+ dstRec.width,
2734
+ dstRec.height,
2735
+ tint,
2736
+ );
2737
+ }
2738
+ static imageDrawText(
2739
+ dst: Image,
2740
+ text: string,
2741
+ posX: number,
2742
+ posY: number,
2743
+ fontSize: number,
2744
+ color: Color,
2745
+ ): void {
2746
+ r().symbols.ImageDrawTextW(dst, cstr(text), posX, posY, fontSize, color);
2747
+ }
2748
+ static imageDrawTextEx(
2749
+ dst: Image,
2750
+ font: Font,
2751
+ text: string,
2752
+ position: Vec2,
2753
+ fontSize: number,
2754
+ spacing: number,
2755
+ tint: Color,
2756
+ ): void {
2757
+ r().symbols.ImageDrawTextExW(
2758
+ dst,
2759
+ font,
2760
+ cstr(text),
2761
+ position.x,
2762
+ position.y,
2763
+ fontSize,
2764
+ f2i(spacing),
2765
+ tint,
2766
+ );
2767
+ }
2768
+
2769
+ // --- Texture extensions ---
2770
+
2771
+ static loadTextureFromImage(image: Image): Texture2D {
2772
+ r().symbols.LoadTextureFromImageW(this._texOutId, this._texOutW, this._texOutH, image);
2773
+ return { id: this._texOutId[0]!, width: this._texOutW[0]!, height: this._texOutH[0]! };
2774
+ }
2775
+
2776
+ static loadTextureCubemap(image: Image, layout: number): Texture2D {
2777
+ r().symbols.LoadTextureCubemapW(this._texOutId, this._texOutW, this._texOutH, image, layout);
2778
+ return { id: this._texOutId[0]!, width: this._texOutW[0]!, height: this._texOutH[0]! };
2779
+ }
2780
+
2781
+ static updateTexture(texture: Texture2D, pixels: Uint8Array): void {
2782
+ r().symbols.UpdateTextureW(texture.id, texture.width, texture.height, pixels);
2783
+ }
2784
+
2785
+ static updateTextureRec(texture: Texture2D, rec: Rectangle, pixels: Uint8Array): void {
2786
+ r().symbols.UpdateTextureRecW(
2787
+ texture.id,
2788
+ texture.width,
2789
+ texture.height,
2790
+ rec.x,
2791
+ rec.y,
2792
+ rec.width,
2793
+ rec.height,
2794
+ pixels,
2795
+ );
2796
+ }
2797
+
2798
+ static drawTextureNPatch(
2799
+ texture: Texture2D,
2800
+ nPatchInfo: {
2801
+ source: Rectangle;
2802
+ left: number;
2803
+ top: number;
2804
+ right: number;
2805
+ bottom: number;
2806
+ layout: number;
2807
+ },
2808
+ dest: Rectangle,
2809
+ origin: Vec2,
2810
+ rotation: number,
2811
+ tint: Color,
2812
+ ): void {
2813
+ r().symbols.DrawTextureNPatchW(
2814
+ texture.id,
2815
+ texture.width,
2816
+ texture.height,
2817
+ nPatchInfo.source.x,
2818
+ nPatchInfo.source.y,
2819
+ nPatchInfo.source.width,
2820
+ nPatchInfo.source.height,
2821
+ nPatchInfo.left,
2822
+ nPatchInfo.top,
2823
+ nPatchInfo.right,
2824
+ nPatchInfo.bottom,
2825
+ nPatchInfo.layout,
2826
+ dest.x,
2827
+ dest.y,
2828
+ dest.width,
2829
+ dest.height,
2830
+ origin.x,
2831
+ origin.y,
2832
+ f2i(rotation),
2833
+ tint,
2834
+ );
2835
+ }
2836
+
2837
+ static getPixelColor(srcPtr: number, format: number): Color {
2838
+ return r().symbols.GetPixelColorW(srcPtr as any, format);
2839
+ }
2840
+ static setPixelColor(dstPtr: number, color: Color, format: number): void {
2841
+ r().symbols.SetPixelColorW(dstPtr as any, color, format);
2842
+ }
2843
+
2844
+ static drawBoundingBox(box: BoundingBox, color: Color): void {
2845
+ r().symbols.DrawBoundingBoxW(
2846
+ f2i(box.min.x),
2847
+ f2i(box.min.y),
2848
+ f2i(box.min.z),
2849
+ f2i(box.max.x),
2850
+ f2i(box.max.y),
2851
+ f2i(box.max.z),
2852
+ color,
2853
+ );
2854
+ }
2855
+
2856
+ static drawBillboard(
2857
+ camera: Camera3D,
2858
+ texture: Texture2D,
2859
+ position: Vec3,
2860
+ scale: number,
2861
+ tint: Color,
2862
+ ): void {
2863
+ r().symbols.DrawBillboardW(
2864
+ f2i(camera.position.x),
2865
+ f2i(camera.position.y),
2866
+ f2i(camera.position.z),
2867
+ f2i(camera.target.x),
2868
+ f2i(camera.target.y),
2869
+ f2i(camera.target.z),
2870
+ f2i(camera.up.x),
2871
+ f2i(camera.up.y),
2872
+ f2i(camera.up.z),
2873
+ f2i(camera.fovy),
2874
+ camera.projection,
2875
+ texture.id,
2876
+ texture.width,
2877
+ texture.height,
2878
+ f2i(position.x),
2879
+ f2i(position.y),
2880
+ f2i(position.z),
2881
+ f2i(scale),
2882
+ tint,
2883
+ );
2884
+ }
2885
+
2886
+ static drawBillboardRec(
2887
+ camera: Camera3D,
2888
+ texture: Texture2D,
2889
+ source: Rectangle,
2890
+ position: Vec3,
2891
+ size: Vec2,
2892
+ tint: Color,
2893
+ ): void {
2894
+ r().symbols.DrawBillboardRecW(
2895
+ f2i(camera.position.x),
2896
+ f2i(camera.position.y),
2897
+ f2i(camera.position.z),
2898
+ f2i(camera.target.x),
2899
+ f2i(camera.target.y),
2900
+ f2i(camera.target.z),
2901
+ f2i(camera.up.x),
2902
+ f2i(camera.up.y),
2903
+ f2i(camera.up.z),
2904
+ f2i(camera.fovy),
2905
+ camera.projection,
2906
+ texture.id,
2907
+ texture.width,
2908
+ texture.height,
2909
+ source.x,
2910
+ source.y,
2911
+ source.width,
2912
+ source.height,
2913
+ f2i(position.x),
2914
+ f2i(position.y),
2915
+ f2i(position.z),
2916
+ f2i(size.x),
2917
+ f2i(size.y),
2918
+ tint,
2919
+ );
2920
+ }
2921
+
2922
+ static drawBillboardPro(
2923
+ camera: Camera3D,
2924
+ texture: Texture2D,
2925
+ source: Rectangle,
2926
+ position: Vec3,
2927
+ up: Vec3,
2928
+ size: Vec2,
2929
+ origin: Vec2,
2930
+ rotation: number,
2931
+ tint: Color,
2932
+ ): void {
2933
+ r().symbols.DrawBillboardProW(
2934
+ f2i(camera.position.x),
2935
+ f2i(camera.position.y),
2936
+ f2i(camera.position.z),
2937
+ f2i(camera.target.x),
2938
+ f2i(camera.target.y),
2939
+ f2i(camera.target.z),
2940
+ f2i(camera.up.x),
2941
+ f2i(camera.up.y),
2942
+ f2i(camera.up.z),
2943
+ f2i(camera.fovy),
2944
+ camera.projection,
2945
+ texture.id,
2946
+ texture.width,
2947
+ texture.height,
2948
+ source.x,
2949
+ source.y,
2950
+ source.width,
2951
+ source.height,
2952
+ f2i(position.x),
2953
+ f2i(position.y),
2954
+ f2i(position.z),
2955
+ f2i(up.x),
2956
+ f2i(up.y),
2957
+ f2i(up.z),
2958
+ f2i(size.x),
2959
+ f2i(size.y),
2960
+ f2i(origin.x),
2961
+ f2i(origin.y),
2962
+ f2i(rotation),
2963
+ tint,
2964
+ );
2965
+ }
2966
+
2967
+ // --- Model from mesh ---
2968
+
2969
+ static loadModelFromMesh(mesh: Mesh): Model {
2970
+ return r().symbols.LoadModelFromMeshW(mesh);
2971
+ }
2972
+
2973
+ // --- Mesh management ---
2974
+
2975
+ static unloadMesh(mesh: Mesh): void {
2976
+ r().symbols.UnloadMeshW(mesh);
2977
+ }
2978
+ static uploadMesh(mesh: Mesh, dynamic: boolean): void {
2979
+ r().symbols.UploadMeshW(mesh, dynamic);
2980
+ }
2981
+
2982
+ static getMeshBoundingBox(mesh: Mesh): BoundingBox {
2983
+ r().symbols.GetMeshBoundingBoxW(this._bbMin, this._bbMax, mesh);
2984
+ return {
2985
+ min: { x: this._bbMin[0]!, y: this._bbMin[1]!, z: this._bbMin[2]! },
2986
+ max: { x: this._bbMax[0]!, y: this._bbMax[1]!, z: this._bbMax[2]! },
2987
+ };
2988
+ }
2989
+
2990
+ static genMeshTangents(mesh: Mesh): void {
2991
+ r().symbols.GenMeshTangentsW(mesh);
2992
+ }
2993
+ static exportMesh(mesh: Mesh, fileName: string): boolean {
2994
+ return r().symbols.ExportMeshW(mesh, cstr(fileName));
2995
+ }
2996
+ static exportMeshAsCode(mesh: Mesh, fileName: string): boolean {
2997
+ return r().symbols.ExportMeshAsCodeW(mesh, cstr(fileName));
2998
+ }
2999
+
3000
+ // --- Mesh generation ---
3001
+
3002
+ static genMeshPoly(sides: number, radius: number): Mesh {
3003
+ return r().symbols.GenMeshPolyW(sides, f2i(radius));
3004
+ }
3005
+ static genMeshPlane(width: number, length: number, resX: number, resZ: number): Mesh {
3006
+ return r().symbols.GenMeshPlaneW(f2i(width), f2i(length), resX, resZ);
3007
+ }
3008
+ static genMeshCube(width: number, height: number, length: number): Mesh {
3009
+ return r().symbols.GenMeshCubeW(f2i(width), f2i(height), f2i(length));
3010
+ }
3011
+ static genMeshSphere(radius: number, rings: number, slices: number): Mesh {
3012
+ return r().symbols.GenMeshSphereW(f2i(radius), rings, slices);
3013
+ }
3014
+ static genMeshHemiSphere(radius: number, rings: number, slices: number): Mesh {
3015
+ return r().symbols.GenMeshHemiSphereW(f2i(radius), rings, slices);
3016
+ }
3017
+ static genMeshCylinder(radius: number, height: number, slices: number): Mesh {
3018
+ return r().symbols.GenMeshCylinderW(f2i(radius), f2i(height), slices);
3019
+ }
3020
+ static genMeshCone(radius: number, height: number, slices: number): Mesh {
3021
+ return r().symbols.GenMeshConeW(f2i(radius), f2i(height), slices);
3022
+ }
3023
+ static genMeshTorus(radius: number, size: number, radSeg: number, sides: number): Mesh {
3024
+ return r().symbols.GenMeshTorusW(f2i(radius), f2i(size), radSeg, sides);
3025
+ }
3026
+ static genMeshKnot(radius: number, size: number, radSeg: number, sides: number): Mesh {
3027
+ return r().symbols.GenMeshKnotW(f2i(radius), f2i(size), radSeg, sides);
3028
+ }
3029
+ static genMeshHeightmap(heightmap: Image, size: Vec3): Mesh {
3030
+ return r().symbols.GenMeshHeightmapW(heightmap, f2i(size.x), f2i(size.y), f2i(size.z));
3031
+ }
3032
+ static genMeshCubicmap(cubicmap: Image, cubeSize: Vec3): Mesh {
3033
+ return r().symbols.GenMeshCubicmapW(
3034
+ cubicmap,
3035
+ f2i(cubeSize.x),
3036
+ f2i(cubeSize.y),
3037
+ f2i(cubeSize.z),
3038
+ );
3039
+ }
3040
+
3041
+ // --- Material management ---
3042
+
3043
+ static loadMaterialDefault(): Material {
3044
+ return r().symbols.LoadMaterialDefaultW();
3045
+ }
3046
+ static isMaterialValid(material: Material): boolean {
3047
+ return r().symbols.IsMaterialValidW(material);
3048
+ }
3049
+ static unloadMaterial(material: Material): void {
3050
+ r().symbols.UnloadMaterialW(material);
3051
+ }
3052
+ static setMaterialTexture(material: Material, mapType: number, texture: Texture2D): void {
3053
+ r().symbols.SetMaterialTextureW(material, mapType, texture.id, texture.width, texture.height);
3054
+ }
3055
+ static setModelMeshMaterial(model: Model, meshId: number, materialId: number): void {
3056
+ r().symbols.SetModelMeshMaterialW(model, meshId, materialId);
3057
+ }
3058
+
3059
+ // --- Model animations ---
3060
+
3061
+ static loadModelAnimations(fileName: string): { startSlot: number; count: number } {
3062
+ r().symbols.LoadModelAnimationsW(this._animSlotStart, this._animCount, cstr(fileName));
3063
+ return { startSlot: this._animSlotStart[0]!, count: this._animCount[0]! };
3064
+ }
3065
+
3066
+ static updateModelAnimation(model: Model, anim: ModelAnimation, frame: number): void {
3067
+ r().symbols.UpdateModelAnimationW(model, anim, f2i(frame));
3068
+ }
3069
+ static updateModelAnimationEx(
3070
+ model: Model,
3071
+ animA: ModelAnimation,
3072
+ frameA: number,
3073
+ animB: ModelAnimation,
3074
+ frameB: number,
3075
+ blend: number,
3076
+ ): void {
3077
+ r().symbols.UpdateModelAnimationExW(model, animA, f2i(frameA), animB, f2i(frameB), f2i(blend));
3078
+ }
3079
+ static unloadModelAnimations(startSlot: number, count: number): void {
3080
+ r().symbols.UnloadModelAnimationsW(startSlot, count);
3081
+ }
3082
+ static isModelAnimationValid(model: Model, anim: ModelAnimation): boolean {
3083
+ return r().symbols.IsModelAnimationValidW(model, anim);
3084
+ }
3085
+
3086
+ // --- Collision detection ---
3087
+
3088
+ static checkCollisionSpheres(
3089
+ center1: Vec3,
3090
+ radius1: number,
3091
+ center2: Vec3,
3092
+ radius2: number,
3093
+ ): boolean {
3094
+ return r().symbols.CheckCollisionSpheresW(
3095
+ f2i(center1.x),
3096
+ f2i(center1.y),
3097
+ f2i(center1.z),
3098
+ f2i(radius1),
3099
+ f2i(center2.x),
3100
+ f2i(center2.y),
3101
+ f2i(center2.z),
3102
+ f2i(radius2),
3103
+ );
3104
+ }
3105
+
3106
+ static checkCollisionBoxes(box1: BoundingBox, box2: BoundingBox): boolean {
3107
+ return r().symbols.CheckCollisionBoxesW(
3108
+ f2i(box1.min.x),
3109
+ f2i(box1.min.y),
3110
+ f2i(box1.min.z),
3111
+ f2i(box1.max.x),
3112
+ f2i(box1.max.y),
3113
+ f2i(box1.max.z),
3114
+ f2i(box2.min.x),
3115
+ f2i(box2.min.y),
3116
+ f2i(box2.min.z),
3117
+ f2i(box2.max.x),
3118
+ f2i(box2.max.y),
3119
+ f2i(box2.max.z),
3120
+ );
3121
+ }
3122
+
3123
+ static checkCollisionBoxSphere(box: BoundingBox, center: Vec3, radius: number): boolean {
3124
+ return r().symbols.CheckCollisionBoxSphereW(
3125
+ f2i(box.min.x),
3126
+ f2i(box.min.y),
3127
+ f2i(box.min.z),
3128
+ f2i(box.max.x),
3129
+ f2i(box.max.y),
3130
+ f2i(box.max.z),
3131
+ f2i(center.x),
3132
+ f2i(center.y),
3133
+ f2i(center.z),
3134
+ f2i(radius),
3135
+ );
3136
+ }
3137
+ static getRayCollisionSphere(ray: Ray, center: Vec3, radius: number): RayCollision {
3138
+ r().symbols.GetRayCollisionSphereW(
3139
+ this._rcHit,
3140
+ this._rcDist,
3141
+ this._rcPt,
3142
+ this._rcNorm,
3143
+ f2i(ray.position.x),
3144
+ f2i(ray.position.y),
3145
+ f2i(ray.position.z),
3146
+ f2i(ray.direction.x),
3147
+ f2i(ray.direction.y),
3148
+ f2i(ray.direction.z),
3149
+ f2i(center.x),
3150
+ f2i(center.y),
3151
+ f2i(center.z),
3152
+ f2i(radius),
3153
+ );
3154
+ return {
3155
+ hit: this._rcHit[0]! !== 0,
3156
+ distance: this._rcDist[0]!,
3157
+ point: { x: this._rcPt[0]!, y: this._rcPt[1]!, z: this._rcPt[2]! },
3158
+ normal: { x: this._rcNorm[0]!, y: this._rcNorm[1]!, z: this._rcNorm[2]! },
3159
+ };
3160
+ }
3161
+
3162
+ static getRayCollisionBox(ray: Ray, box: BoundingBox): RayCollision {
3163
+ r().symbols.GetRayCollisionBoxW(
3164
+ this._rcHit,
3165
+ this._rcDist,
3166
+ this._rcPt,
3167
+ this._rcNorm,
3168
+ f2i(ray.position.x),
3169
+ f2i(ray.position.y),
3170
+ f2i(ray.position.z),
3171
+ f2i(ray.direction.x),
3172
+ f2i(ray.direction.y),
3173
+ f2i(ray.direction.z),
3174
+ f2i(box.min.x),
3175
+ f2i(box.min.y),
3176
+ f2i(box.min.z),
3177
+ f2i(box.max.x),
3178
+ f2i(box.max.y),
3179
+ f2i(box.max.z),
3180
+ );
3181
+ return {
3182
+ hit: this._rcHit[0]! !== 0,
3183
+ distance: this._rcDist[0]!,
3184
+ point: { x: this._rcPt[0]!, y: this._rcPt[1]!, z: this._rcPt[2]! },
3185
+ normal: { x: this._rcNorm[0]!, y: this._rcNorm[1]!, z: this._rcNorm[2]! },
3186
+ };
3187
+ }
3188
+
3189
+ static getRayCollisionTriangle(ray: Ray, p1: Vec3, p2: Vec3, p3: Vec3): RayCollision {
3190
+ r().symbols.GetRayCollisionTriangleW(
3191
+ this._rcHit,
3192
+ this._rcDist,
3193
+ this._rcPt,
3194
+ this._rcNorm,
3195
+ f2i(ray.position.x),
3196
+ f2i(ray.position.y),
3197
+ f2i(ray.position.z),
3198
+ f2i(ray.direction.x),
3199
+ f2i(ray.direction.y),
3200
+ f2i(ray.direction.z),
3201
+ f2i(p1.x),
3202
+ f2i(p1.y),
3203
+ f2i(p1.z),
3204
+ f2i(p2.x),
3205
+ f2i(p2.y),
3206
+ f2i(p2.z),
3207
+ f2i(p3.x),
3208
+ f2i(p3.y),
3209
+ f2i(p3.z),
3210
+ );
3211
+ return {
3212
+ hit: this._rcHit[0]! !== 0,
3213
+ distance: this._rcDist[0]!,
3214
+ point: { x: this._rcPt[0]!, y: this._rcPt[1]!, z: this._rcPt[2]! },
3215
+ normal: { x: this._rcNorm[0]!, y: this._rcNorm[1]!, z: this._rcNorm[2]! },
3216
+ };
3217
+ }
3218
+
3219
+ static getRayCollisionQuad(ray: Ray, p1: Vec3, p2: Vec3, p3: Vec3, p4: Vec3): RayCollision {
3220
+ r().symbols.GetRayCollisionQuadW(
3221
+ this._rcHit,
3222
+ this._rcDist,
3223
+ this._rcPt,
3224
+ this._rcNorm,
3225
+ f2i(ray.position.x),
3226
+ f2i(ray.position.y),
3227
+ f2i(ray.position.z),
3228
+ f2i(ray.direction.x),
3229
+ f2i(ray.direction.y),
3230
+ f2i(ray.direction.z),
3231
+ f2i(p1.x),
3232
+ f2i(p1.y),
3233
+ f2i(p1.z),
3234
+ f2i(p2.x),
3235
+ f2i(p2.y),
3236
+ f2i(p2.z),
3237
+ f2i(p3.x),
3238
+ f2i(p3.y),
3239
+ f2i(p3.z),
3240
+ f2i(p4.x),
3241
+ f2i(p4.y),
3242
+ f2i(p4.z),
3243
+ );
3244
+ return {
3245
+ hit: this._rcHit[0]! !== 0,
3246
+ distance: this._rcDist[0]!,
3247
+ point: { x: this._rcPt[0]!, y: this._rcPt[1]!, z: this._rcPt[2]! },
3248
+ normal: { x: this._rcNorm[0]!, y: this._rcNorm[1]!, z: this._rcNorm[2]! },
3249
+ };
3250
+ }
3251
+
3252
+ // --- Audio device ---
3253
+
3254
+ static initAudioDevice(): void {
3255
+ r().symbols.InitAudioDeviceW();
3256
+ }
3257
+ static closeAudioDevice(): void {
3258
+ r().symbols.CloseAudioDeviceW();
3259
+ }
3260
+ static isAudioDeviceReady(): boolean {
3261
+ return r().symbols.IsAudioDeviceReadyW();
3262
+ }
3263
+ static setMasterVolume(volume: number): void {
3264
+ r().symbols.SetMasterVolumeW(f2i(volume));
3265
+ }
3266
+ static getMasterVolume(): number {
3267
+ return i2f(r().symbols.GetMasterVolumeW());
3268
+ }
3269
+
3270
+ // --- Wave ---
3271
+
3272
+ static loadWave(fileName: string): Wave {
3273
+ return r().symbols.LoadWaveW(cstr(fileName));
3274
+ }
3275
+ static loadWaveFromMemory(fileType: string, fileData: Uint8Array, dataSize: number): Wave {
3276
+ return r().symbols.LoadWaveFromMemoryW(cstr(fileType), fileData, dataSize);
3277
+ }
3278
+ static isWaveValid(wave: Wave): boolean {
3279
+ return r().symbols.IsWaveValidW(wave);
3280
+ }
3281
+ static unloadWave(wave: Wave): void {
3282
+ r().symbols.UnloadWaveW(wave);
3283
+ }
3284
+ static exportWave(wave: Wave, fileName: string): boolean {
3285
+ return r().symbols.ExportWaveW(wave, cstr(fileName));
3286
+ }
3287
+ static exportWaveAsCode(wave: Wave, fileName: string): boolean {
3288
+ return r().symbols.ExportWaveAsCodeW(wave, cstr(fileName));
3289
+ }
3290
+ static waveCopy(wave: Wave): Wave {
3291
+ return r().symbols.WaveCopyW(wave);
3292
+ }
3293
+ static waveCrop(wave: Wave, initFrame: number, finalFrame: number): void {
3294
+ r().symbols.WaveCropW(wave, initFrame, finalFrame);
3295
+ }
3296
+ static waveFormat(wave: Wave, sampleRate: number, sampleSize: number, channels: number): void {
3297
+ r().symbols.WaveFormatW(wave, sampleRate, sampleSize, channels);
3298
+ }
3299
+
3300
+ // --- Sound ---
3301
+
3302
+ static loadSound(fileName: string): Sound {
3303
+ return r().symbols.LoadSoundW(cstr(fileName));
3304
+ }
3305
+ static loadSoundFromWave(wave: Wave): Sound {
3306
+ return r().symbols.LoadSoundFromWaveW(wave);
3307
+ }
3308
+ static loadSoundAlias(source: Sound): Sound {
3309
+ return r().symbols.LoadSoundAliasW(source);
3310
+ }
3311
+ static isSoundValid(sound: Sound): boolean {
3312
+ return r().symbols.IsSoundValidW(sound);
3313
+ }
3314
+ static unloadSound(sound: Sound): void {
3315
+ r().symbols.UnloadSoundW(sound);
3316
+ }
3317
+ static unloadSoundAlias(alias: Sound): void {
3318
+ r().symbols.UnloadSoundAliasW(alias);
3319
+ }
3320
+ static playSound(sound: Sound): void {
3321
+ r().symbols.PlaySoundW(sound);
3322
+ }
3323
+ static stopSound(sound: Sound): void {
3324
+ r().symbols.StopSoundW(sound);
3325
+ }
3326
+ static pauseSound(sound: Sound): void {
3327
+ r().symbols.PauseSoundW(sound);
3328
+ }
3329
+ static resumeSound(sound: Sound): void {
3330
+ r().symbols.ResumeSoundW(sound);
3331
+ }
3332
+ static isSoundPlaying(sound: Sound): boolean {
3333
+ return r().symbols.IsSoundPlayingW(sound);
3334
+ }
3335
+ static setSoundVolume(sound: Sound, volume: number): void {
3336
+ r().symbols.SetSoundVolumeW(sound, f2i(volume));
3337
+ }
3338
+ static setSoundPitch(sound: Sound, pitch: number): void {
3339
+ r().symbols.SetSoundPitchW(sound, f2i(pitch));
3340
+ }
3341
+ static setSoundPan(sound: Sound, pan: number): void {
3342
+ r().symbols.SetSoundPanW(sound, f2i(pan));
3343
+ }
3344
+
3345
+ // --- Music ---
3346
+
3347
+ static loadMusicStream(fileName: string): Music {
3348
+ return r().symbols.LoadMusicStreamW(cstr(fileName));
3349
+ }
3350
+ static loadMusicStreamFromMemory(fileType: string, data: Uint8Array, dataSize: number): Music {
3351
+ return r().symbols.LoadMusicStreamFromMemoryW(cstr(fileType), data, dataSize);
3352
+ }
3353
+ static isMusicValid(music: Music): boolean {
3354
+ return r().symbols.IsMusicValidW(music);
3355
+ }
3356
+ static unloadMusicStream(music: Music): void {
3357
+ r().symbols.UnloadMusicStreamW(music);
3358
+ }
3359
+ static playMusicStream(music: Music): void {
3360
+ r().symbols.PlayMusicStreamW(music);
3361
+ }
3362
+ static isMusicStreamPlaying(music: Music): boolean {
3363
+ return r().symbols.IsMusicStreamPlayingW(music);
3364
+ }
3365
+ static updateMusicStream(music: Music): void {
3366
+ r().symbols.UpdateMusicStreamW(music);
3367
+ }
3368
+ static stopMusicStream(music: Music): void {
3369
+ r().symbols.StopMusicStreamW(music);
3370
+ }
3371
+ static pauseMusicStream(music: Music): void {
3372
+ r().symbols.PauseMusicStreamW(music);
3373
+ }
3374
+ static resumeMusicStream(music: Music): void {
3375
+ r().symbols.ResumeMusicStreamW(music);
3376
+ }
3377
+ static seekMusicStream(music: Music, position: number): void {
3378
+ r().symbols.SeekMusicStreamW(music, f2i(position));
3379
+ }
3380
+ static setMusicVolume(music: Music, volume: number): void {
3381
+ r().symbols.SetMusicVolumeW(music, f2i(volume));
3382
+ }
3383
+ static setMusicPitch(music: Music, pitch: number): void {
3384
+ r().symbols.SetMusicPitchW(music, f2i(pitch));
3385
+ }
3386
+ static setMusicPan(music: Music, pan: number): void {
3387
+ r().symbols.SetMusicPanW(music, f2i(pan));
3388
+ }
3389
+ static getMusicTimeLength(music: Music): number {
3390
+ return i2f(r().symbols.GetMusicTimeLengthW(music));
3391
+ }
3392
+ static getMusicTimePlayed(music: Music): number {
3393
+ return i2f(r().symbols.GetMusicTimePlayedW(music));
3394
+ }
3395
+
3396
+ // --- AudioStream ---
3397
+
3398
+ static loadAudioStream(sampleRate: number, sampleSize: number, channels: number): AudioStream {
3399
+ return r().symbols.LoadAudioStreamW(sampleRate, sampleSize, channels);
3400
+ }
3401
+ static isAudioStreamValid(stream: AudioStream): boolean {
3402
+ return r().symbols.IsAudioStreamValidW(stream);
3403
+ }
3404
+ static unloadAudioStream(stream: AudioStream): void {
3405
+ r().symbols.UnloadAudioStreamW(stream);
3406
+ }
3407
+ static isAudioStreamProcessed(stream: AudioStream): boolean {
3408
+ return r().symbols.IsAudioStreamProcessedW(stream);
3409
+ }
3410
+ static playAudioStream(stream: AudioStream): void {
3411
+ r().symbols.PlayAudioStreamW(stream);
3412
+ }
3413
+ static pauseAudioStream(stream: AudioStream): void {
3414
+ r().symbols.PauseAudioStreamW(stream);
3415
+ }
3416
+ static resumeAudioStream(stream: AudioStream): void {
3417
+ r().symbols.ResumeAudioStreamW(stream);
3418
+ }
3419
+ static isAudioStreamPlaying(stream: AudioStream): boolean {
3420
+ return r().symbols.IsAudioStreamPlayingW(stream);
3421
+ }
3422
+ static stopAudioStream(stream: AudioStream): void {
3423
+ r().symbols.StopAudioStreamW(stream);
3424
+ }
3425
+ static setAudioStreamVolume(stream: AudioStream, volume: number): void {
3426
+ r().symbols.SetAudioStreamVolumeW(stream, f2i(volume));
3427
+ }
3428
+ static setAudioStreamPitch(stream: AudioStream, pitch: number): void {
3429
+ r().symbols.SetAudioStreamPitchW(stream, f2i(pitch));
3430
+ }
3431
+ static setAudioStreamPan(stream: AudioStream, pan: number): void {
3432
+ r().symbols.SetAudioStreamPanW(stream, f2i(pan));
3433
+ }
3434
+ static setAudioStreamBufferSizeDefault(size: number): void {
3435
+ r().symbols.SetAudioStreamBufferSizeDefaultW(size);
3436
+ }
3437
+
3438
+ // --- Font/Text remaining ---
3439
+
3440
+ static loadFontFromImage(image: Image, key: Color, firstChar: number): Font {
3441
+ return r().symbols.LoadFontFromImageW(image, key, firstChar);
3442
+ }
3443
+ static loadFontFromMemory(
3444
+ fileType: string,
3445
+ fileData: Uint8Array,
3446
+ dataSize: number,
3447
+ fontSize: number,
3448
+ ): Font {
3449
+ return r().symbols.LoadFontFromMemoryW(cstr(fileType), fileData, dataSize, fontSize);
3450
+ }
3451
+ static exportFontAsCode(font: Font, fileName: string): boolean {
3452
+ return r().symbols.ExportFontAsCodeW(font, cstr(fileName));
3453
+ }
3454
+ static drawTextCodepoint(
3455
+ font: Font,
3456
+ codepoint: number,
3457
+ position: Vec2,
3458
+ fontSize: number,
3459
+ tint: Color,
3460
+ ): void {
3461
+ r().symbols.DrawTextCodepointW(font, codepoint, position.x, position.y, f2i(fontSize), tint);
3462
+ }
3463
+ static drawTextCodepoints(
3464
+ font: Font,
3465
+ codepoints: Int32Array,
3466
+ count: number,
3467
+ position: Vec2,
3468
+ fontSize: number,
3469
+ spacing: number,
3470
+ tint: Color,
3471
+ ): void {
3472
+ r().symbols.DrawTextCodepointsW(
3473
+ font,
3474
+ codepoints,
3475
+ count,
3476
+ position.x,
3477
+ position.y,
3478
+ f2i(fontSize),
3479
+ f2i(spacing),
3480
+ tint,
3481
+ );
3482
+ }
3483
+ static getGlyphIndex(font: Font, codepoint: number): number {
3484
+ return r().symbols.GetGlyphIndexW(font, codepoint);
3485
+ }
3486
+
3487
+ private static _glyphValue = new Int32Array(1);
3488
+ private static _glyphOffsetX = new Int32Array(1);
3489
+ private static _glyphOffsetY = new Int32Array(1);
3490
+ private static _glyphAdvanceX = new Int32Array(1);
3491
+ private static _glyphImageSlot = new Int32Array(1);
3492
+
3493
+ static getGlyphInfo(font: Font, codepoint: number): GlyphInfo {
3494
+ r().symbols.GetGlyphInfoW(
3495
+ this._glyphValue,
3496
+ this._glyphOffsetX,
3497
+ this._glyphOffsetY,
3498
+ this._glyphAdvanceX,
3499
+ this._glyphImageSlot,
3500
+ font,
3501
+ codepoint,
3502
+ );
3503
+ return {
3504
+ value: this._glyphValue[0]!,
3505
+ offsetX: this._glyphOffsetX[0]!,
3506
+ offsetY: this._glyphOffsetY[0]!,
3507
+ advanceX: this._glyphAdvanceX[0]!,
3508
+ image: this._glyphImageSlot[0]!,
3509
+ };
3510
+ }
3511
+
3512
+ static getGlyphAtlasRec(font: Font, codepoint: number): Rectangle {
3513
+ r().symbols.GetGlyphAtlasRecW(_recBuf, font, codepoint);
3514
+ return { x: _recBuf[0]!, y: _recBuf[1]!, width: _recBuf[2]!, height: _recBuf[3]! };
3515
+ }
3516
+
3517
+ private static _cpSize = new Int32Array(1);
3518
+
3519
+ static getCodepoint(text: string): { codepoint: number; size: number } {
3520
+ const cp = r().symbols.GetCodepointW(cstr(text), this._cpSize);
3521
+ return { codepoint: cp, size: this._cpSize[0]! };
3522
+ }
3523
+
3524
+ static getCodepointNext(text: string): { codepoint: number; size: number } {
3525
+ const cp = r().symbols.GetCodepointNextW(cstr(text), this._cpSize);
3526
+ return { codepoint: cp, size: this._cpSize[0]! };
3527
+ }
3528
+
3529
+ static getCodepointPrevious(text: string): { codepoint: number; size: number } {
3530
+ const cp = r().symbols.GetCodepointPreviousW(cstr(text), this._cpSize);
3531
+ return { codepoint: cp, size: this._cpSize[0]! };
3532
+ }
3533
+
3534
+ static getCodepointCount(text: string): number {
3535
+ return r().symbols.GetCodepointCountW(cstr(text));
3536
+ }
3537
+ static textIsEqual(text1: string, text2: string): boolean {
3538
+ return r().symbols.TextIsEqualW(cstr(text1), cstr(text2));
3539
+ }
3540
+ static textLength(text: string): number {
3541
+ return r().symbols.TextLengthW(cstr(text));
3542
+ }
3543
+ static textToInteger(text: string): number {
3544
+ return r().symbols.TextToIntegerW(cstr(text));
3545
+ }
3546
+ static textToFloat(text: string): number {
3547
+ return r().symbols.TextToFloatW(cstr(text));
3548
+ }
3549
+ static textFindIndex(text: string, find: string): number {
3550
+ return r().symbols.TextFindIndexW(cstr(text), cstr(find));
3551
+ }
3552
+
3553
+ static imageToPOT(image: Image, fill: number): void {
3554
+ r().symbols.ImageToPOTW(image, fill);
3555
+ }
3556
+
3557
+ static imageKernelConvolution(image: Image, kernel: Float32Array): void {
3558
+ r().symbols.ImageKernelConvolutionW(image, kernel, kernel.length);
3559
+ }
3560
+
3561
+ static unloadImageColors(ptr: number): void {
3562
+ r().symbols.UnloadImageColorsW(ptr as any);
3563
+ }
3564
+ static unloadImagePalette(ptr: number): void {
3565
+ r().symbols.UnloadImagePaletteW(ptr as any);
3566
+ }
3567
+
3568
+ static loadImageAnimFromMemory(
3569
+ fileType: string,
3570
+ data: Buffer | Uint8Array,
3571
+ frames?: Int32Array,
3572
+ ): Image {
3573
+ return r().symbols.LoadImageAnimFromMemoryW(
3574
+ cstr(fileType),
3575
+ data,
3576
+ data.length,
3577
+ frames ?? new Int32Array(1),
3578
+ );
3579
+ }
3580
+
3581
+ static unloadFontData(ptr: number, glyphCount: number): void {
3582
+ r().symbols.UnloadFontDataW(ptr as any, glyphCount);
3583
+ }
3584
+ static unloadUTF8(ptr: number): void {
3585
+ r().symbols.UnloadUTF8W(ptr as any);
3586
+ }
3587
+ static unloadCodepoints(ptr: number): void {
3588
+ r().symbols.UnloadCodepointsW(ptr as any);
3589
+ }
3590
+
3591
+ static textCopy(dst: Uint8Array, src: string): number {
3592
+ return r().symbols.TextCopyW(dst, cstr(src));
3593
+ }
3594
+
3595
+ private static _textAppendPos = new Int32Array(1);
3596
+
3597
+ static textAppend(text: Uint8Array, append: string, position: number): number {
3598
+ this._textAppendPos[0] = position;
3599
+ r().symbols.TextAppendW(text, cstr(append), this._textAppendPos);
3600
+ return this._textAppendPos[0]!;
3601
+ }
3602
+
3603
+ static updateMeshBuffer(
3604
+ mesh: Mesh,
3605
+ index: number,
3606
+ data: Buffer | Uint8Array,
3607
+ offset: number,
3608
+ ): void {
3609
+ r().symbols.UpdateMeshBufferW(mesh, index, data, data.length, offset);
3610
+ }
3611
+
3612
+ static getRayCollisionMesh(
3613
+ ray: Ray,
3614
+ mesh: Mesh,
3615
+ transform: { m: Float32Array } | Float32Array,
3616
+ ): RayCollision {
3617
+ const m = transform instanceof Float32Array ? transform : transform.m;
3618
+ r().symbols.GetRayCollisionMeshW(
3619
+ this._rcHit,
3620
+ this._rcDist,
3621
+ this._rcPt,
3622
+ this._rcNorm,
3623
+ f2i(ray.position.x),
3624
+ f2i(ray.position.y),
3625
+ f2i(ray.position.z),
3626
+ f2i(ray.direction.x),
3627
+ f2i(ray.direction.y),
3628
+ f2i(ray.direction.z),
3629
+ mesh,
3630
+ f2i(m[0]!),
3631
+ f2i(m[4]!),
3632
+ f2i(m[8]!),
3633
+ f2i(m[12]!),
3634
+ f2i(m[1]!),
3635
+ f2i(m[5]!),
3636
+ f2i(m[9]!),
3637
+ f2i(m[13]!),
3638
+ f2i(m[2]!),
3639
+ f2i(m[6]!),
3640
+ f2i(m[10]!),
3641
+ f2i(m[14]!),
3642
+ f2i(m[3]!),
3643
+ f2i(m[7]!),
3644
+ f2i(m[11]!),
3645
+ f2i(m[15]!),
3646
+ );
3647
+ return {
3648
+ hit: this._rcHit[0]! !== 0,
3649
+ distance: this._rcDist[0]!,
3650
+ point: { x: this._rcPt[0]!, y: this._rcPt[1]!, z: this._rcPt[2]! },
3651
+ normal: { x: this._rcNorm[0]!, y: this._rcNorm[1]!, z: this._rcNorm[2]! },
3652
+ };
3653
+ }
3654
+
3655
+ static unloadRandomSequence(ptr: number): void {
3656
+ r().symbols.UnloadRandomSequenceW(ptr as any);
3657
+ }
3658
+ static memFree(ptr: number): void {
3659
+ r().symbols.MemFreeW(ptr as any);
3660
+ }
3661
+ static unloadFileData(ptr: number): void {
3662
+ r().symbols.UnloadFileDataW(ptr as any);
3663
+ }
3664
+ static saveFileData(fileName: string, data: Uint8Array | Buffer): boolean {
3665
+ return r().symbols.SaveFileDataW(cstr(fileName), data, data.length);
3666
+ }
3667
+ static exportDataAsCode(data: Uint8Array | Buffer, fileName: string): boolean {
3668
+ return r().symbols.ExportDataAsCodeW(data, data.length, cstr(fileName));
3669
+ }
3670
+ static loadWaveSamples(wave: Wave): number {
3671
+ return r().symbols.LoadWaveSamplesW(wave) as number;
3672
+ }
3673
+ static unloadWaveSamples(ptr: number): void {
3674
+ r().symbols.UnloadWaveSamplesW(ptr as any);
3675
+ }
3676
+ static setWindowIcons(images: number, count: number): void {
3677
+ r().symbols.SetWindowIconsW(images as any, count);
3678
+ }
3679
+ }