-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
RayLib.hx
3095 lines (2772 loc) · 328 KB
/
RayLib.hx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package;
// Vector2, 2 components
@:include("raylib.h")
@:native("Vector2")
@:structAccess
extern private class RayVector2 {
@:native("x") @:dox(hide) @:noCompletion private var _x:Float; // Vector x component
@:native("y") @:dox(hide) @:noCompletion private var _y:Float; // Vector y component
}
@:include("raylib.h")
@:native("cpp.Reference<Vector2>")
extern class Vector2Ref extends RayVector2 {
public var x(get, set):Float;
private inline function get_x():Float { return _x; }
private inline function set_x(value:Float):Float { _x = value; return value; }
public var y(get, set):Float;
private inline function get_y():Float { return _y; }
private inline function set_y(value:Float):Float { _y = value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Vector2>")
extern class Vector2 extends Vector2Ref {
public static inline function create(x:Float, y:Float):Vector2Ref {
var t:RayVector2 = untyped __cpp__("{ (float){0}, (float){1} }", x, y);
return cast t;
}
public static inline function createEmpty():Vector2Ref {
var t:RayVector2 = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Vector3, 3 components
@:include("raylib.h")
@:native("Vector3")
@:structAccess
extern private class RayVector3 {
@:native("x") @:dox(hide) @:noCompletion private var _x:Float; // Vector x component
@:native("y") @:dox(hide) @:noCompletion private var _y:Float; // Vector y component
@:native("z") @:dox(hide) @:noCompletion private var _z:Float; // Vector z component
}
@:include("raylib.h")
@:native("cpp.Reference<Vector3>")
extern class Vector3Ref extends RayVector3 {
public var x(get, set):Float;
private inline function get_x():Float { return _x; }
private inline function set_x(value:Float):Float { _x = value; return value; }
public var y(get, set):Float;
private inline function get_y():Float { return _y; }
private inline function set_y(value:Float):Float { _y = value; return value; }
public var z(get, set):Float;
private inline function get_z():Float { return _z; }
private inline function set_z(value:Float):Float { _z = value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Vector3>")
extern class Vector3 extends Vector3Ref {
public static inline function create(x:Float, y:Float, z:Float):Vector3Ref {
var t:RayVector3 = untyped __cpp__("{ (float){0}, (float){1}, (float){2} }", x, y, z);
return cast t;
}
public static inline function createEmpty():Vector3Ref {
var t:RayVector3 = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Vector4, 4 components
@:include("raylib.h")
@:native("Vector4")
@:structAccess
extern private class RayVector4 {
@:native("x") @:dox(hide) @:noCompletion private var _x:Float; // Vector x component
@:native("y") @:dox(hide) @:noCompletion private var _y:Float; // Vector y component
@:native("z") @:dox(hide) @:noCompletion private var _z:Float; // Vector z component
@:native("w") @:dox(hide) @:noCompletion private var _w:Float; // Vector w component
}
@:include("raylib.h")
@:native("cpp.Reference<Vector4>")
extern class Vector4Ref extends RayVector4 {
public var x(get, set):Float;
private inline function get_x():Float { return _x; }
private inline function set_x(value:Float):Float { _x = value; return value; }
public var y(get, set):Float;
private inline function get_y():Float { return _y; }
private inline function set_y(value:Float):Float { _y = value; return value; }
public var z(get, set):Float;
private inline function get_z():Float { return _z; }
private inline function set_z(value:Float):Float { _z = value; return value; }
public var w(get, set):Float;
private inline function get_w():Float { return _w; }
private inline function set_w(value:Float):Float { _w = value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Vector4>")
extern class Vector4 extends Vector4Ref {
public static inline function create(x:Float, y:Float, z:Float, w:Float):Vector4Ref {
var t:RayVector4 = untyped __cpp__("{ (float){0}, (float){1}, (float){2}, (float){3} }", x, y, z, w);
return cast t;
}
public static inline function createEmpty():Vector4Ref {
var t:RayVector4 = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Matrix, 4x4 components, column major, OpenGL style, right handed
@:include("raylib.h")
@:native("Matrix")
@:structAccess
extern private class RayMatrix {
@:native("m0") @:dox(hide) @:noCompletion private var _m0:Float; // Matrix first row (4 components)
@:native("m4") @:dox(hide) @:noCompletion private var _m4:Float; // Matrix first row (4 components)
@:native("m8") @:dox(hide) @:noCompletion private var _m8:Float; // Matrix first row (4 components)
@:native("m12") @:dox(hide) @:noCompletion private var _m12:Float; // Matrix first row (4 components)
@:native("m1") @:dox(hide) @:noCompletion private var _m1:Float; // Matrix second row (4 components)
@:native("m5") @:dox(hide) @:noCompletion private var _m5:Float; // Matrix second row (4 components)
@:native("m9") @:dox(hide) @:noCompletion private var _m9:Float; // Matrix second row (4 components)
@:native("m13") @:dox(hide) @:noCompletion private var _m13:Float; // Matrix second row (4 components)
@:native("m2") @:dox(hide) @:noCompletion private var _m2:Float; // Matrix third row (4 components)
@:native("m6") @:dox(hide) @:noCompletion private var _m6:Float; // Matrix third row (4 components)
@:native("m10") @:dox(hide) @:noCompletion private var _m10:Float; // Matrix third row (4 components)
@:native("m14") @:dox(hide) @:noCompletion private var _m14:Float; // Matrix third row (4 components)
@:native("m3") @:dox(hide) @:noCompletion private var _m3:Float; // Matrix fourth row (4 components)
@:native("m7") @:dox(hide) @:noCompletion private var _m7:Float; // Matrix fourth row (4 components)
@:native("m11") @:dox(hide) @:noCompletion private var _m11:Float; // Matrix fourth row (4 components)
@:native("m15") @:dox(hide) @:noCompletion private var _m15:Float; // Matrix fourth row (4 components)
}
@:include("raylib.h")
@:native("cpp.Reference<Matrix>")
extern class MatrixRef extends RayMatrix {
public var m0(get, set):Float;
private inline function get_m0():Float { return _m0; }
private inline function set_m0(value:Float):Float { _m0 = value; return value; }
public var m4(get, set):Float;
private inline function get_m4():Float { return _m4; }
private inline function set_m4(value:Float):Float { _m4 = value; return value; }
public var m8(get, set):Float;
private inline function get_m8():Float { return _m8; }
private inline function set_m8(value:Float):Float { _m8 = value; return value; }
public var m12(get, set):Float;
private inline function get_m12():Float { return _m12; }
private inline function set_m12(value:Float):Float { _m12 = value; return value; }
public var m1(get, set):Float;
private inline function get_m1():Float { return _m1; }
private inline function set_m1(value:Float):Float { _m1 = value; return value; }
public var m5(get, set):Float;
private inline function get_m5():Float { return _m5; }
private inline function set_m5(value:Float):Float { _m5 = value; return value; }
public var m9(get, set):Float;
private inline function get_m9():Float { return _m9; }
private inline function set_m9(value:Float):Float { _m9 = value; return value; }
public var m13(get, set):Float;
private inline function get_m13():Float { return _m13; }
private inline function set_m13(value:Float):Float { _m13 = value; return value; }
public var m2(get, set):Float;
private inline function get_m2():Float { return _m2; }
private inline function set_m2(value:Float):Float { _m2 = value; return value; }
public var m6(get, set):Float;
private inline function get_m6():Float { return _m6; }
private inline function set_m6(value:Float):Float { _m6 = value; return value; }
public var m10(get, set):Float;
private inline function get_m10():Float { return _m10; }
private inline function set_m10(value:Float):Float { _m10 = value; return value; }
public var m14(get, set):Float;
private inline function get_m14():Float { return _m14; }
private inline function set_m14(value:Float):Float { _m14 = value; return value; }
public var m3(get, set):Float;
private inline function get_m3():Float { return _m3; }
private inline function set_m3(value:Float):Float { _m3 = value; return value; }
public var m7(get, set):Float;
private inline function get_m7():Float { return _m7; }
private inline function set_m7(value:Float):Float { _m7 = value; return value; }
public var m11(get, set):Float;
private inline function get_m11():Float { return _m11; }
private inline function set_m11(value:Float):Float { _m11 = value; return value; }
public var m15(get, set):Float;
private inline function get_m15():Float { return _m15; }
private inline function set_m15(value:Float):Float { _m15 = value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Matrix>")
extern class Matrix extends MatrixRef {
public static inline function create(m0:Float, m4:Float, m8:Float, m12:Float, m1:Float, m5:Float, m9:Float, m13:Float, m2:Float, m6:Float, m10:Float, m14:Float, m3:Float, m7:Float, m11:Float, m15:Float):MatrixRef {
var t:RayMatrix = untyped __cpp__("{ (float){0}, (float){1}, (float){2}, (float){3}, (float){4}, (float){5}, (float){6}, (float){7}, (float){8}, (float){9}, (float){10}, (float){11}, (float){12}, (float){13}, (float){14}, (float){15} }", m0, m4, m8, m12, m1, m5, m9, m13, m2, m6, m10, m14, m3, m7, m11, m15);
return cast t;
}
public static inline function createEmpty():MatrixRef {
var t:RayMatrix = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Color, 4 components, R8G8B8A8 (32bit)
@:include("raylib.h")
@:native("Color")
@:structAccess
extern private class RayColor {
@:native("r") @:dox(hide) @:noCompletion private var _r:cpp.UInt8; // Color red value
@:native("g") @:dox(hide) @:noCompletion private var _g:cpp.UInt8; // Color green value
@:native("b") @:dox(hide) @:noCompletion private var _b:cpp.UInt8; // Color blue value
@:native("a") @:dox(hide) @:noCompletion private var _a:cpp.UInt8; // Color alpha value
}
@:include("raylib.h")
@:native("cpp.Reference<Color>")
extern class ColorRef extends RayColor {
public var r(get, set):cpp.UInt8;
private inline function get_r():cpp.UInt8 { return cast _r; }
private inline function set_r(value:cpp.UInt8):cpp.UInt8 { _r = cast value; return value; }
public var g(get, set):cpp.UInt8;
private inline function get_g():cpp.UInt8 { return cast _g; }
private inline function set_g(value:cpp.UInt8):cpp.UInt8 { _g = cast value; return value; }
public var b(get, set):cpp.UInt8;
private inline function get_b():cpp.UInt8 { return cast _b; }
private inline function set_b(value:cpp.UInt8):cpp.UInt8 { _b = cast value; return value; }
public var a(get, set):cpp.UInt8;
private inline function get_a():cpp.UInt8 { return cast _a; }
private inline function set_a(value:cpp.UInt8):cpp.UInt8 { _a = cast value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Color>")
extern class Color extends ColorRef {
public static inline function create(r:cpp.UInt8, g:cpp.UInt8, b:cpp.UInt8, a:cpp.UInt8):ColorRef {
var t:RayColor = untyped __cpp__("{ (unsigned char){0}, (unsigned char){1}, (unsigned char){2}, (unsigned char){3} }", r, g, b, a);
return cast t;
}
public static inline function createEmpty():ColorRef {
var t:RayColor = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Rectangle, 4 components
@:include("raylib.h")
@:native("Rectangle")
@:structAccess
extern private class RayRectangle {
@:native("x") @:dox(hide) @:noCompletion private var _x:Float; // Rectangle top-left corner position x
@:native("y") @:dox(hide) @:noCompletion private var _y:Float; // Rectangle top-left corner position y
@:native("width") @:dox(hide) @:noCompletion private var _width:Float; // Rectangle width
@:native("height") @:dox(hide) @:noCompletion private var _height:Float; // Rectangle height
}
@:include("raylib.h")
@:native("cpp.Reference<Rectangle>")
extern class RectangleRef extends RayRectangle {
public var x(get, set):Float;
private inline function get_x():Float { return _x; }
private inline function set_x(value:Float):Float { _x = value; return value; }
public var y(get, set):Float;
private inline function get_y():Float { return _y; }
private inline function set_y(value:Float):Float { _y = value; return value; }
public var width(get, set):Float;
private inline function get_width():Float { return _width; }
private inline function set_width(value:Float):Float { _width = value; return value; }
public var height(get, set):Float;
private inline function get_height():Float { return _height; }
private inline function set_height(value:Float):Float { _height = value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Rectangle>")
extern class Rectangle extends RectangleRef {
public static inline function create(x:Float, y:Float, width:Float, height:Float):RectangleRef {
var t:RayRectangle = untyped __cpp__("{ (float){0}, (float){1}, (float){2}, (float){3} }", x, y, width, height);
return cast t;
}
public static inline function createEmpty():RectangleRef {
var t:RayRectangle = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Image, pixel data stored in CPU memory (RAM)
@:include("raylib.h")
@:native("Image")
@:structAccess
extern private class RayImage {
@:native("data") @:dox(hide) @:noCompletion private var _data:cpp.RawPointer<cpp.Void>; // Image raw data
@:native("width") @:dox(hide) @:noCompletion private var _width:Int; // Image base width
@:native("height") @:dox(hide) @:noCompletion private var _height:Int; // Image base height
@:native("mipmaps") @:dox(hide) @:noCompletion private var _mipmaps:Int; // Mipmap levels, 1 by default
@:native("format") @:dox(hide) @:noCompletion private var _format:Int; // Data format (PixelFormat type)
}
@:include("raylib.h")
@:native("cpp.Reference<Image>")
extern class ImageRef extends RayImage {
public var data(get, set):cpp.RawPointer<cpp.Void>;
private inline function get_data():cpp.RawPointer<cpp.Void> { return cast _data; }
private inline function set_data(value:cpp.RawPointer<cpp.Void>):cpp.RawPointer<cpp.Void> { _data = cast value; return value; }
public var width(get, set):Int;
private inline function get_width():Int { return _width; }
private inline function set_width(value:Int):Int { _width = value; return value; }
public var height(get, set):Int;
private inline function get_height():Int { return _height; }
private inline function set_height(value:Int):Int { _height = value; return value; }
public var mipmaps(get, set):Int;
private inline function get_mipmaps():Int { return _mipmaps; }
private inline function set_mipmaps(value:Int):Int { _mipmaps = value; return value; }
public var format(get, set):Int;
private inline function get_format():Int { return _format; }
private inline function set_format(value:Int):Int { _format = value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Image>")
extern class Image extends ImageRef {
public static inline function create(data:cpp.RawPointer<cpp.Void>, width:Int, height:Int, mipmaps:Int, format:Int):ImageRef {
var t:RayImage = untyped __cpp__("{ (void *){0}, (int){1}, (int){2}, (int){3}, (int){4} }", data, width, height, mipmaps, format);
return cast t;
}
public static inline function createEmpty():ImageRef {
var t:RayImage = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Texture alias
typedef TextureCubemap = Texture;
typedef TextureCubemapRef = TextureRef;
typedef RayTextureCubemap = RayTexture;
// Texture alias
typedef Texture2D = Texture;
typedef Texture2DRef = TextureRef;
typedef RayTexture2D = RayTexture;
// Texture, tex data stored in GPU memory (VRAM)
@:include("raylib.h")
@:native("Texture")
@:structAccess
extern private class RayTexture {
@:native("id") @:dox(hide) @:noCompletion private var _id:Int; // OpenGL texture id
@:native("width") @:dox(hide) @:noCompletion private var _width:Int; // Texture base width
@:native("height") @:dox(hide) @:noCompletion private var _height:Int; // Texture base height
@:native("mipmaps") @:dox(hide) @:noCompletion private var _mipmaps:Int; // Mipmap levels, 1 by default
@:native("format") @:dox(hide) @:noCompletion private var _format:Int; // Data format (PixelFormat type)
}
@:include("raylib.h")
@:native("cpp.Reference<Texture>")
extern class TextureRef extends RayTexture {
public var id(get, set):Int;
private inline function get_id():Int { return _id; }
private inline function set_id(value:Int):Int { _id = value; return value; }
public var width(get, set):Int;
private inline function get_width():Int { return _width; }
private inline function set_width(value:Int):Int { _width = value; return value; }
public var height(get, set):Int;
private inline function get_height():Int { return _height; }
private inline function set_height(value:Int):Int { _height = value; return value; }
public var mipmaps(get, set):Int;
private inline function get_mipmaps():Int { return _mipmaps; }
private inline function set_mipmaps(value:Int):Int { _mipmaps = value; return value; }
public var format(get, set):Int;
private inline function get_format():Int { return _format; }
private inline function set_format(value:Int):Int { _format = value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Texture>")
extern class Texture extends TextureRef {
public static inline function create(id:Int, width:Int, height:Int, mipmaps:Int, format:Int):TextureRef {
var t:RayTexture = untyped __cpp__("{ (unsigned int){0}, (int){1}, (int){2}, (int){3}, (int){4} }", id, width, height, mipmaps, format);
return cast t;
}
public static inline function createEmpty():TextureRef {
var t:RayTexture = untyped __cpp__("{ 0 }");
return cast t;
}
}
// RenderTexture alias
typedef RenderTexture2D = RenderTexture;
typedef RenderTexture2DRef = RenderTextureRef;
typedef RayRenderTexture2D = RayRenderTexture;
// RenderTexture, fbo for texture rendering
@:include("raylib.h")
@:native("RenderTexture")
@:structAccess
extern private class RayRenderTexture {
@:native("id") @:dox(hide) @:noCompletion private var _id:Int; // OpenGL framebuffer object id
@:native("texture") @:dox(hide) @:noCompletion private var _texture:RayTexture; // Color buffer attachment texture
@:native("depth") @:dox(hide) @:noCompletion private var _depth:RayTexture; // Depth buffer attachment texture
}
@:include("raylib.h")
@:native("cpp.Reference<RenderTexture>")
extern class RenderTextureRef extends RayRenderTexture {
public var id(get, set):Int;
private inline function get_id():Int { return _id; }
private inline function set_id(value:Int):Int { _id = value; return value; }
public var texture(get, set):TextureRef;
private inline function get_texture():TextureRef { return cast _texture; }
private inline function set_texture(value:TextureRef):TextureRef { _texture = cast value; return value; }
public var depth(get, set):TextureRef;
private inline function get_depth():TextureRef { return cast _depth; }
private inline function set_depth(value:TextureRef):TextureRef { _depth = cast value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<RenderTexture>")
extern class RenderTexture extends RenderTextureRef {
public static inline function create(id:Int, texture:RayTexture, depth:RayTexture):RenderTextureRef {
var t:RayRenderTexture = untyped __cpp__("{ (unsigned int){0}, (Texture){1}, (Texture){2} }", id, texture, depth);
return cast t;
}
public static inline function createEmpty():RenderTextureRef {
var t:RayRenderTexture = untyped __cpp__("{ 0 }");
return cast t;
}
}
// NPatchInfo, n-patch layout info
@:include("raylib.h")
@:native("NPatchInfo")
@:structAccess
extern private class RayNPatchInfo {
@:native("source") @:dox(hide) @:noCompletion private var _source:RayRectangle; // Texture source rectangle
@:native("left") @:dox(hide) @:noCompletion private var _left:Int; // Left border offset
@:native("top") @:dox(hide) @:noCompletion private var _top:Int; // Top border offset
@:native("right") @:dox(hide) @:noCompletion private var _right:Int; // Right border offset
@:native("bottom") @:dox(hide) @:noCompletion private var _bottom:Int; // Bottom border offset
@:native("layout") @:dox(hide) @:noCompletion private var _layout:Int; // Layout of the n-patch: 3x3, 1x3 or 3x1
}
@:include("raylib.h")
@:native("cpp.Reference<NPatchInfo>")
extern class NPatchInfoRef extends RayNPatchInfo {
public var source(get, set):RectangleRef;
private inline function get_source():RectangleRef { return cast _source; }
private inline function set_source(value:RectangleRef):RectangleRef { _source = cast value; return value; }
public var left(get, set):Int;
private inline function get_left():Int { return _left; }
private inline function set_left(value:Int):Int { _left = value; return value; }
public var top(get, set):Int;
private inline function get_top():Int { return _top; }
private inline function set_top(value:Int):Int { _top = value; return value; }
public var right(get, set):Int;
private inline function get_right():Int { return _right; }
private inline function set_right(value:Int):Int { _right = value; return value; }
public var bottom(get, set):Int;
private inline function get_bottom():Int { return _bottom; }
private inline function set_bottom(value:Int):Int { _bottom = value; return value; }
public var layout(get, set):Int;
private inline function get_layout():Int { return _layout; }
private inline function set_layout(value:Int):Int { _layout = value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<NPatchInfo>")
extern class NPatchInfo extends NPatchInfoRef {
public static inline function create(source:RayRectangle, left:Int, top:Int, right:Int, bottom:Int, layout:Int):NPatchInfoRef {
var t:RayNPatchInfo = untyped __cpp__("{ (Rectangle){0}, (int){1}, (int){2}, (int){3}, (int){4}, (int){5} }", source, left, top, right, bottom, layout);
return cast t;
}
public static inline function createEmpty():NPatchInfoRef {
var t:RayNPatchInfo = untyped __cpp__("{ 0 }");
return cast t;
}
}
// GlyphInfo, font characters glyphs info
@:include("raylib.h")
@:native("GlyphInfo")
@:structAccess
extern private class RayGlyphInfo {
@:native("value") @:dox(hide) @:noCompletion private var _value:Int; // Character value (Unicode)
@:native("offsetX") @:dox(hide) @:noCompletion private var _offsetX:Int; // Character offset X when drawing
@:native("offsetY") @:dox(hide) @:noCompletion private var _offsetY:Int; // Character offset Y when drawing
@:native("advanceX") @:dox(hide) @:noCompletion private var _advanceX:Int; // Character advance position X
@:native("image") @:dox(hide) @:noCompletion private var _image:RayImage; // Character image data
}
@:include("raylib.h")
@:native("cpp.Reference<GlyphInfo>")
extern class GlyphInfoRef extends RayGlyphInfo {
public var value(get, set):Int;
private inline function get_value():Int { return _value; }
private inline function set_value(value:Int):Int { _value = value; return value; }
public var offsetX(get, set):Int;
private inline function get_offsetX():Int { return _offsetX; }
private inline function set_offsetX(value:Int):Int { _offsetX = value; return value; }
public var offsetY(get, set):Int;
private inline function get_offsetY():Int { return _offsetY; }
private inline function set_offsetY(value:Int):Int { _offsetY = value; return value; }
public var advanceX(get, set):Int;
private inline function get_advanceX():Int { return _advanceX; }
private inline function set_advanceX(value:Int):Int { _advanceX = value; return value; }
public var image(get, set):ImageRef;
private inline function get_image():ImageRef { return cast _image; }
private inline function set_image(value:ImageRef):ImageRef { _image = cast value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<GlyphInfo>")
extern class GlyphInfo extends GlyphInfoRef {
public static inline function create(value:Int, offsetX:Int, offsetY:Int, advanceX:Int, image:RayImage):GlyphInfoRef {
var t:RayGlyphInfo = untyped __cpp__("{ (int){0}, (int){1}, (int){2}, (int){3}, (Image){4} }", value, offsetX, offsetY, advanceX, image);
return cast t;
}
public static inline function createEmpty():GlyphInfoRef {
var t:RayGlyphInfo = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Font, font texture and GlyphInfo array data
@:include("raylib.h")
@:native("Font")
@:structAccess
extern private class RayFont {
@:native("baseSize") @:dox(hide) @:noCompletion private var _baseSize:Int; // Base size (default chars height)
@:native("glyphCount") @:dox(hide) @:noCompletion private var _glyphCount:Int; // Number of glyph characters
@:native("glyphPadding") @:dox(hide) @:noCompletion private var _glyphPadding:Int; // Padding around the glyph characters
@:native("texture") @:dox(hide) @:noCompletion private var _texture:RayTexture; // Texture atlas containing the glyphs
@:native("recs") @:dox(hide) @:noCompletion private var _recs:cpp.RawPointer<RayRectangle>; // Rectangles in texture for the glyphs
@:native("glyphs") @:dox(hide) @:noCompletion private var _glyphs:cpp.RawPointer<RayGlyphInfo>; // Glyphs info data
}
@:include("raylib.h")
@:native("cpp.Reference<Font>")
extern class FontRef extends RayFont {
public var baseSize(get, set):Int;
private inline function get_baseSize():Int { return _baseSize; }
private inline function set_baseSize(value:Int):Int { _baseSize = value; return value; }
public var glyphCount(get, set):Int;
private inline function get_glyphCount():Int { return _glyphCount; }
private inline function set_glyphCount(value:Int):Int { _glyphCount = value; return value; }
public var glyphPadding(get, set):Int;
private inline function get_glyphPadding():Int { return _glyphPadding; }
private inline function set_glyphPadding(value:Int):Int { _glyphPadding = value; return value; }
public var texture(get, set):Texture2DRef;
private inline function get_texture():Texture2DRef { return cast _texture; }
private inline function set_texture(value:Texture2DRef):Texture2DRef { _texture = cast value; return value; }
public var recs(get, set):cpp.RawPointer<Rectangle>;
private inline function get_recs():cpp.RawPointer<Rectangle> { return cast _recs; }
private inline function set_recs(value:cpp.RawPointer<Rectangle>):cpp.RawPointer<Rectangle> { _recs = cast value; return value; }
public var glyphs(get, set):cpp.RawPointer<GlyphInfo>;
private inline function get_glyphs():cpp.RawPointer<GlyphInfo> { return cast _glyphs; }
private inline function set_glyphs(value:cpp.RawPointer<GlyphInfo>):cpp.RawPointer<GlyphInfo> { _glyphs = cast value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Font>")
extern class Font extends FontRef {
public static inline function create(baseSize:Int, glyphCount:Int, glyphPadding:Int, texture:RayTexture, recs:cpp.RawPointer<RayRectangle>, glyphs:cpp.RawPointer<RayGlyphInfo>):FontRef {
var t:RayFont = untyped __cpp__("{ (int){0}, (int){1}, (int){2}, (Texture2D){3}, (Rectangle *){4}, (GlyphInfo *){5} }", baseSize, glyphCount, glyphPadding, texture, recs, glyphs);
return cast t;
}
public static inline function createEmpty():FontRef {
var t:RayFont = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Camera3D alias
typedef Camera = Camera3D;
typedef CameraRef = Camera3DRef;
typedef RayCamera = RayCamera3D;
// Camera, defines position/orientation in 3d space
@:include("raylib.h")
@:native("Camera3D")
@:structAccess
extern private class RayCamera3D {
@:native("position") @:dox(hide) @:noCompletion private var _position:RayVector3; // Camera position
@:native("target") @:dox(hide) @:noCompletion private var _target:RayVector3; // Camera target it looks-at
@:native("up") @:dox(hide) @:noCompletion private var _up:RayVector3; // Camera up vector (rotation over its axis)
@:native("fovy") @:dox(hide) @:noCompletion private var _fovy:Float; // Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
@:native("projection") @:dox(hide) @:noCompletion private var _projection:Int; // Camera projection: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
}
@:include("raylib.h")
@:native("cpp.Reference<Camera3D>")
extern class Camera3DRef extends RayCamera3D {
public var position(get, set):Vector3Ref;
private inline function get_position():Vector3Ref { return cast _position; }
private inline function set_position(value:Vector3Ref):Vector3Ref { _position = cast value; return value; }
public var target(get, set):Vector3Ref;
private inline function get_target():Vector3Ref { return cast _target; }
private inline function set_target(value:Vector3Ref):Vector3Ref { _target = cast value; return value; }
public var up(get, set):Vector3Ref;
private inline function get_up():Vector3Ref { return cast _up; }
private inline function set_up(value:Vector3Ref):Vector3Ref { _up = cast value; return value; }
public var fovy(get, set):Float;
private inline function get_fovy():Float { return _fovy; }
private inline function set_fovy(value:Float):Float { _fovy = value; return value; }
public var projection(get, set):Int;
private inline function get_projection():Int { return _projection; }
private inline function set_projection(value:Int):Int { _projection = value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Camera3D>")
extern class Camera3D extends Camera3DRef {
public static inline function create(position:RayVector3, target:RayVector3, up:RayVector3, fovy:Float, projection:Int):Camera3DRef {
var t:RayCamera3D = untyped __cpp__("{ (Vector3){0}, (Vector3){1}, (Vector3){2}, (float){3}, (int){4} }", position, target, up, fovy, projection);
return cast t;
}
public static inline function createEmpty():Camera3DRef {
var t:RayCamera3D = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Camera2D, defines position/orientation in 2d space
@:include("raylib.h")
@:native("Camera2D")
@:structAccess
extern private class RayCamera2D {
@:native("offset") @:dox(hide) @:noCompletion private var _offset:RayVector2; // Camera offset (displacement from target)
@:native("target") @:dox(hide) @:noCompletion private var _target:RayVector2; // Camera target (rotation and zoom origin)
@:native("rotation") @:dox(hide) @:noCompletion private var _rotation:Float; // Camera rotation in degrees
@:native("zoom") @:dox(hide) @:noCompletion private var _zoom:Float; // Camera zoom (scaling), should be 1.0f by default
}
@:include("raylib.h")
@:native("cpp.Reference<Camera2D>")
extern class Camera2DRef extends RayCamera2D {
public var offset(get, set):Vector2Ref;
private inline function get_offset():Vector2Ref { return cast _offset; }
private inline function set_offset(value:Vector2Ref):Vector2Ref { _offset = cast value; return value; }
public var target(get, set):Vector2Ref;
private inline function get_target():Vector2Ref { return cast _target; }
private inline function set_target(value:Vector2Ref):Vector2Ref { _target = cast value; return value; }
public var rotation(get, set):Float;
private inline function get_rotation():Float { return _rotation; }
private inline function set_rotation(value:Float):Float { _rotation = value; return value; }
public var zoom(get, set):Float;
private inline function get_zoom():Float { return _zoom; }
private inline function set_zoom(value:Float):Float { _zoom = value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Camera2D>")
extern class Camera2D extends Camera2DRef {
public static inline function create(offset:RayVector2, target:RayVector2, rotation:Float, zoom:Float):Camera2DRef {
var t:RayCamera2D = untyped __cpp__("{ (Vector2){0}, (Vector2){1}, (float){2}, (float){3} }", offset, target, rotation, zoom);
return cast t;
}
public static inline function createEmpty():Camera2DRef {
var t:RayCamera2D = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Mesh, vertex data and vao/vbo
@:include("raylib.h")
@:native("Mesh")
@:structAccess
extern private class RayMesh {
@:native("vertexCount") @:dox(hide) @:noCompletion private var _vertexCount:Int; // Number of vertices stored in arrays
@:native("triangleCount") @:dox(hide) @:noCompletion private var _triangleCount:Int; // Number of triangles stored (indexed or not)
@:native("vertices") @:dox(hide) @:noCompletion private var _vertices:cpp.RawPointer<Float>; // Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
@:native("texcoords") @:dox(hide) @:noCompletion private var _texcoords:cpp.RawPointer<Float>; // Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
@:native("texcoords2") @:dox(hide) @:noCompletion private var _texcoords2:cpp.RawPointer<Float>; // Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)
@:native("normals") @:dox(hide) @:noCompletion private var _normals:cpp.RawPointer<Float>; // Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
@:native("tangents") @:dox(hide) @:noCompletion private var _tangents:cpp.RawPointer<Float>; // Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
@:native("colors") @:dox(hide) @:noCompletion private var _colors:cpp.RawPointer<cpp.UInt8>; // Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
@:native("indices") @:dox(hide) @:noCompletion private var _indices:cpp.RawPointer<Int>; // Vertex indices (in case vertex data comes indexed)
@:native("animVertices") @:dox(hide) @:noCompletion private var _animVertices:cpp.RawPointer<Float>; // Animated vertex positions (after bones transformations)
@:native("animNormals") @:dox(hide) @:noCompletion private var _animNormals:cpp.RawPointer<Float>; // Animated normals (after bones transformations)
@:native("boneIds") @:dox(hide) @:noCompletion private var _boneIds:cpp.RawPointer<cpp.UInt8>; // Vertex bone ids, max 255 bone ids, up to 4 bones influence by vertex (skinning)
@:native("boneWeights") @:dox(hide) @:noCompletion private var _boneWeights:cpp.RawPointer<Float>; // Vertex bone weight, up to 4 bones influence by vertex (skinning)
@:native("vaoId") @:dox(hide) @:noCompletion private var _vaoId:Int; // OpenGL Vertex Array Object id
@:native("vboId") @:dox(hide) @:noCompletion private var _vboId:cpp.RawPointer<cpp.UInt32>; // OpenGL Vertex Buffer Objects id (default vertex data)
}
@:include("raylib.h")
@:native("cpp.Reference<Mesh>")
extern class MeshRef extends RayMesh {
public var vertexCount(get, set):Int;
private inline function get_vertexCount():Int { return _vertexCount; }
private inline function set_vertexCount(value:Int):Int { _vertexCount = value; return value; }
public var triangleCount(get, set):Int;
private inline function get_triangleCount():Int { return _triangleCount; }
private inline function set_triangleCount(value:Int):Int { _triangleCount = value; return value; }
public var vertices(get, set):cpp.RawPointer<Float>;
private inline function get_vertices():cpp.RawPointer<Float> { return cast _vertices; }
private inline function set_vertices(value:cpp.RawPointer<Float>):cpp.RawPointer<Float> { _vertices = cast value; return value; }
public var texcoords(get, set):cpp.RawPointer<Float>;
private inline function get_texcoords():cpp.RawPointer<Float> { return cast _texcoords; }
private inline function set_texcoords(value:cpp.RawPointer<Float>):cpp.RawPointer<Float> { _texcoords = cast value; return value; }
public var texcoords2(get, set):cpp.RawPointer<Float>;
private inline function get_texcoords2():cpp.RawPointer<Float> { return cast _texcoords2; }
private inline function set_texcoords2(value:cpp.RawPointer<Float>):cpp.RawPointer<Float> { _texcoords2 = cast value; return value; }
public var normals(get, set):cpp.RawPointer<Float>;
private inline function get_normals():cpp.RawPointer<Float> { return cast _normals; }
private inline function set_normals(value:cpp.RawPointer<Float>):cpp.RawPointer<Float> { _normals = cast value; return value; }
public var tangents(get, set):cpp.RawPointer<Float>;
private inline function get_tangents():cpp.RawPointer<Float> { return cast _tangents; }
private inline function set_tangents(value:cpp.RawPointer<Float>):cpp.RawPointer<Float> { _tangents = cast value; return value; }
public var colors(get, set):cpp.RawPointer<cpp.UInt8>;
private inline function get_colors():cpp.RawPointer<cpp.UInt8> { return cast _colors; }
private inline function set_colors(value:cpp.RawPointer<cpp.UInt8>):cpp.RawPointer<cpp.UInt8> { _colors = cast value; return value; }
public var indices(get, set):cpp.RawPointer<Int>;
private inline function get_indices():cpp.RawPointer<Int> { return cast _indices; }
private inline function set_indices(value:cpp.RawPointer<Int>):cpp.RawPointer<Int> { _indices = cast value; return value; }
public var animVertices(get, set):cpp.RawPointer<Float>;
private inline function get_animVertices():cpp.RawPointer<Float> { return cast _animVertices; }
private inline function set_animVertices(value:cpp.RawPointer<Float>):cpp.RawPointer<Float> { _animVertices = cast value; return value; }
public var animNormals(get, set):cpp.RawPointer<Float>;
private inline function get_animNormals():cpp.RawPointer<Float> { return cast _animNormals; }
private inline function set_animNormals(value:cpp.RawPointer<Float>):cpp.RawPointer<Float> { _animNormals = cast value; return value; }
public var boneIds(get, set):cpp.RawPointer<cpp.UInt8>;
private inline function get_boneIds():cpp.RawPointer<cpp.UInt8> { return cast _boneIds; }
private inline function set_boneIds(value:cpp.RawPointer<cpp.UInt8>):cpp.RawPointer<cpp.UInt8> { _boneIds = cast value; return value; }
public var boneWeights(get, set):cpp.RawPointer<Float>;
private inline function get_boneWeights():cpp.RawPointer<Float> { return cast _boneWeights; }
private inline function set_boneWeights(value:cpp.RawPointer<Float>):cpp.RawPointer<Float> { _boneWeights = cast value; return value; }
public var vaoId(get, set):Int;
private inline function get_vaoId():Int { return _vaoId; }
private inline function set_vaoId(value:Int):Int { _vaoId = value; return value; }
public var vboId(get, set):cpp.RawPointer<cpp.UInt32>;
private inline function get_vboId():cpp.RawPointer<cpp.UInt32> { return cast _vboId; }
private inline function set_vboId(value:cpp.RawPointer<cpp.UInt32>):cpp.RawPointer<cpp.UInt32> { _vboId = cast value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Mesh>")
extern class Mesh extends MeshRef {
public static inline function create(vertexCount:Int, triangleCount:Int, vertices:cpp.RawPointer<Float>, texcoords:cpp.RawPointer<Float>, texcoords2:cpp.RawPointer<Float>, normals:cpp.RawPointer<Float>, tangents:cpp.RawPointer<Float>, colors:cpp.RawPointer<cpp.UInt8>, indices:cpp.RawPointer<Int>, animVertices:cpp.RawPointer<Float>, animNormals:cpp.RawPointer<Float>, boneIds:cpp.RawPointer<cpp.UInt8>, boneWeights:cpp.RawPointer<Float>, vaoId:Int, vboId:cpp.RawPointer<cpp.UInt32>):MeshRef {
var t:RayMesh = untyped __cpp__("{ (int){0}, (int){1}, (float *){2}, (float *){3}, (float *){4}, (float *){5}, (float *){6}, (unsigned char *){7}, (unsigned short *){8}, (float *){9}, (float *){10}, (unsigned char *){11}, (float *){12}, (unsigned int){13}, (unsigned int *){14} }", vertexCount, triangleCount, vertices, texcoords, texcoords2, normals, tangents, colors, indices, animVertices, animNormals, boneIds, boneWeights, vaoId, vboId);
return cast t;
}
public static inline function createEmpty():MeshRef {
var t:RayMesh = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Shader
@:include("raylib.h")
@:native("Shader")
@:structAccess
extern private class RayShader {
@:native("id") @:dox(hide) @:noCompletion private var _id:Int; // Shader program id
@:native("locs") @:dox(hide) @:noCompletion private var _locs:cpp.RawPointer<Int>; // Shader locations array (RL_MAX_SHADER_LOCATIONS)
}
@:include("raylib.h")
@:native("cpp.Reference<Shader>")
extern class ShaderRef extends RayShader {
public var id(get, set):Int;
private inline function get_id():Int { return _id; }
private inline function set_id(value:Int):Int { _id = value; return value; }
public var locs(get, set):cpp.RawPointer<Int>;
private inline function get_locs():cpp.RawPointer<Int> { return cast _locs; }
private inline function set_locs(value:cpp.RawPointer<Int>):cpp.RawPointer<Int> { _locs = cast value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Shader>")
extern class Shader extends ShaderRef {
public static inline function create(id:Int, locs:cpp.RawPointer<Int>):ShaderRef {
var t:RayShader = untyped __cpp__("{ (unsigned int){0}, (int *){1} }", id, locs);
return cast t;
}
public static inline function createEmpty():ShaderRef {
var t:RayShader = untyped __cpp__("{ 0 }");
return cast t;
}
}
// MaterialMap
@:include("raylib.h")
@:native("MaterialMap")
@:structAccess
extern private class RayMaterialMap {
@:native("texture") @:dox(hide) @:noCompletion private var _texture:RayTexture; // Material map texture
@:native("color") @:dox(hide) @:noCompletion private var _color:RayColor; // Material map color
@:native("value") @:dox(hide) @:noCompletion private var _value:Float; // Material map value
}
@:include("raylib.h")
@:native("cpp.Reference<MaterialMap>")
extern class MaterialMapRef extends RayMaterialMap {
public var texture(get, set):Texture2DRef;
private inline function get_texture():Texture2DRef { return cast _texture; }
private inline function set_texture(value:Texture2DRef):Texture2DRef { _texture = cast value; return value; }
public var color(get, set):ColorRef;
private inline function get_color():ColorRef { return cast _color; }
private inline function set_color(value:ColorRef):ColorRef { _color = cast value; return value; }
public var value(get, set):Float;
private inline function get_value():Float { return _value; }
private inline function set_value(value:Float):Float { _value = value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<MaterialMap>")
extern class MaterialMap extends MaterialMapRef {
public static inline function create(texture:RayTexture, color:RayColor, value:Float):MaterialMapRef {
var t:RayMaterialMap = untyped __cpp__("{ (Texture2D){0}, (Color){1}, (float){2} }", texture, color, value);
return cast t;
}
public static inline function createEmpty():MaterialMapRef {
var t:RayMaterialMap = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Material, includes shader and maps
@:include("raylib.h")
@:native("Material")
@:structAccess
extern private class RayMaterial {
@:native("shader") @:dox(hide) @:noCompletion private var _shader:RayShader; // Material shader
@:native("maps") @:dox(hide) @:noCompletion private var _maps:cpp.RawPointer<RayMaterialMap>; // Material maps array (MAX_MATERIAL_MAPS)
@:native("params") @:dox(hide) @:noCompletion private var _params:Float; // Material generic parameters (if required) - TODO: cpp native array (original: "float params[4]")
}
@:include("raylib.h")
@:native("cpp.Reference<Material>")
extern class MaterialRef extends RayMaterial {
public var shader(get, set):ShaderRef;
private inline function get_shader():ShaderRef { return cast _shader; }
private inline function set_shader(value:ShaderRef):ShaderRef { _shader = cast value; return value; }
public var maps(get, set):cpp.RawPointer<MaterialMap>;
private inline function get_maps():cpp.RawPointer<MaterialMap> { return cast _maps; }
private inline function set_maps(value:cpp.RawPointer<MaterialMap>):cpp.RawPointer<MaterialMap> { _maps = cast value; return value; }
public var params(get, set):Float;
private inline function get_params():Float { return _params; }
private inline function set_params(value:Float):Float { _params = value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Material>")
extern class Material extends MaterialRef {
public static inline function create(shader:RayShader, maps:cpp.RawPointer<RayMaterialMap>, params:Float):MaterialRef {
var t:RayMaterial = untyped __cpp__("{ (Shader){0}, (MaterialMap *){1}, (float){2} }", shader, maps, params);
return cast t;
}
public static inline function createEmpty():MaterialRef {
var t:RayMaterial = untyped __cpp__("{ 0 }");
return cast t;
}
}
// Transform, vectex transformation data
@:include("raylib.h")
@:native("Transform")
@:structAccess
extern private class RayTransform {
@:native("translation") @:dox(hide) @:noCompletion private var _translation:RayVector3; // Translation
@:native("rotation") @:dox(hide) @:noCompletion private var _rotation:Quaternion; // Rotation
@:native("scale") @:dox(hide) @:noCompletion private var _scale:RayVector3; // Scale
}
@:include("raylib.h")
@:native("cpp.Reference<Transform>")
extern class TransformRef extends RayTransform {
public var translation(get, set):Vector3Ref;
private inline function get_translation():Vector3Ref { return cast _translation; }
private inline function set_translation(value:Vector3Ref):Vector3Ref { _translation = cast value; return value; }
public var rotation(get, set):Quaternion;
private inline function get_rotation():Quaternion { return cast _rotation; }
private inline function set_rotation(value:Quaternion):Quaternion { _rotation = cast value; return value; }
public var scale(get, set):Vector3Ref;
private inline function get_scale():Vector3Ref { return cast _scale; }
private inline function set_scale(value:Vector3Ref):Vector3Ref { _scale = cast value; return value; }
}
@:include("raylib.h")
@:native("cpp.Struct<Transform>")
extern class Transform extends TransformRef {
public static inline function create(translation:RayVector3, rotation:Quaternion, scale:RayVector3):TransformRef {
var t:RayTransform = untyped __cpp__("{ (Vector3){0}, (Quaternion){1}, (Vector3){2} }", translation, rotation, scale);
return cast t;
}