-
Notifications
You must be signed in to change notification settings - Fork 2
/
raylib.pbi
1999 lines (1801 loc) · 132 KB
/
raylib.pbi
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
;**********************************************************************************************
;*
;* raylib - A simple and easy-to-use library to enjoy videogames programming (www.raylib.com)
;*
;* FEATURES:
;* - NO external dependencies, all required libraries included with raylib
;* - Multiplatform: Windows, Linux, FreeBSD, OpenBSD, NetBSD, DragonFly, MacOS, UWP, Android, Raspberry Pi, HTML5.
;* - Written in plain C code (C99) in PascalCase/camelCase notation
;* - Hardware accelerated with OpenGL (1.1, 2.1, 3.3 or ES2 - choose at compile)
;* - Unique OpenGL abstraction layer (usable as standalone module): [rlgl]
;* - Multiple Fonts formats supported (TTF, XNA fonts, AngelCode fonts)
;* - Outstanding texture formats support, including compressed formats (DXT, ETC, ASTC)
;* - Full 3d support for 3d Shapes, Models, Billboards, Heightmaps and more!
;* - Flexible Materials system, supporting classic maps and PBR maps
;* - Skeletal Animation support (CPU bones-based animation)
;* - Shaders support, including Model shaders and Postprocessing shaders
;* - Powerful math module for Vector, Matrix and Quaternion operations: [raymath]
;* - Audio loading and playing with streaming support (WAV, OGG, MP3, FLAC, XM, MOD)
;* - VR stereo rendering with configurable HMD device parameters
;* - Bindings to multiple programming languages available!
;*
;* NOTES:
;* One custom font is loaded by default when InitWindow() [core]
;* If using OpenGL 3.3 or ES2, one default shader is loaded automatically (internally defined) [rlgl]
;* If using OpenGL 3.3 or ES2, several vertex buffers (VAO/VBO) are created to manage lines-triangles-quads
;*
;* DEPENDENCIES (included):
;* [core] rglfw (github.com/glfw/glfw) for window/context management and input (only PLATFORM_DESKTOP)
;* [rlgl] glad (github.com/Dav1dde/glad) for OpenGL 3.3 extensions loading (only PLATFORM_DESKTOP)
;* [raudio] miniaudio (github.com/dr-soft/miniaudio) for audio device/context management
;*
;* OPTIONAL DEPENDENCIES (included):
;* [core] rgif (Charlie Tangora, Ramon Santamaria) for GIF recording
;* [textures] stb_image (Sean Barret) for images loading (BMP, TGA, PNG, JPEG, HDR...)
;* [textures] stb_image_write (Sean Barret) for image writting (BMP, TGA, PNG, JPG)
;* [textures] stb_image_resize (Sean Barret) for image resizing algorithms
;* [textures] stb_perlin (Sean Barret) for Perlin noise image generation
;* [text] stb_truetype (Sean Barret) for ttf fonts loading
;* [text] stb_rect_pack (Sean Barret) for rectangles packing
;* [models] par_shapes (Philip Rideout) for parametric 3d shapes generation
;* [models] tinyobj_loader_c (Syoyo Fujita) for models loading (OBJ, MTL)
;* [models] cgltf (Johannes Kuhlmann) for models loading (glTF)
;* [raudio] stb_vorbis (Sean Barret) for OGG audio loading
;* [raudio] dr_flac (David Reid) for FLAC audio file loading
;* [raudio] dr_mp3 (David Reid) for MP3 audio file loading
;* [raudio] jar_xm (Joshua Reisenauer) for XM audio module loading
;* [raudio] jar_mod (Joshua Reisenauer) for MOD audio module loading
;*
;*
;* LICENSE: zlib/libpng
;*
;* raylib is licensed under an unmodified zlib/libpng license, which is an OSI-certified,
;* BSD-like license that allows static linking with closed source software:
;*
;* Copyright (c) 2013-2020 Ramon Santamaria (@raysan5)
;*
;* This software is provided "as-is", without any express or implied warranty. In no event
;* will the authors be held liable for any damages arising from the use of this software.
;*
;* Permission is granted to anyone to use this software for any purpose, including commercial
;* applications, and to alter it and redistribute it freely, subject to the following restrictions:
;*
;* 1. The origin of this software must not be misrepresented; you must not claim that you
;* wrote the original software. If you use this software in a product, an acknowledgment
;* in the product documentation would be appreciated but is not required.
;*
;* 2. Altered source versions must be plainly marked as such, and must not be misrepresented
;* as being the original software.
;*
;* 3. This notice may not be removed or altered from any source distribution.
;*
;**********************************************************************************************
;*
;* 'raylib-purebasic': Copyright (c) 2020 Danilo Krahn
;*
;**********************************************************************************************
EnableExplicit
;- ---------- DeclareModule Start
;{ ---------- DeclareModule Start
DeclareModule ray
;#RL_PI = 3.14159265358979323846 ; too many digits
#RL_PI = 3.1415926535897932385 ; remove last digit and round up
#MAX_TOUCH_POINTS = 10 ;// Maximum number of touch points supported
#DEG2RAD = #RL_PI/180.0
#RAD2DEG = 180.0/#RL_PI
;// Temporal hack to avoid breaking old codebases using
;// deprecated raylib implementation of these functions
;
; Macro FormatText : TextFormat : EndMacro ;
; Macro SubText : TextSubtext : EndMacro ; This is here for finding the names.
; Macro ShowWindow : UnhideWindow : EndMacro ; Just use the new functions in PureBasic.
; Macro LoadText : LoadFileText : EndMacro ; - Danilo
Macro rl_RGBA(r,g,b,a)
( a<<24 | b<<16 | g<<8 | r )
EndMacro
;// Some Basic Colors
;// NOTE: Custom raylib color palette for amazing visuals on WHITE background
#COLOR_LIGHTGRAY = rl_RGBA( 200, 200, 200, 255 ) ;// Light Gray
#COLOR_Gray = rl_RGBA( 130, 130, 130, 255 ) ;// Gray
#COLOR_DARKGRAY = rl_RGBA( 80, 80, 80, 255 ) ;// Dark Gray
#COLOR_Yellow = rl_RGBA( 253, 249, 0, 255 ) ;// Yellow
#COLOR_GOLD = rl_RGBA( 255, 203, 0, 255 ) ;// Gold
#COLOR_ORANGE = rl_RGBA( 255, 161, 0, 255 ) ;// Orange
#COLOR_PINK = rl_RGBA( 255, 109, 194, 255 ) ;// Pink
#COLOR_Red = rl_RGBA( 230, 41, 55, 255 ) ;// Red
#COLOR_MAROON = rl_RGBA( 190, 33, 55, 255 ) ;// Maroon
#COLOR_Green = rl_RGBA( 0, 228, 48, 255 ) ;// Green
#COLOR_LIME = rl_RGBA( 0, 158, 47, 255 ) ;// Lime
#COLOR_DARKGREEN = rl_RGBA( 0, 117, 44, 255 ) ;// Dark Green
#COLOR_SKYBLUE = rl_RGBA( 102, 191, 255, 255 ) ;// Sky Blue
#COLOR_Blue = rl_RGBA( 0, 121, 241, 255 ) ;// Blue
#COLOR_DARKBLUE = rl_RGBA( 0, 82, 172, 255 ) ;// Dark Blue
#COLOR_PURPLE = rl_RGBA( 200, 122, 255, 255 ) ;// Purple
#COLOR_VIOLET = rl_RGBA( 135, 60, 190, 255 ) ;// Violet
#COLOR_DARKPURPLE = rl_RGBA( 112, 31, 126, 255 ) ;// Dark Purple
#COLOR_BEIGE = rl_RGBA( 211, 176, 131, 255 ) ;// Beige
#COLOR_BROWN = rl_RGBA( 127, 106, 79, 255 ) ;// Brown
#COLOR_DARKBROWN = rl_RGBA( 76, 63, 47, 255 ) ;// Dark Brown
#COLOR_White = rl_RGBA( 255, 255, 255, 255 ) ;// White
#COLOR_Black = rl_RGBA( 0, 0, 0, 255 ) ;// Black
#COLOR_BLANK = rl_RGBA( 0, 0, 0, 0 ) ;// Blank (Transparent)
#COLOR_Magenta = rl_RGBA( 255, 0, 255, 255 ) ;// Magenta
#COLOR_RAYWHITE = rl_RGBA( 245, 245, 245, 255 ) ;// My own White (raylib logo)
;- ---------- Enumerations Start
;{ ---------- Enumerations Start
;//----------------------------------------------------------------------------------
;// Enumerators Definition
;//----------------------------------------------------------------------------------
Enumeration bool
#RL_False
#RL_True
EndEnumeration
;// System config flags
;// NOTE: Used for bit masks
Enumeration ConfigFlag
#FLAG_RESERVED = 1 ;// Reserved
#FLAG_FULLSCREEN_MODE = 2 ;// Set to run program in fullscreen
#FLAG_WINDOW_RESIZABLE = 4 ;// Set to allow resizable window
#FLAG_WINDOW_UNDECORATED = 8 ;// Set to disable window decoration (frame and buttons)
#FLAG_WINDOW_TRANSPARENT = 16 ;// Set to allow transparent window
#FLAG_WINDOW_HIDDEN = 128 ;// Set to create the window initially hidden
#FLAG_WINDOW_ALWAYS_RUN = 256 ;// Set to allow windows running while minimized
#FLAG_MSAA_4X_HINT = 32 ;// Set to try enabling MSAA 4X
#FLAG_VSYNC_HINT = 64 ;// Set to try enabling V-Sync on GPU
EndEnumeration
;// Trace log type
Enumeration TraceLogType
#LOG_ALL = 0 ;// Display all logs
#LOG_TRACE
#LOG_DEBUG
#LOG_INFO
#LOG_WARNING
#LOG_ERROR
#LOG_FATAL
#LOG_NONE ;// Disable logging
EndEnumeration
;// Keyboard keys
Enumeration KeyboardKey
;// Alphanumeric keys
#KEY_APOSTROPHE = 39
#KEY_COMMA = 44
#KEY_MINUS = 45
#KEY_PERIOD = 46
#KEY_SLASH = 47
#KEY_ZERO = 48
#KEY_ONE = 49
#KEY_TWO = 50
#KEY_THREE = 51
#KEY_FOUR = 52
#KEY_FIVE = 53
#KEY_SIX = 54
#KEY_SEVEN = 55
#KEY_EIGHT = 56
#KEY_NINE = 57
#KEY_SEMICOLON = 59
#KEY_EQUAL = 61
#KEY_A = 65
#KEY_B = 66
#KEY_C = 67
#KEY_D = 68
#KEY_E = 69
#KEY_F = 70
#KEY_G = 71
#KEY_H = 72
#KEY_I = 73
#KEY_J = 74
#KEY_K = 75
#KEY_L = 76
#KEY_M = 77
#KEY_N = 78
#KEY_O = 79
#KEY_P = 80
#KEY_Q = 81
#KEY_R = 82
#KEY_S = 83
#KEY_T = 84
#KEY_U = 85
#KEY_V = 86
#KEY_W = 87
#KEY_X = 88
#KEY_Y = 89
#KEY_Z = 90
;// Function keys
#KEY_SPACE = 32
#KEY_ESCAPE = 256
#KEY_ENTER = 257
#KEY_TAB = 258
#KEY_BACKSPACE = 259
#KEY_INSERT = 260
#KEY_DELETE = 261
#KEY_RIGHT = 262
#KEY_LEFT = 263
#KEY_DOWN = 264
#KEY_UP = 265
#KEY_PAGE_UP = 266
#KEY_PAGE_DOWN = 267
#KEY_HOME = 268
#KEY_END = 269
#KEY_CAPS_LOCK = 280
#KEY_SCROLL_LOCK = 281
#KEY_NUM_LOCK = 282
#KEY_PRINT_SCREEN = 283
#KEY_PAUSE = 284
#KEY_F1 = 290
#KEY_F2 = 291
#KEY_F3 = 292
#KEY_F4 = 293
#KEY_F5 = 294
#KEY_F6 = 295
#KEY_F7 = 296
#KEY_F8 = 297
#KEY_F9 = 298
#KEY_F10 = 299
#KEY_F11 = 300
#KEY_F12 = 301
#KEY_LEFT_SHIFT = 340
#KEY_LEFT_CONTROL = 341
#KEY_LEFT_ALT = 342
#KEY_LEFT_SUPER = 343
#KEY_RIGHT_SHIFT = 344
#KEY_RIGHT_CONTROL = 345
#KEY_RIGHT_ALT = 346
#KEY_RIGHT_SUPER = 347
#KEY_KB_MENU = 348
#KEY_LEFT_BRACKET = 91
#KEY_BACKSLASH = 92
#KEY_RIGHT_BRACKET = 93
#KEY_GRAVE = 96
;// Keypad keys
#KEY_KP_0 = 320
#KEY_KP_1 = 321
#KEY_KP_2 = 322
#KEY_KP_3 = 323
#KEY_KP_4 = 324
#KEY_KP_5 = 325
#KEY_KP_6 = 326
#KEY_KP_7 = 327
#KEY_KP_8 = 328
#KEY_KP_9 = 329
#KEY_KP_DECIMAL = 330
#KEY_KP_DIVIDE = 331
#KEY_KP_MULTIPLY = 332
#KEY_KP_SUBTRACT = 333
#KEY_KP_ADD = 334
#KEY_KP_ENTER = 335
#KEY_KP_EQUAL = 336
EndEnumeration
;// Android buttons
Enumeration AndroidButton
#KEY_BACK = 4
#KEY_MENU = 82
#KEY_VOLUME_UP = 24
#KEY_VOLUME_DOWN = 25
EndEnumeration
;// Mouse buttons
Enumeration MouseButton
#MOUSE_LEFT_BUTTON = 0
#MOUSE_RIGHT_BUTTON = 1
#MOUSE_MIDDLE_BUTTON = 2
EndEnumeration
;// Gamepad number
Enumeration GamepadNumber
#GAMEPAD_PLAYER1 = 0
#GAMEPAD_PLAYER2 = 1
#GAMEPAD_PLAYER3 = 2
#GAMEPAD_PLAYER4 = 3
EndEnumeration
;// Gamepad Buttons
Enumeration GamepadButton
;// This is here just for error checking
#GAMEPAD_BUTTON_UNKNOWN = 0
;// This is normally a DPAD
#GAMEPAD_BUTTON_LEFT_FACE_UP
#GAMEPAD_BUTTON_LEFT_FACE_RIGHT
#GAMEPAD_BUTTON_LEFT_FACE_DOWN
#GAMEPAD_BUTTON_LEFT_FACE_LEFT
;// This normally corresponds with PlayStation and Xbox controllers
;// XBOX: [Y,X,A,B]
;// PS3: [Triangle,Square,Cross,Circle]
;// No support for 6 button controllers though..
#GAMEPAD_BUTTON_RIGHT_FACE_UP
#GAMEPAD_BUTTON_RIGHT_FACE_RIGHT
#GAMEPAD_BUTTON_RIGHT_FACE_DOWN
#GAMEPAD_BUTTON_RIGHT_FACE_LEFT
;// Triggers
#GAMEPAD_BUTTON_LEFT_TRIGGER_1
#GAMEPAD_BUTTON_LEFT_TRIGGER_2
#GAMEPAD_BUTTON_RIGHT_TRIGGER_1
#GAMEPAD_BUTTON_RIGHT_TRIGGER_2
;// These are buttons in the center of the gamepad
#GAMEPAD_BUTTON_MIDDLE_LEFT ;//PS3 Select
#GAMEPAD_BUTTON_MIDDLE ;//PS Button/XBOX Button
#GAMEPAD_BUTTON_MIDDLE_RIGHT ;//PS3 Start
;// These are the joystick press in buttons
#GAMEPAD_BUTTON_LEFT_THUMB
#GAMEPAD_BUTTON_RIGHT_THUMB
EndEnumeration
Enumeration GamepadAxis
;// This is here just for error checking
#GAMEPAD_AXIS_UNKNOWN = 0
;// Left stick
#GAMEPAD_AXIS_LEFT_X
#GAMEPAD_AXIS_LEFT_Y
;// Right stick
#GAMEPAD_AXIS_RIGHT_X
#GAMEPAD_AXIS_RIGHT_Y
;// Pressure levels for the back triggers
#GAMEPAD_AXIS_LEFT_TRIGGER ;// [1..-1] (pressure-level)
#GAMEPAD_AXIS_RIGHT_TRIGGER ;// [1..-1] (pressure-level)
EndEnumeration
;// Shader location point type
Enumeration ShaderLocationIndex
#LOC_VERTEX_POSITION = 0
#LOC_VERTEX_TEXCOORD01
#LOC_VERTEX_TEXCOORD02
#LOC_VERTEX_NORMAL
#LOC_VERTEX_TANGENT
#LOC_VERTEX_COLOR
#LOC_MATRIX_MVP
#LOC_MATRIX_MODEL
#LOC_MATRIX_VIEW
#LOC_MATRIX_PROJECTION
#LOC_VECTOR_VIEW
#LOC_COLOR_DIFFUSE
#LOC_COLOR_SPECULAR
#LOC_COLOR_AMBIENT
#LOC_MAP_ALBEDO ;// LOC_MAP_DIFFUSE
#LOC_MAP_METALNESS ;// LOC_MAP_SPECULAR
#LOC_MAP_NORMAL
#LOC_MAP_ROUGHNESS
#LOC_MAP_OCCLUSION
#LOC_MAP_EMISSION
#LOC_MAP_HEIGHT
#LOC_MAP_CUBEMAP
#LOC_MAP_IRRADIANCE
#LOC_MAP_PREFILTER
#LOC_MAP_BRDF
EndEnumeration
#LOC_MAP_DIFFUSE = #LOC_MAP_ALBEDO
#LOC_MAP_SPECULAR = #LOC_MAP_METALNESS
;// Shader uniform data types
Enumeration ShaderUniformDataType
#UNIFORM_FLOAT = 0
#UNIFORM_VEC2
#UNIFORM_VEC3
#UNIFORM_VEC4
#UNIFORM_INT
#UNIFORM_IVEC2
#UNIFORM_IVEC3
#UNIFORM_IVEC4
#UNIFORM_SAMPLER2D
EndEnumeration
;// Material map type
Enumeration MaterialMapType
#MAP_ALBEDO = 0 ;// MAP_DIFFUSE
#MAP_METALNESS = 1 ;// MAP_SPECULAR
#MAP_NORMAL = 2
#MAP_ROUGHNESS = 3
#MAP_OCCLUSION
#MAP_EMISSION
#MAP_HEIGHT
#MAP_CUBEMAP ;// NOTE: Uses GL_TEXTURE_CUBE_MAP
#MAP_IRRADIANCE ;// NOTE: Uses GL_TEXTURE_CUBE_MAP
#MAP_PREFILTER ;// NOTE: Uses GL_TEXTURE_CUBE_MAP
#MAP_BRDF
EndEnumeration
#MAP_DIFFUSE = #MAP_ALBEDO
#MAP_SPECULAR = #MAP_METALNESS
;// Pixel formats
;// NOTE: Support depends on OpenGL version and platform
Enumeration PixelFormat
#UNCOMPRESSED_GRAYSCALE = 1 ;// 8 bit per pixel (no alpha)
#UNCOMPRESSED_GRAY_ALPHA ;// 8*2 bpp (2 channels)
#UNCOMPRESSED_R5G6B5 ;// 16 bpp
#UNCOMPRESSED_R8G8B8 ;// 24 bpp
#UNCOMPRESSED_R5G5B5A1 ;// 16 bpp (1 bit alpha)
#UNCOMPRESSED_R4G4B4A4 ;// 16 bpp (4 bit alpha)
#UNCOMPRESSED_R8G8B8A8 ;// 32 bpp
#UNCOMPRESSED_R32 ;// 32 bpp (1 channel - float)
#UNCOMPRESSED_R32G32B32 ;// 32*3 bpp (3 channels - float)
#UNCOMPRESSED_R32G32B32A32 ;// 32*4 bpp (4 channels - float)
#COMPRESSED_DXT1_RGB ;// 4 bpp (no alpha)
#COMPRESSED_DXT1_RGBA ;// 4 bpp (1 bit alpha)
#COMPRESSED_DXT3_RGBA ;// 8 bpp
#COMPRESSED_DXT5_RGBA ;// 8 bpp
#COMPRESSED_ETC1_RGB ;// 4 bpp
#COMPRESSED_ETC2_RGB ;// 4 bpp
#COMPRESSED_ETC2_EAC_RGBA ;// 8 bpp
#COMPRESSED_PVRT_RGB ;// 4 bpp
#COMPRESSED_PVRT_RGBA ;// 4 bpp
#COMPRESSED_ASTC_4x4_RGBA ;// 8 bpp
#COMPRESSED_ASTC_8x8_RGBA ;// 2 bpp
EndEnumeration
;// Texture parameters: filter mode
;// NOTE 1: Filtering considers mipmaps if available in the texture
;// NOTE 2: Filter is accordingly set for minification and magnification
Enumeration TextureFilterMode
#FILTER_POINT = 0 ;// No filter, just pixel aproximation
#FILTER_BILINEAR ;// Linear filtering
#FILTER_TRILINEAR ;// Trilinear filtering (linear with mipmaps)
#FILTER_ANISOTROPIC_4X ;// Anisotropic filtering 4x
#FILTER_ANISOTROPIC_8X ;// Anisotropic filtering 8x
#FILTER_ANISOTROPIC_16X ;// Anisotropic filtering 16x
EndEnumeration
;// Cubemap layout type
Enumeration CubemapLayoutType
#CUBEMAP_AUTO_DETECT = 0 ;// Automatically detect layout type
#CUBEMAP_LINE_VERTICAL ;// Layout is defined by a vertical line with faces
#CUBEMAP_LINE_HORIZONTAL ;// Layout is defined by an horizontal line with faces
#CUBEMAP_CROSS_THREE_BY_FOUR ;// Layout is defined by a 3x4 cross with cubemap faces
#CUBEMAP_CROSS_FOUR_BY_THREE ;// Layout is defined by a 4x3 cross with cubemap faces
#CUBEMAP_PANORAMA ;// Layout is defined by a panorama image (equirectangular map)
EndEnumeration
;// Texture parameters: wrap mode
Enumeration TextureWrapMode
#WRAP_REPEAT = 0 ;// Repeats texture in tiled mode
#WRAP_CLAMP ;// Clamps texture to edge pixel in tiled mode
#WRAP_MIRROR_REPEAT ;// Mirrors and repeats the texture in tiled mode
#WRAP_MIRROR_CLAMP ;// Mirrors and clamps to border the texture in tiled mode
EndEnumeration
;// Font type, defines generation method
Enumeration FontType
#FONT_DEFAULT = 0 ;// Default font generation, anti-aliased
#FONT_BITMAP ;// Bitmap font generation, no anti-aliasing
#FONT_SDF ;// SDF font generation, requires external shader
EndEnumeration
;// Color blending modes (pre-defined)
Enumeration BlendMode
#BLEND_ALPHA = 0 ;// Blend textures considering alpha (default)
#BLEND_ADDITIVE ;// Blend textures adding colors
#BLEND_MULTIPLIED ;// Blend textures multiplying colors
EndEnumeration
;// Gestures type
;// NOTE: It could be used as flags to enable only some gestures
Enumeration GestureType
#GESTURE_NONE = 0
#GESTURE_TAP = 1
#GESTURE_DOUBLETAP = 2
#GESTURE_HOLD = 4
#GESTURE_DRAG = 8
#GESTURE_SWIPE_RIGHT = 16
#GESTURE_SWIPE_LEFT = 32
#GESTURE_SWIPE_UP = 64
#GESTURE_SWIPE_DOWN = 128
#GESTURE_PINCH_IN = 256
#GESTURE_PINCH_OUT = 512
EndEnumeration
;// Camera system modes
Enumeration CameraMode
#CAMERAMODE_CUSTOM = 0
#CAMERAMODE_FREE
#CAMERAMODE_ORBITAL
#CAMERAMODE_FIRST_PERSON
#CAMERAMODE_THIRD_PERSON
EndEnumeration
;// Camera projection modes
Enumeration CameraType
#CAMERATYPE_PERSPECTIVE = 0
#CAMERATYPE_ORTHOGRAPHIC
EndEnumeration
;// Type of n-patch
Enumeration NPatchType
#NPT_9PATCH = 0 ;// Npatch defined by 3x3 tiles
#NPT_3PATCH_VERTICAL ;// Npatch defined by 1x3 tiles
#NPT_3PATCH_HORIZONTAL ;// Npatch defined by 3x1 tiles
EndEnumeration
;- ---------- Enumerations End
;} ---------- Enumerations End
;- ---------- Macros Start
;{ ---------- Macros Start
;**************** TEMP
Macro rl_ColorLong: l : EndMacro
;****************
Macro rl_bool : l : EndMacro
Macro rl_int : l : EndMacro
Macro rl_uint : l : EndMacro
Macro rl_long : i : EndMacro
Macro rl_float : f : EndMacro
Macro rl_double: d : EndMacro
;Macro rl_void : : EndMacro
Macro RLDQ
"
EndMacro
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
Macro RLAS(__procname)
As RLDQ#_#__procname#RLDQ
EndMacro
Macro __PBAS(__procname)
As RLDQ#_pbhelper_#__procname#RLDQ
EndMacro
CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64
Macro RLAS(__procname)
As RLDQ#__procname#RLDQ
EndMacro
Macro __PBAS(__procname)
As RLDQ#pbhelper_#__procname#RLDQ
EndMacro
CompilerEndIf
CompilerElseIf #PB_Compiler_OS = #PB_OS_Linux
Macro RLAS(__procname)
As RLDQ#__procname#RLDQ
EndMacro
Macro __PBAS(__procname)
As RLDQ#pbhelper_#__procname#RLDQ
EndMacro
CompilerElseIf #PB_Compiler_OS = #PB_OS_MacOS
Macro RLAS(__procname)
As RLDQ#_#__procname#RLDQ
EndMacro
Macro __PBAS(__procname)
As RLDQ#_pbhelper_#__procname#RLDQ
EndMacro
CompilerEndIf
;- ---------- Macros End
;} ---------- Macros End
;- ---------- Structures Start
;{ ---------- Structures Start
;//----------------------------------------------------------------------------------
;// Structures Definition
;//----------------------------------------------------------------------------------
;// Vector2 type
Structure Vector2 Align #PB_Structure_AlignC
x.rl_float
y.rl_float
EndStructure
;// Vector3 type
Structure Vector3 Align #PB_Structure_AlignC
x.rl_float
y.rl_float
z.rl_float
EndStructure
;// Vector4 type
Structure Vector4 Align #PB_Structure_AlignC
x.rl_float
y.rl_float
z.rl_float
w.rl_float
EndStructure
;// Quaternion type, same As Vector4
Structure Quaternion Extends Vector4 Align #PB_Structure_AlignC
EndStructure
;// Matrix type (OpenGL style 4x4 - right handed, column major)
Structure Matrix Align #PB_Structure_AlignC
m0.rl_float
m4.rl_float
m8.rl_float
m12.rl_float
m1.rl_float
m5.rl_float
m9.rl_float
m13.rl_float
m2.rl_float
m6.rl_float
m10.rl_float
m14.rl_float
m3.rl_float
m7.rl_float
m11.rl_float
m15.rl_float
EndStructure
;// Color type, RGBA (32bit)
Structure Color Align #PB_Structure_AlignC
r.a
g.a
b.a
a.a
EndStructure
;// Rectangle type
Structure Rectangle Align #PB_Structure_AlignC
x.rl_float
y.rl_float
width.rl_float
height.rl_float
EndStructure
;// Image type, bpp always RGBA (32bit)
;// NOTE: Data stored in CPU memory (RAM)
Structure Image Align #PB_Structure_AlignC
*_data ;// Image raw data
width.rl_int ;// Image base width
height.rl_int ;// Image base height
mipmaps.rl_int ;// Mipmap levels, 1 by default
format.rl_int ;// Data format (PixelFormat type)
EndStructure
;// Texture2D type
;// NOTE: Data stored in GPU memory
Structure Texture2D Align #PB_Structure_AlignC
id.rl_uint ;// OpenGL texture id
width.rl_int ;// Texture base width
height.rl_int ;// Texture base height
mipmaps.rl_int ;// Mipmap levels, 1 by default
format.rl_int ;// Data format (PixelFormat type)
EndStructure
;// Texture type, same As Texture2D
Structure Texture Extends Texture2D Align #PB_Structure_AlignC
EndStructure
;// TextureCubemap type, actually, same As Texture2D
Structure TextureCubemap Extends Texture2D Align #PB_Structure_AlignC
EndStructure
;// RenderTexture2D type, For texture rendering
Structure RenderTexture2D Align #PB_Structure_AlignC
id.rl_uint ;// OpenGL Framebuffer Object (FBO) id
texture.Texture2D ;// Color buffer attachment texture
depth.Texture2D ;// Depth buffer attachment texture
depthTexture.rl_bool ;// Track if depth attachment is a texture or renderbuffer
EndStructure
;// RenderTexture type, same As RenderTexture2D
Structure RenderTexture Extends RenderTexture2D Align #PB_Structure_AlignC
EndStructure
;// N-Patch layout info
Structure NPatchInfo Align #PB_Structure_AlignC
sourceRec.Rectangle ;// Region in the texture
left.rl_int ;// left border offset
top.rl_int ;// top border offset
right.rl_int ;// right border offset
bottom.rl_int ;// bottom border offset
type.rl_int ;// layout of the n-patch: 3x3, 1x3 or 3x1
EndStructure
;// Font character info
Structure CharInfo Align #PB_Structure_AlignC
value.rl_int ;// Character value (Unicode)
offsetX.rl_int ;// Character offset X when drawing
offsetY.rl_int ;// Character offset Y when drawing
advanceX.rl_int ;// Character advance position X
image.Image ;// Character image data
EndStructure
;// Font type, includes texture And charSet Array Data
Structure Font Align #PB_Structure_AlignC
baseSize.rl_int ;// Base size (default chars height)
charsCount.rl_int ;// Number of characters
texture.Texture2D ;// Characters texture atlas
*recs.Rectangle ;// Characters rectangles in texture
*chars.CharInfo ;// Characters info data
EndStructure
;// SpriteFont type fallback, defaults To Font
Structure SpriteFont Extends Font Align #PB_Structure_AlignC
EndStructure
;// Camera type, defines a camera position/orientation in 3d space
Structure Camera3D Align #PB_Structure_AlignC
position.Vector3 ;// Camera position
target.Vector3 ;// Camera target it looks-at
up.Vector3 ;// Camera up vector (rotation over its axis)
fovy.rl_float ;// Camera field-of-view apperture in Y (degrees) in perspective, used as near plane width in orthographic
type.rl_int ;// Camera type, defines projection type: CAMERA_PERSPECTIVE or CAMERA_ORTHOGRAPHIC
EndStructure
;// Camera type fallback, defaults to Camera3D
Structure Camera Extends Camera3D Align #PB_Structure_AlignC
EndStructure
;// Camera2D type, defines a 2d camera
Structure Camera2D Align #PB_Structure_AlignC
offset.Vector2 ;// Camera offset (displacement from target)
target.Vector2 ;// Camera target (rotation and zoom origin)
rotation.rl_float ;// Camera rotation in degrees
zoom.rl_float ;// Camera zoom (scaling), should be 1.0f by default
EndStructure
;// Vertex Data definning a mesh
;// NOTE: Data stored in CPU memory (And GPU)
Structure Mesh Align #PB_Structure_AlignC
vertexCount.rl_int ;// Number of vertices stored in arrays
triangleCount.rl_int;// Number of triangles stored (indexed or not)
;// Default vertex Data
*vertices.Float ;// Vertex position (XYZ - 3 components per vertex) (shader-location = 0)
*texcoords.Float ;// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1)
*texcoords2.Float ;// Vertex second texture coordinates (useful for lightmaps) (shader-location = 5)
*normals.Float ;// Vertex normals (XYZ - 3 components per vertex) (shader-location = 2)
*tangents.Float ;// Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4)
*colors.Ascii ;// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3)
*indices.Unicode ;// Vertex indices (in case vertex data comes indexed)
;// Animation vertex Data
*animVertices.Float ;// Animated vertex positions (after bones transformations)
*animNormals.Float ;// Animated normals (after bones transformations)
*boneIds.Long ;// Vertex bone ids, up to 4 bones influence by vertex (skinning)
*boneWeights.Float ;// Vertex bone weight, up to 4 bones influence by vertex (skinning)
;// OpenGL identifiers
vaoId.rl_uint ;// OpenGL Vertex Array Object id
*vboId.Long ;// OpenGL Vertex Buffer Objects id (default vertex data)
EndStructure
;// Shader type (generic)
Structure Shader Align #PB_Structure_AlignC
id.rl_uint ;// Shader program id
*locs.Long ;// Shader locations array (MAX_SHADER_LOCATIONS)
EndStructure
;// Material texture Map
Structure MaterialMap Align #PB_Structure_AlignC
texture.Texture2D ;// Material map texture
color.rl_ColorLong ;// Material Map color
value.rl_float ;// Material Map value
EndStructure
;// Material type (generic)
Structure Material Align #PB_Structure_AlignC
shader.Shader ;// Material shader
*maps.MaterialMap ;// Material maps array (MAX_MATERIAL_MAPS)
*params.Float ;// Material generic parameters (if required)
EndStructure
;// Transformation properties
Structure Transform Align #PB_Structure_AlignC
translation.Vector3 ;// Translation
rotation.Quaternion ;// Rotation
scale.Vector3 ;// Scale
EndStructure
;// Bone information
Structure BoneInfo Align #PB_Structure_AlignC
name.a[32] ;// Bone name
parent.rl_int ;// Bone parent
EndStructure
;// Model type
Structure Model Align #PB_Structure_AlignC
transform.Matrix ;// Local transform matrix
meshCount.rl_int ;// Number of meshes
*meshes.Mesh ;// Meshes array
materialCount.rl_int ;// Number of materials
*materials.Material ;// Materials array
*meshMaterial.Long ;// Mesh material number
;// Animation Data
boneCount.rl_int ;// Number of bones
*bones.BoneInfo ;// Bones information (skeleton)
*bindPose.Transform ;// Bones base transformation (pose)
EndStructure
;// Model animation
Structure ModelAnimation Align #PB_Structure_AlignC
boneCount.rl_int ;// Number of bones
*bones.BoneInfo ;// Bones information (skeleton)
frameCount.rl_int ;// Number of animation frames
*framePoses.rl_Transform[0] ;// Poses array by frame
EndStructure
;// Ray type (useful For raycast)
Structure Ray Align #PB_Structure_AlignC
position.Vector3 ;// Ray position (origin)
direction.Vector3 ;// Ray direction
EndStructure
;// Raycast hit information
Structure RayHitInfo Align #PB_Structure_AlignC
hit.rl_bool ;// Did the ray hit something?
distance.rl_float ;// Distance to nearest hit
position.Vector3 ;// Position of nearest hit
normal.Vector3 ;// Surface normal of hit
EndStructure
;// Bounding box type
Structure BoundingBox Align #PB_Structure_AlignC
min.Vector3 ;// Minimum vertex box-corner
max.Vector3 ;// Maximum vertex box-corner
EndStructure
;// Wave type, defines audio wave Data
Structure Wave Align #PB_Structure_AlignC
sampleCount.rl_uint ;// Total number of samples
sampleRate.rl_uint ;// Frequency (samples per second)
sampleSize.rl_uint ;// Bit depth (bits per sample): 8, 16, 32 (24 not supported)
channels.rl_uint ;// Number of channels (1-mono, 2-stereo)
*_data ;// Buffer data pointer
EndStructure
Structure rAudioBuffer Align #PB_Structure_AlignC
EndStructure
;// Audio stream type
;// NOTE: Useful To create custom audio streams Not bound To a specific file
Structure AudioStream Align #PB_Structure_AlignC
sampleRate.rl_uint ;// Frequency (samples per second)
sampleSize.rl_uint ;// Bit depth (bits per sample): 8, 16, 32 (24 not supported)
channels.rl_uint ;// Number of channels (1-mono, 2-stereo)
*buffer.rAudioBuffer ;// Pointer to internal data used by the audio system
EndStructure
;// Sound source type
Structure Sound Align #PB_Structure_AlignC
sampleCount.rl_uint ;// Total number of samples
stream.AudioStream ;// Audio stream
EndStructure
;// Music stream type (audio file streaming from memory)
;// NOTE: Anything longer than ~10 seconds should be streamed
Structure Music Align #PB_Structure_AlignC
ctxType.rl_int ;// Type of music context (audio filetype)
*ctxData ;// Audio context data, depends on type
sampleCount.rl_uint ;// Total number of samples
loopCount.rl_uint ;// Loops count (times music will play), 0 means infinite loop
stream.AudioStream ;// Audio stream
EndStructure
;// Head-Mounted-Display device parameters
Structure VrDeviceInfo Align #PB_Structure_AlignC
hResolution.rl_int ;// HMD horizontal resolution in pixels
vResolution.rl_int ;// HMD vertical resolution in pixels
hScreenSize.rl_float ;// HMD horizontal size in meters
vScreenSize.rl_float ;// HMD vertical size in meters
vScreenCenter.rl_float ;// HMD screen center in meters
eyeToScreenDistance.rl_float ;// HMD distance between eye and display in meters
lensSeparationDistance.rl_float ;// HMD lens separation distance in meters
interpupillaryDistance.rl_float ;// HMD IPD (distance between pupils) in meters
lensDistortionValues.rl_float[4];// HMD lens distortion constant parameters
chromaAbCorrection.rl_float[4] ;// HMD chromatic aberration correction parameters
EndStructure
;- ---------- Structures End
;} ---------- Structures End
;- ---------- Import Functions Start
;{ ---------- Import Functions Start
;// Callbacks To be implemented by users:
PrototypeC TraceLogCallback(logType.rl_int, *text.Ascii)
;// PureBasic example for using rlTraceLogCallback():
CompilerIf 0
ProcedureC MyCustomLogger( logType.rl_int, *text.Ascii )
Protected msg.s
If *text
msg.s = PeekS(*text,-1,#PB_UTF8)
EndIf
Debug Str(logType)+": "+msg
EndProcedure
ray::SetTraceLogLevel(#LOG_ALL)
ray::SetTraceLogCallback( @MyCustomLogger() )
CompilerEndIf
; CHANGED FUNCTION NAMES:
;
; GetClipboardText() => GetClipboardTextRaylib()
; SetClipboardText() => SetClipboardTextRaylib()
;
; CloseWindow() => CloseWindowRaylib()
; SetWindowTitle() => SetWindowTitleRaylib()
; HideWindow() => HideWindowRaylib()
;
; LoadImage() => LoadImageRaylib()
; ImageFormat() => ImageFormatRaylib()
; LoadTexture() => LoadTextureRaylib()
; LoadFont() => LoadFontRaylib()
; DrawText() => DrawTextRaylib()
;
; LoadSound() => LoadSoundRaylib()
; PlaySound() => PlaySoundRaylib()
; StopSound() => StopSoundRaylib()
; PauseSound() => PauseSoundRaylib()
; ResumeSound() => ResumeSoundRaylib()
;
;
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
ImportC "bin/raylib_win32_pbhelper.lib"
EndImport
ImportC "bin/raylib_win32_dll.lib"
CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64
ImportC "bin/raylib_win64_pbhelper.lib"
EndImport
ImportC "bin/raylib_win64_dll.lib"
CompilerElse
CompilerError "raylib for Windows: processor error"
CompilerEndIf
CompilerEndIf
CompilerIf #PB_Compiler_OS = #PB_OS_Linux
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
ImportC "bin/libraylib_linux_i386.a"
EndImport
ImportC "bin/libraylib_linux_pbhelper_i386.a"
EndImport
ImportC "-lc -lm -lpthread -ldl -lrt -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor -lGLESv2 -lglfw"
CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64
ImportC "bin/libraylib_linux_amd64.a"
EndImport
ImportC "bin/libraylib_linux_pbhelper_amd64.a"
EndImport
ImportC "-lc -lm -lpthread -ldl -lrt -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor -lGLESv2 -lglfw"
CompilerElse
CompilerError "raylib for Linux: processor error"
CompilerEndIf
CompilerEndIf
CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
CompilerIf #PB_Compiler_Processor = #PB_Processor_x86
ImportC "bin/libraylib_macos_pbhelper_x86.a"
CompilerElseIf #PB_Compiler_Processor = #PB_Processor_x64
ImportC "bin/libraylib_macos_pbhelper_x64.a"
CompilerElse
CompilerError "raylib for macOS: processor error"
CompilerEndIf
ImportC "-framework AppKit -framework IOKit -framework OpenGL"
EndImport
ImportC "bin/libraylib_macos.a"
CompilerEndIf