forked from denise-amiga/raylib-fb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
raylib.bi
1236 lines (1158 loc) · 55.3 KB
/
raylib.bi
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.
'
'*********************************************************************************************
#pragma once
#include once "crt/long.bi"
#include once "crt/stdarg.bi"
#inclib "raylib"
#ifdef __FB_LINUX__
#inclib "X11"
#endif
extern "C"
#define RAYLIB_H
#define RLAPI
const PI = 3.14159265358979323846f
const DEG2RAD = PI / 180.0f
const RAD2DEG = 180.0f / PI
const MAX_TOUCH_POINTS = 10
#define RL_MALLOC(sz) malloc(sz)
#define RL_CALLOC(n, sz) calloc(n, sz)
#define RL_REALLOC(ptr, sz) realloc(ptr, sz)
#define RL_FREE(ptr) free(ptr)
#define LIGHTGRAY Color( 200, 200, 200, 255 ) ' Light Gray
#define GRAY Color( 130, 130, 130, 255 ) ' Gray
#define DARKGRAY Color( 80, 80, 80, 255 ) ' Dark Gray
#define YELLOW Color( 253, 249, 0, 255 ) ' Yellow
#define GOLD Color( 255, 203, 0, 255 ) ' Gold
#define ORANGE Color( 255, 161, 0, 255 ) ' Orange
#define PINK Color( 255, 109, 194, 255 ) ' Pink
#define RED Color( 230, 41, 55, 255 ) ' Red
#define MAROON Color( 190, 33, 55, 255 ) ' Maroon
#define GREEN Color( 0, 228, 48, 255 ) ' Green
#define LIME Color( 0, 158, 47, 255 ) ' Lime
#define DARKGREEN Color( 0, 117, 44, 255 ) ' Dark Green
#define SKYBLUE Color( 102, 191, 255, 255 ) ' Sky Blue
#define BLUE Color( 0, 121, 241, 255 ) ' Blue
#define DARKBLUE Color( 0, 82, 172, 255 ) ' Dark Blue
#define PURPLE Color( 200, 122, 255, 255 ) ' Purple
#define VIOLET Color( 135, 60, 190, 255 ) ' Violet
#define DARKPURPLE Color( 112, 31, 126, 255 ) ' Dark Purple
#define BEIGE Color( 211, 176, 131, 255 ) ' Beige
#define BROWN Color( 127, 106, 79, 255 ) ' Brown
#define DARKBROWN Color( 76, 63, 47, 255 ) ' Dark Brown
#define WHITE Color( 255, 255, 255, 255 ) ' White
#define BLACK Color( 0, 0, 0, 255 ) ' Black
#define BLANK Color( 0, 0, 0, 0 ) ' Blank (Transparent)
#define MAGENTA Color( 255, 0, 255, 255 ) ' Magenta
#define RAYWHITE Color( 245, 245, 245, 255 ) ' My own White (raylib logo)
#define FormatText TextFormat
#define SubText TextSubtext
#define ShowWindow UnhideWindow
#define LoadText LoadFileText
type Vector2
x as single
y as single
declare constructor()
declare constructor(x as single, y as single)
end type
constructor Vector2(x as single, y as single)
this.x = x
this.y = y
end constructor
constructor Vector2()
end constructor
type Vector3
x as single
y as single
z as single
declare constructor()
declare constructor(x as single, y as single, z as single)
end type
constructor Vector3()
end constructor
constructor Vector3(x as single, y as single, z as single)
this.x = x
this.y = y
this.z = z
end constructor
type Vector4
x as single
y as single
z as single
w as single
declare constructor()
declare constructor(x as single, y as single, z as single, w as single)
end type
constructor Vector4()
end constructor
constructor Vector4(x as single, y as single, z as single, w as single)
this.x = x
this.y = y
this.z = z
this.w = w
end constructor
type Quaternion as Vector4
type Matrix
m0 as single
m4 as single
m8 as single
m12 as single
m1 as single
m5 as single
m9 as single
m13 as single
m2 as single
m6 as single
m10 as single
m14 as single
m3 as single
m7 as single
m11 as single
m15 as single
end type
type Color
r as ubyte
g as ubyte
b as ubyte
a as ubyte
declare constructor()
declare constructor(r as ubyte, g as ubyte, b as ubyte, a as ubyte)
end type
constructor Color()
end constructor
constructor Color(r as ubyte, g as ubyte, b as ubyte, a as ubyte)
this.r = r
this.g = g
this.b = b
this.a = a
end constructor
type Rectangle
x as single
y as single
width as single
height as single
declare constructor()
declare constructor(x as single, y as single, width as single, height as single)
end type
constructor Rectangle()
end constructor
constructor Rectangle(x as single, y as single, width as single, height as single)
this.x = x
this.y = y
this.width = width
this.height = height
end constructor
type Image
data as any ptr
width as long
height as long
mipmaps as long
format as long
end type
type Texture2D
id as ulong
width as long
height as long
mipmaps as long
format as long
end type
type Texture as Texture2D
type TextureCubemap as Texture2D
type RenderTexture2D
id as ulong
texture as Texture2D
depth as Texture2D
depthTexture as boolean
end type
type RenderTexture as RenderTexture2D
type NPatchInfo
sourceRec as Rectangle
left as long
top as long
right as long
bottom as long
as long type
end type
type CharInfo
value as long
offsetX as long
offsetY as long
advanceX as long
image as Image
end type
type Font
baseSize as long
charsCount as long
texture as Texture2D
recs as Rectangle ptr
chars as CharInfo ptr
end type
type SpriteFont as Font
type Camera3D
position as Vector3
target as Vector3
up as Vector3
fovy as single
as long type
end type
type Camera as Camera3D
type Camera2D
offset as Vector2
target as Vector2
rotation as single
zoom as single
end type
type Mesh
vertexCount as long
triangleCount as long
vertices as single ptr
texcoords as single ptr
texcoords2 as single ptr
normals as single ptr
tangents as single ptr
colors as ubyte ptr
indices as ushort ptr
animVertices as single ptr
animNormals as single ptr
boneIds as long ptr
boneWeights as single ptr
vaoId as ulong
vboId as ulong ptr
end type
type Shader
id as ulong
locs as long ptr
end type
type MaterialMap
texture as Texture2D
color as Color
value as single
end type
type Material
shader as Shader
maps as MaterialMap ptr
params as single ptr
end type
type Transform
translation as Vector3
rotation as Quaternion
scale as Vector3
end type
type BoneInfo
name as zstring * 32
parent as long
end type
type Model
transform as Matrix
meshCount as long
meshes as Mesh ptr
materialCount as long
materials as Material ptr
meshMaterial as long ptr
boneCount as long
bones as BoneInfo ptr
bindPose as Transform ptr
end type
type ModelAnimation
boneCount as long
bones as BoneInfo ptr
frameCount as long
framePoses as Transform ptr ptr
end type
type Ray
position as Vector3
direction as Vector3
end type
type RayHitInfo
hit as boolean
distance as single
position as Vector3
normal as Vector3
end type
type BoundingBox
min as Vector3
max as Vector3
end type
type Wave
sampleCount as ulong
sampleRate as ulong
sampleSize as ulong
channels as ulong
data as any ptr
end type
type rAudioBuffer as rAudioBuffer
type AudioStream
sampleRate as ulong
sampleSize as ulong
channels as ulong
buffer as rAudioBuffer ptr
end type
type Sound
sampleCount as ulong
stream as AudioStream
end type
type Music
ctxType as long
ctxData as any ptr
sampleCount as ulong
loopCount as ulong
stream as AudioStream
end type
type VrDeviceInfo
hResolution as long
vResolution as long
hScreenSize as single
vScreenSize as single
vScreenCenter as single
eyeToScreenDistance as single
lensSeparationDistance as single
interpupillaryDistance as single
lensDistortionValues(0 to 3) as single
chromaAbCorrection(0 to 3) as single
end type
type ConfigFlag as long
enum
FLAG_RESERVED = 1
FLAG_FULLSCREEN_MODE = 2
FLAG_WINDOW_RESIZABLE = 4
FLAG_WINDOW_UNDECORATED = 8
FLAG_WINDOW_TRANSPARENT = 16
FLAG_WINDOW_HIDDEN = 128
FLAG_WINDOW_ALWAYS_RUN = 256
FLAG_MSAA_4X_HINT = 32
FLAG_VSYNC_HINT = 64
end enum
type TraceLogType as long
enum
LOG_ALL = 0
LOG_TRACE
LOG_DEBUG
LOG_INFO
LOG_WARNING
LOG_ERROR
LOG_FATAL
LOG_NONE
end enum
type KeyboardKey as long
enum
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
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
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
end enum
type AndroidButton as long
enum
KEY_BACK = 4
KEY_MENU = 82
KEY_VOLUME_UP = 24
KEY_VOLUME_DOWN = 25
end enum
type MouseButton as long
enum
MOUSE_LEFT_BUTTON = 0
MOUSE_RIGHT_BUTTON = 1
MOUSE_MIDDLE_BUTTON = 2
end enum
type GamepadNumber as long
enum
GAMEPAD_PLAYER1 = 0
GAMEPAD_PLAYER2 = 1
GAMEPAD_PLAYER3 = 2
GAMEPAD_PLAYER4 = 3
end enum
type GamepadButton as long
enum
GAMEPAD_BUTTON_UNKNOWN = 0
GAMEPAD_BUTTON_LEFT_FACE_UP
GAMEPAD_BUTTON_LEFT_FACE_RIGHT
GAMEPAD_BUTTON_LEFT_FACE_DOWN
GAMEPAD_BUTTON_LEFT_FACE_LEFT
GAMEPAD_BUTTON_RIGHT_FACE_UP
GAMEPAD_BUTTON_RIGHT_FACE_RIGHT
GAMEPAD_BUTTON_RIGHT_FACE_DOWN
GAMEPAD_BUTTON_RIGHT_FACE_LEFT
GAMEPAD_BUTTON_LEFT_TRIGGER_1
GAMEPAD_BUTTON_LEFT_TRIGGER_2
GAMEPAD_BUTTON_RIGHT_TRIGGER_1
GAMEPAD_BUTTON_RIGHT_TRIGGER_2
GAMEPAD_BUTTON_MIDDLE_LEFT
GAMEPAD_BUTTON_MIDDLE
GAMEPAD_BUTTON_MIDDLE_RIGHT
GAMEPAD_BUTTON_LEFT_THUMB
GAMEPAD_BUTTON_RIGHT_THUMB
end enum
type GamepadAxis as long
enum
GAMEPAD_AXIS_UNKNOWN = 0
GAMEPAD_AXIS_LEFT_X
GAMEPAD_AXIS_LEFT_Y
GAMEPAD_AXIS_RIGHT_X
GAMEPAD_AXIS_RIGHT_Y
GAMEPAD_AXIS_LEFT_TRIGGER
GAMEPAD_AXIS_RIGHT_TRIGGER
end enum
type ShaderLocationIndex as long
enum
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_METALNESS
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
end enum
const LOC_MAP_DIFFUSE = LOC_MAP_ALBEDO
const LOC_MAP_SPECULAR = LOC_MAP_METALNESS
type ShaderUniformDataType as long
enum
UNIFORM_FLOAT = 0
UNIFORM_VEC2
UNIFORM_VEC3
UNIFORM_VEC4
UNIFORM_INT
UNIFORM_IVEC2
UNIFORM_IVEC3
UNIFORM_IVEC4
UNIFORM_SAMPLER2D
end enum
type MaterialMapType as long
enum
MAP_ALBEDO = 0
MAP_METALNESS = 1
MAP_NORMAL = 2
MAP_ROUGHNESS = 3
MAP_OCCLUSION
MAP_EMISSION
MAP_HEIGHT
MAP_CUBEMAP
MAP_IRRADIANCE
MAP_PREFILTER
MAP_BRDF
end enum
const MAP_DIFFUSE = MAP_ALBEDO
const MAP_SPECULAR = MAP_METALNESS
type PixelFormat as long
enum
UNCOMPRESSED_GRAYSCALE = 1
UNCOMPRESSED_GRAY_ALPHA
UNCOMPRESSED_R5G6B5
UNCOMPRESSED_R8G8B8
UNCOMPRESSED_R5G5B5A1
UNCOMPRESSED_R4G4B4A4
UNCOMPRESSED_R8G8B8A8
UNCOMPRESSED_R32
UNCOMPRESSED_R32G32B32
UNCOMPRESSED_R32G32B32A32
COMPRESSED_DXT1_RGB
COMPRESSED_DXT1_RGBA
COMPRESSED_DXT3_RGBA
COMPRESSED_DXT5_RGBA
COMPRESSED_ETC1_RGB
COMPRESSED_ETC2_RGB
COMPRESSED_ETC2_EAC_RGBA
COMPRESSED_PVRT_RGB
COMPRESSED_PVRT_RGBA
COMPRESSED_ASTC_4x4_RGBA
COMPRESSED_ASTC_8x8_RGBA
end enum
type TextureFilterMode as long
enum
FILTER_POINT = 0
FILTER_BILINEAR
FILTER_TRILINEAR
FILTER_ANISOTROPIC_4X
FILTER_ANISOTROPIC_8X
FILTER_ANISOTROPIC_16X
end enum
type CubemapLayoutType as long
enum
CUBEMAP_AUTO_DETECT = 0
CUBEMAP_LINE_VERTICAL
CUBEMAP_LINE_HORIZONTAL
CUBEMAP_CROSS_THREE_BY_FOUR
CUBEMAP_CROSS_FOUR_BY_THREE
CUBEMAP_PANORAMA
end enum
type TextureWrapMode as long
enum
WRAP_REPEAT = 0
WRAP_CLAMP
WRAP_MIRROR_REPEAT
WRAP_MIRROR_CLAMP
end enum
type FontType as long
enum
FONT_DEFAULT = 0
FONT_BITMAP
FONT_SDF
end enum
type BlendMode as long
enum
BLEND_ALPHA = 0
BLEND_ADDITIVE
BLEND_MULTIPLIED
end enum
type GestureType as long
enum
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
end enum
type CameraMode as long
enum
CAMERA_CUSTOM = 0
CAMERA_FREE
CAMERA_ORBITAL
CAMERA_FIRST_PERSON
CAMERA_THIRD_PERSON
end enum
type CameraType as long
enum
CAMERA_PERSPECTIVE = 0
CAMERA_ORTHOGRAPHIC
end enum
type NPatchType as long
enum
NPT_9PATCH = 0
NPT_3PATCH_VERTICAL
NPT_3PATCH_HORIZONTAL
end enum
type TraceLogCallback as sub(logType as long, text as const zstring ptr, args as va_list)
declare sub InitWindow(byval width as long, byval height as long, byval title as const zstring ptr)
declare function WindowShouldClose() as boolean
declare sub CloseWindow()
declare function IsWindowReady() as boolean
declare function IsWindowMinimized() as boolean
declare function IsWindowResized() as boolean
declare function IsWindowHidden() as boolean
declare function IsWindowFullscreen() as boolean
declare sub ToggleFullscreen()
declare sub UnhideWindow()
declare sub HideWindow()
declare sub SetWindowIcon(byval image as Image)
declare sub SetWindowTitle(byval title as const zstring ptr)
declare sub SetWindowPosition(byval x as long, byval y as long)
declare sub SetWindowMonitor(byval monitor as long)
declare sub SetWindowMinSize(byval width as long, byval height as long)
declare sub SetWindowSize(byval width as long, byval height as long)
declare function GetWindowHandle() as any ptr
declare function GetScreenWidth() as long
declare function GetScreenHeight() as long
declare function GetMonitorCount() as long
declare function GetMonitorWidth(byval monitor as long) as long
declare function GetMonitorHeight(byval monitor as long) as long
declare function GetMonitorPhysicalWidth(byval monitor as long) as long
declare function GetMonitorPhysicalHeight(byval monitor as long) as long
declare function GetWindowPosition() as Vector2
declare function GetMonitorName(byval monitor as long) as const zstring ptr
declare function GetClipboardText() as const zstring ptr
declare sub SetClipboardText(byval text as const zstring ptr)
declare sub ShowCursor()
declare sub HideCursor()
declare function IsCursorHidden() as boolean
declare sub EnableCursor()
declare sub DisableCursor()
declare sub ClearBackground(byval color as Color)
declare sub BeginDrawing()
declare sub EndDrawing()
declare sub BeginMode2D(byval camera as Camera2D)
declare sub EndMode2D()
declare sub BeginMode3D(byval camera as Camera3D)
declare sub EndMode3D()
declare sub BeginTextureMode(byval target as RenderTexture2D)
declare sub EndTextureMode()
declare sub BeginScissorMode(byval x as long, byval y as long, byval width as long, byval height as long)
declare sub EndScissorMode()
declare function GetMouseRay(byval mousePosition as Vector2, byval camera as Camera) as Ray
declare function GetCameraMatrix(byval camera as Camera) as Matrix
declare function GetCameraMatrix2D(byval camera as Camera2D) as Matrix
declare function GetWorldToScreen(byval position as Vector3, byval camera as Camera) as Vector2
declare function GetWorldToScreenEx(byval position as Vector3, byval camera as Camera, byval width as long, byval height as long) as Vector2
declare function GetWorldToScreen2D(byval position as Vector2, byval camera as Camera2D) as Vector2
declare function GetScreenToWorld2D(byval position as Vector2, byval camera as Camera2D) as Vector2
declare sub SetTargetFPS(byval fps as long)
declare function GetFPS() as long
declare function GetFrameTime() as single
declare function GetTime() as double
declare function ColorToInt(byval color as Color) as long
declare function ColorNormalize(byval color as Color) as Vector4
declare function ColorFromNormalized(byval normalized as Vector4) as Color
declare function ColorToHSV(byval color as Color) as Vector3
declare function ColorFromHSV(byval hsv as Vector3) as Color
declare function GetColor(byval hexValue as long) as Color
declare function Fade(byval color as Color, byval alpha as single) as Color
declare sub SetConfigFlags(byval flags as ulong)
declare sub SetTraceLogLevel(byval logType as long)
declare sub SetTraceLogExit(byval logType as long)
declare sub SetTraceLogCallback(byval callback as TraceLogCallback)
declare sub TraceLog(byval logType as long, byval text as const zstring ptr, ...)
declare sub TakeScreenshot(byval fileName as const zstring ptr)
declare function GetRandomValue(byval min as long, byval max as long) as long
declare function LoadFileData(byval fileName as const zstring ptr, byval bytesRead as ulong ptr) as ubyte ptr
declare sub SaveFileData(byval fileName as const zstring ptr, byval data as any ptr, byval bytesToWrite as ulong)
declare function LoadFileText(byval fileName as const zstring ptr) as zstring ptr
declare sub SaveFileText(byval fileName as const zstring ptr, byval text as zstring ptr)
declare function FileExists(byval fileName as const zstring ptr) as boolean
declare function IsFileExtension(byval fileName as const zstring ptr, byval ext as const zstring ptr) as boolean
declare function DirectoryExists(byval dirPath as const zstring ptr) as boolean
declare function GetExtension(byval fileName as const zstring ptr) as const zstring ptr
declare function GetFileName(byval filePath as const zstring ptr) as const zstring ptr
declare function GetFileNameWithoutExt(byval filePath as const zstring ptr) as const zstring ptr
declare function GetDirectoryPath(byval filePath as const zstring ptr) as const zstring ptr
declare function GetPrevDirectoryPath(byval dirPath as const zstring ptr) as const zstring ptr
declare function GetWorkingDirectory() as const zstring ptr
declare function GetDirectoryFiles(byval dirPath as const zstring ptr, byval count as long ptr) as zstring ptr ptr
declare sub ClearDirectoryFiles()
declare function ChangeDirectory(byval dir as const zstring ptr) as boolean
declare function IsFileDropped() as boolean
declare function GetDroppedFiles(byval count as long ptr) as zstring ptr ptr
declare sub ClearDroppedFiles()
declare function GetFileModTime(byval fileName as const zstring ptr) as clong
declare function CompressData(byval data as ubyte ptr, byval dataLength as long, byval compDataLength as long ptr) as ubyte ptr
declare function DecompressData(byval compData as ubyte ptr, byval compDataLength as long, byval dataLength as long ptr) as ubyte ptr
declare sub SaveStorageValue(byval position as ulong, byval value as long)
declare function LoadStorageValue(byval position as ulong) as long
declare sub OpenURL(byval url as const zstring ptr)
declare function IsKeyPressed(byval key as long) as boolean
declare function IsKeyDown(byval key as long) as boolean
declare function IsKeyReleased(byval key as long) as boolean
declare function IsKeyUp(byval key as long) as boolean
declare sub SetExitKey(byval key as long)
declare function GetKeyPressed() as long
declare function IsGamepadAvailable(byval gamepad as long) as boolean
declare function IsGamepadName(byval gamepad as long, byval name as const zstring ptr) as boolean
declare function GetGamepadName(byval gamepad as long) as const zstring ptr
declare function IsGamepadButtonPressed(byval gamepad as long, byval button as long) as boolean
declare function IsGamepadButtonDown(byval gamepad as long, byval button as long) as boolean
declare function IsGamepadButtonReleased(byval gamepad as long, byval button as long) as boolean
declare function IsGamepadButtonUp(byval gamepad as long, byval button as long) as boolean
declare function GetGamepadButtonPressed() as long
declare function GetGamepadAxisCount(byval gamepad as long) as long
declare function GetGamepadAxisMovement(byval gamepad as long, byval axis as long) as single
declare function IsMouseButtonPressed(byval button as long) as boolean
declare function IsMouseButtonDown(byval button as long) as boolean
declare function IsMouseButtonReleased(byval button as long) as boolean
declare function IsMouseButtonUp(byval button as long) as boolean
declare function GetMouseX() as long
declare function GetMouseY() as long
declare function GetMousePosition() as Vector2
declare sub SetMousePosition(byval x as long, byval y as long)
declare sub SetMouseOffset(byval offsetX as long, byval offsetY as long)
declare sub SetMouseScale(byval scaleX as single, byval scaleY as single)
declare function GetMouseWheelMove() as long
declare function GetTouchX() as long
declare function GetTouchY() as long
declare function GetTouchPosition(byval index as long) as Vector2
declare sub SetGesturesEnabled(byval gestureFlags as ulong)
declare function IsGestureDetected(byval gesture as long) as boolean
declare function GetGestureDetected() as long
declare function GetTouchPointsCount() as long
declare function GetGestureHoldDuration() as single
declare function GetGestureDragVector() as Vector2
declare function GetGestureDragAngle() as single
declare function GetGesturePinchVector() as Vector2
declare function GetGesturePinchAngle() as single
declare sub SetCameraMode(byval camera as Camera, byval mode as long)
declare sub UpdateCamera(byval camera as Camera ptr)
declare sub SetCameraPanControl(byval panKey as long)
declare sub SetCameraAltControl(byval altKey as long)
declare sub SetCameraSmoothZoomControl(byval szKey as long)
declare sub SetCameraMoveControls(byval frontKey as long, byval backKey as long, byval rightKey as long, byval leftKey as long, byval upKey as long, byval downKey as long)
declare sub DrawPixel(byval posX as long, byval posY as long, byval color as Color)
declare sub DrawPixelV(byval position as Vector2, byval color as Color)
declare sub DrawLine(byval startPosX as long, byval startPosY as long, byval endPosX as long, byval endPosY as long, byval color as Color)
declare sub DrawLineV(byval startPos as Vector2, byval endPos as Vector2, byval color as Color)
declare sub DrawLineEx(byval startPos as Vector2, byval endPos as Vector2, byval thick as single, byval color as Color)
declare sub DrawLineBezier(byval startPos as Vector2, byval endPos as Vector2, byval thick as single, byval color as Color)
declare sub DrawLineStrip(byval points as Vector2 ptr, byval numPoints as long, byval color as Color)
declare sub DrawCircle(byval centerX as long, byval centerY as long, byval radius as single, byval color as Color)
declare sub DrawCircleSector(byval center as Vector2, byval radius as single, byval startAngle as long, byval endAngle as long, byval segments as long, byval color as Color)
declare sub DrawCircleSectorLines(byval center as Vector2, byval radius as single, byval startAngle as long, byval endAngle as long, byval segments as long, byval color as Color)
declare sub DrawCircleGradient(byval centerX as long, byval centerY as long, byval radius as single, byval color1 as Color, byval color2 as Color)
declare sub DrawCircleV(byval center as Vector2, byval radius as single, byval color as Color)
declare sub DrawCircleLines(byval centerX as long, byval centerY as long, byval radius as single, byval color as Color)
declare sub DrawEllipse(byval centerX as long, byval centerY as long, byval radiusH as single, byval radiusV as single, byval color as Color)
declare sub DrawEllipseLines(byval centerX as long, byval centerY as long, byval radiusH as single, byval radiusV as single, byval color as Color)
declare sub DrawRing(byval center as Vector2, byval innerRadius as single, byval outerRadius as single, byval startAngle as long, byval endAngle as long, byval segments as long, byval color as Color)
declare sub DrawRingLines(byval center as Vector2, byval innerRadius as single, byval outerRadius as single, byval startAngle as long, byval endAngle as long, byval segments as long, byval color as Color)
declare sub DrawRectangle(byval posX as long, byval posY as long, byval width as long, byval height as long, byval color as Color)
declare sub DrawRectangleV(byval position as Vector2, byval size as Vector2, byval color as Color)
declare sub DrawRectangleRec(byval rec as Rectangle, byval color as Color)
declare sub DrawRectanglePro(byval rec as Rectangle, byval origin as Vector2, byval rotation as single, byval color as Color)
declare sub DrawRectangleGradientV(byval posX as long, byval posY as long, byval width as long, byval height as long, byval color1 as Color, byval color2 as Color)
declare sub DrawRectangleGradientH(byval posX as long, byval posY as long, byval width as long, byval height as long, byval color1 as Color, byval color2 as Color)
declare sub DrawRectangleGradientEx(byval rec as Rectangle, byval col1 as Color, byval col2 as Color, byval col3 as Color, byval col4 as Color)
declare sub DrawRectangleLines(byval posX as long, byval posY as long, byval width as long, byval height as long, byval color as Color)
declare sub DrawRectangleLinesEx(byval rec as Rectangle, byval lineThick as long, byval color as Color)
declare sub DrawRectangleRounded(byval rec as Rectangle, byval roundness as single, byval segments as long, byval color as Color)
declare sub DrawRectangleRoundedLines(byval rec as Rectangle, byval roundness as single, byval segments as long, byval lineThick as long, byval color as Color)
declare sub DrawTriangle(byval v1 as Vector2, byval v2 as Vector2, byval v3 as Vector2, byval color as Color)
declare sub DrawTriangleLines(byval v1 as Vector2, byval v2 as Vector2, byval v3 as Vector2, byval color as Color)
declare sub DrawTriangleFan(byval points as Vector2 ptr, byval numPoints as long, byval color as Color)
declare sub DrawTriangleStrip(byval points as Vector2 ptr, byval pointsCount as long, byval color as Color)
declare sub DrawPoly(byval center as Vector2, byval sides as long, byval radius as single, byval rotation as single, byval color as Color)
declare sub DrawPolyLines(byval center as Vector2, byval sides as long, byval radius as single, byval rotation as single, byval color as Color)
declare function CheckCollisionRecs(byval rec1 as Rectangle, byval rec2 as Rectangle) as boolean
declare function CheckCollisionCircles(byval center1 as Vector2, byval radius1 as single, byval center2 as Vector2, byval radius2 as single) as boolean
declare function CheckCollisionCircleRec(byval center as Vector2, byval radius as single, byval rec as Rectangle) as boolean
declare function GetCollisionRec(byval rec1 as Rectangle, byval rec2 as Rectangle) as Rectangle
declare function CheckCollisionPointRec(byval point as Vector2, byval rec as Rectangle) as boolean
declare function CheckCollisionPointCircle(byval point as Vector2, byval center as Vector2, byval radius as single) as boolean
declare function CheckCollisionPointTriangle(byval point as Vector2, byval p1 as Vector2, byval p2 as Vector2, byval p3 as Vector2) as boolean
declare function LoadImage(byval fileName as const zstring ptr) as Image
declare function LoadImageEx(byval pixels as Color ptr, byval width as long, byval height as long) as Image
declare function LoadImagePro(byval data as any ptr, byval width as long, byval height as long, byval format as long) as Image
declare function LoadImageRaw(byval fileName as const zstring ptr, byval width as long, byval height as long, byval format as long, byval headerSize as long) as Image
declare sub UnloadImage(byval image as Image)
declare sub ExportImage(byval image as Image, byval fileName as const zstring ptr)
declare sub ExportImageAsCode(byval image as Image, byval fileName as const zstring ptr)
declare function GetImageData(byval image as Image) as Color ptr
declare function GetImageDataNormalized(byval image as Image) as Vector4 ptr
declare function GenImageColor(byval width as long, byval height as long, byval color as Color) as Image
declare function GenImageGradientV(byval width as long, byval height as long, byval top as Color, byval bottom as Color) as Image
declare function GenImageGradientH(byval width as long, byval height as long, byval left as Color, byval right as Color) as Image
declare function GenImageGradientRadial(byval width as long, byval height as long, byval density as single, byval inner as Color, byval outer as Color) as Image
declare function GenImageChecked(byval width as long, byval height as long, byval checksX as long, byval checksY as long, byval col1 as Color, byval col2 as Color) as Image
declare function GenImageWhiteNoise(byval width as long, byval height as long, byval factor as single) as Image
declare function GenImagePerlinNoise(byval width as long, byval height as long, byval offsetX as long, byval offsetY as long, byval scale as single) as Image
declare function GenImageCellular(byval width as long, byval height as long, byval tileSize as long) as Image
declare function ImageCopy(byval image as Image) as Image
declare function ImageFromImage(byval image as Image, byval rec as Rectangle) as Image
declare function ImageText(byval text as const zstring ptr, byval fontSize as long, byval color as Color) as Image
declare function ImageTextEx(byval font as Font, byval text as const zstring ptr, byval fontSize as single, byval spacing as single, byval tint as Color) as Image
declare sub ImageToPOT(byval image as Image ptr, byval fillColor as Color)
declare sub ImageFormat(byval image as Image ptr, byval newFormat as long)
declare sub ImageAlphaMask(byval image as Image ptr, byval alphaMask as Image)
declare sub ImageAlphaClear(byval image as Image ptr, byval color as Color, byval threshold as single)
declare sub ImageAlphaCrop(byval image as Image ptr, byval threshold as single)