-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathraylib.jl
4304 lines (4238 loc) · 107 KB
/
raylib.jl
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
const directory_location = @__DIR__
## RAYLIB CONSTANTS
## EDIT THIS PATH
if isfile(directory_location * "/raylib.dll")
const raylib_lib_path = directory_location * "/raylib.dll"
elseif isfile(directory_location * "/raylib.dylib")
const raylib_lib_path = directory_location * "/libraylib.dylib"
else
const raylib_lib_path = directory_location * "/libraylib.so"
end
##
# start enums
# ConfigFlags
const flag_vsync_hint = 64
const flag_fullscreen_mode = 2
const flag_window_resizable = 4
const flag_window_undecorated = 8
const flag_window_hidden = 128
const flag_window_minimized = 512
const flag_window_maximized = 1024
const flag_window_unfocused = 2048
const flag_window_topmost = 4096
const flag_window_always_run = 256
const flag_window_transparent = 16
const flag_window_highdpi = 8192
const flag_window_mouse_passthrough = 16384
const flag_msaa_4x_hint = 32
const flag_interlaced_hint = 65536
# TraceLogLevel
const log_all = 0
const log_trace = 1
const log_debug = 2
const log_info = 3
const log_warning = 4
const log_error = 5
const log_fatal = 6
const log_none = 7
# KeyboardKey
const key_null = 0
const key_apostrophe = 39
const key_comma = 44
const key_minus = 45
const key_period = 46
const key_slash = 47
const key_zero = 48
const key_one = 49
const key_two = 50
const key_three = 51
const key_four = 52
const key_five = 53
const key_six = 54
const key_seven = 55
const key_eight = 56
const key_nine = 57
const key_semicolon = 59
const key_equal = 61
const key_a = 65
const key_b = 66
const key_c = 67
const key_d = 68
const key_e = 69
const key_f = 70
const key_g = 71
const key_h = 72
const key_i = 73
const key_j = 74
const key_k = 75
const key_l = 76
const key_m = 77
const key_n = 78
const key_o = 79
const key_p = 80
const key_q = 81
const key_r = 82
const key_s = 83
const key_t = 84
const key_u = 85
const key_v = 86
const key_w = 87
const key_x = 88
const key_y = 89
const key_z = 90
const key_left_bracket = 91
const key_backslash = 92
const key_right_bracket = 93
const key_grave = 96
const key_space = 32
const key_escape = 256
const key_enter = 257
const key_tab = 258
const key_backspace = 259
const key_insert = 260
const key_delete = 261
const key_right = 262
const key_left = 263
const key_down = 264
const key_up = 265
const key_page_up = 266
const key_page_down = 267
const key_home = 268
const key_end = 269
const key_caps_lock = 280
const key_scroll_lock = 281
const key_num_lock = 282
const key_print_screen = 283
const key_pause = 284
const key_f1 = 290
const key_f2 = 291
const key_f3 = 292
const key_f4 = 293
const key_f5 = 294
const key_f6 = 295
const key_f7 = 296
const key_f8 = 297
const key_f9 = 298
const key_f10 = 299
const key_f11 = 300
const key_f12 = 301
const key_left_shift = 340
const key_left_control = 341
const key_left_alt = 342
const key_left_super = 343
const key_right_shift = 344
const key_right_control = 345
const key_right_alt = 346
const key_right_super = 347
const key_kb_menu = 348
const key_kp_0 = 320
const key_kp_1 = 321
const key_kp_2 = 322
const key_kp_3 = 323
const key_kp_4 = 324
const key_kp_5 = 325
const key_kp_6 = 326
const key_kp_7 = 327
const key_kp_8 = 328
const key_kp_9 = 329
const key_kp_decimal = 330
const key_kp_divide = 331
const key_kp_multiply = 332
const key_kp_subtract = 333
const key_kp_add = 334
const key_kp_enter = 335
const key_kp_equal = 336
const key_back = 4
const key_menu = 82
const key_volume_up = 24
const key_volume_down = 25
# MouseButton
const mouse_button_left = 0
const mouse_button_right = 1
const mouse_button_middle = 2
const mouse_button_side = 3
const mouse_button_extra = 4
const mouse_button_forward = 5
const mouse_button_back = 6
# MouseCursor
const mouse_cursor_default = 0
const mouse_cursor_arrow = 1
const mouse_cursor_ibeam = 2
const mouse_cursor_crosshair = 3
const mouse_cursor_pointing_hand = 4
const mouse_cursor_resize_ew = 5
const mouse_cursor_resize_ns = 6
const mouse_cursor_resize_nwse = 7
const mouse_cursor_resize_nesw = 8
const mouse_cursor_resize_all = 9
const mouse_cursor_not_allowed = 10
# GamepadButton
const gamepad_button_unknown = 0
const gamepad_button_left_face_up = 1
const gamepad_button_left_face_right = 2
const gamepad_button_left_face_down = 3
const gamepad_button_left_face_left = 4
const gamepad_button_right_face_up = 5
const gamepad_button_right_face_right = 6
const gamepad_button_right_face_down = 7
const gamepad_button_right_face_left = 8
const gamepad_button_left_trigger_1 = 9
const gamepad_button_left_trigger_2 = 10
const gamepad_button_right_trigger_1 = 11
const gamepad_button_right_trigger_2 = 12
const gamepad_button_middle_left = 13
const gamepad_button_middle = 14
const gamepad_button_middle_right = 15
const gamepad_button_left_thumb = 16
const gamepad_button_right_thumb = 17
# GamepadAxis
const gamepad_axis_left_x = 0
const gamepad_axis_left_y = 1
const gamepad_axis_right_x = 2
const gamepad_axis_right_y = 3
const gamepad_axis_left_trigger = 4
const gamepad_axis_right_trigger = 5
# MaterialMapIndex
const material_map_albedo = 0
const material_map_metalness = 1
const material_map_normal = 2
const material_map_roughness = 3
const material_map_occlusion = 4
const material_map_emission = 5
const material_map_height = 6
const material_map_cubemap = 7
const material_map_irradiance = 8
const material_map_prefilter = 9
const material_map_brdf = 10
# ShaderLocationIndex
const shader_loc_vertex_position = 0
const shader_loc_vertex_texcoord01 = 1
const shader_loc_vertex_texcoord02 = 2
const shader_loc_vertex_normal = 3
const shader_loc_vertex_tangent = 4
const shader_loc_vertex_color = 5
const shader_loc_matrix_mvp = 6
const shader_loc_matrix_view = 7
const shader_loc_matrix_projection = 8
const shader_loc_matrix_model = 9
const shader_loc_matrix_normal = 10
const shader_loc_vector_view = 11
const shader_loc_color_diffuse = 12
const shader_loc_color_specular = 13
const shader_loc_color_ambient = 14
const shader_loc_map_albedo = 15
const shader_loc_map_metalness = 16
const shader_loc_map_normal = 17
const shader_loc_map_roughness = 18
const shader_loc_map_occlusion = 19
const shader_loc_map_emission = 20
const shader_loc_map_height = 21
const shader_loc_map_cubemap = 22
const shader_loc_map_irradiance = 23
const shader_loc_map_prefilter = 24
const shader_loc_map_brdf = 25
# ShaderUniformDataType
const shader_uniform_float = 0
const shader_uniform_vec2 = 1
const shader_uniform_vec3 = 2
const shader_uniform_vec4 = 3
const shader_uniform_int = 4
const shader_uniform_ivec2 = 5
const shader_uniform_ivec3 = 6
const shader_uniform_ivec4 = 7
const shader_uniform_sampler2d = 8
# ShaderAttributeDataType
const shader_attrib_float = 0
const shader_attrib_vec2 = 1
const shader_attrib_vec3 = 2
const shader_attrib_vec4 = 3
# PixelFormat
const pixelformat_uncompressed_grayscale = 1
const pixelformat_uncompressed_gray_alpha = 2
const pixelformat_uncompressed_r5g6b5 = 3
const pixelformat_uncompressed_r8g8b8 = 4
const pixelformat_uncompressed_r5g5b5a1 = 5
const pixelformat_uncompressed_r4g4b4a4 = 6
const pixelformat_uncompressed_r8g8b8a8 = 7
const pixelformat_uncompressed_r32 = 8
const pixelformat_uncompressed_r32g32b32 = 9
const pixelformat_uncompressed_r32g32b32a32 = 10
const pixelformat_compressed_dxt1_rgb = 11
const pixelformat_compressed_dxt1_rgba = 12
const pixelformat_compressed_dxt3_rgba = 13
const pixelformat_compressed_dxt5_rgba = 14
const pixelformat_compressed_etc1_rgb = 15
const pixelformat_compressed_etc2_rgb = 16
const pixelformat_compressed_etc2_eac_rgba = 17
const pixelformat_compressed_pvrt_rgb = 18
const pixelformat_compressed_pvrt_rgba = 19
const pixelformat_compressed_astc_4x4_rgba = 20
const pixelformat_compressed_astc_8x8_rgba = 21
# TextureFilter
const texture_filter_point = 0
const texture_filter_bilinear = 1
const texture_filter_trilinear = 2
const texture_filter_anisotropic_4x = 3
const texture_filter_anisotropic_8x = 4
const texture_filter_anisotropic_16x = 5
# TextureWrap
const texture_wrap_repeat = 0
const texture_wrap_clamp = 1
const texture_wrap_mirror_repeat = 2
const texture_wrap_mirror_clamp = 3
# CubemapLayout
const cubemap_layout_auto_detect = 0
const cubemap_layout_line_vertical = 1
const cubemap_layout_line_horizontal = 2
const cubemap_layout_cross_three_by_four = 3
const cubemap_layout_cross_four_by_three = 4
const cubemap_layout_panorama = 5
# FontType
const font_default = 0
const font_bitmap = 1
const font_sdf = 2
# BlendMode
const blend_alpha = 0
const blend_additive = 1
const blend_multiplied = 2
const blend_add_colors = 3
const blend_subtract_colors = 4
const blend_alpha_premultiply = 5
const blend_custom = 6
# Gesture
const gesture_none = 0
const gesture_tap = 1
const gesture_doubletap = 2
const gesture_hold = 4
const gesture_drag = 8
const gesture_swipe_right = 16
const gesture_swipe_left = 32
const gesture_swipe_up = 64
const gesture_swipe_down = 128
const gesture_pinch_in = 256
const gesture_pinch_out = 512
# CameraMode
const camera_custom = 0
const camera_free = 1
const camera_orbital = 2
const camera_first_person = 3
const camera_third_person = 4
# CameraProjection
const camera_perspective = 0
const camera_orthographic = 1
# NPatchLayout
const npatch_nine_patch = 0
const npatch_three_patch_vertical = 1
const npatch_three_patch_horizontal = 2
# end enums
# start structs
struct Vector2
x::Cfloat
y::Cfloat
end
struct Vector3
x::Cfloat
y::Cfloat
z::Cfloat
end
struct Vector4
x::Cfloat
y::Cfloat
z::Cfloat
w::Cfloat
end
struct GLMatrix
m0::Cfloat
m4::Cfloat
m8::Cfloat
m12::Cfloat
m1::Cfloat
m5::Cfloat
m9::Cfloat
m13::Cfloat
m2::Cfloat
m6::Cfloat
m10::Cfloat
m14::Cfloat
m3::Cfloat
m7::Cfloat
m11::Cfloat
m15::Cfloat
end
struct Color
r::Cuchar
g::Cuchar
b::Cuchar
a::Cuchar
end
struct Rectangle
x::Cfloat
y::Cfloat
width::Cfloat
height::Cfloat
end
struct Image
data::Ptr{Cvoid}
width::Cint
height::Cint
mipmaps::Cint
format::Cint
end
struct Texture
id::Cuint
width::Cint
height::Cint
mipmaps::Cint
format::Cint
end
struct RenderTexture
id::Cuint
texture::Texture
depth::Texture
end
struct NPatchInfo
source::Rectangle
left::Cint
top::Cint
right::Cint
bottom::Cint
layout::Cint
end
struct GlyphInfo
value::Cint
offsetX::Cint
offsetY::Cint
advanceX::Cint
image::Image
end
struct Font
baseSize::Cint
glyphCount::Cint
glyphPadding::Cint
texture::Texture
recs::Ptr{Rectangle}
glyphs::Ptr{GlyphInfo}
end
struct Camera3D
position::Vector3
target::Vector3
up::Vector3
fovy::Cfloat
projection::Cint
end
struct Camera2D
offset::Vector2
target::Vector2
rotation::Cfloat
zoom::Cfloat
end
struct Mesh
vertexCount::Cint
triangleCount::Cint
vertices::Ptr{Cfloat}
texcoords::Ptr{Cfloat}
texcoords2::Ptr{Cfloat}
normals::Ptr{Cfloat}
tangents::Ptr{Cfloat}
colors::Ptr{Cuchar}
indices::Ptr{Cushort}
animVertices::Ptr{Cfloat}
animNormals::Ptr{Cfloat}
boneIds::Ptr{Cuchar}
boneWeights::Ptr{Cfloat}
vaoId::Cuint
vboId::Ptr{Cuint}
end
struct Shader
id::Cuint
locs::Ptr{Cint}
end
struct MaterialMap
texture::Texture
color::Color
value::Cfloat
end
struct Material
shader::Shader
maps::Ptr{MaterialMap}
params::Ptr{Cfloat}
end
struct Transform
translation::Vector3
rotation::Vector4
scale::Vector3
end
struct BoneInfo
name::Ptr{Cchar}
parent::Cint
end
struct Model
transform::GLMatrix
meshCount::Cint
materialCount::Cint
meshes::Ptr{Mesh}
materials::Ptr{Material}
meshMaterial::Ptr{Cint}
boneCount::Cint
bones::Ptr{BoneInfo}
bindPose::Ptr{Transform}
end
struct ModelAnimation
boneCount::Cint
frameCount::Cint
bones::Ptr{BoneInfo}
framePoses::Ptr{Ptr{Transform}}
end
struct Ray
position::Vector3
direction::Vector3
end
struct RayCollision
hit::Bool
distance::Cfloat
point::Vector3
normal::Vector3
end
struct BoundingBox
min::Vector3
max::Vector3
end
struct Wave
frameCount::Cuint
sampleRate::Cuint
sampleSize::Cuint
channels::Cuint
data::Ptr{Cvoid}
end
struct AudioStream
buffer::Ptr{Cvoid}
processor::Ptr{Cvoid}
sampleRate::Cuint
sampleSize::Cuint
channels::Cuint
end
struct Sound
stream::AudioStream
frameCount::Cuint
end
struct Music
stream::AudioStream
frameCount::Cuint
looping::Bool
ctxType::Cint
ctxData::Ptr{Cvoid}
end
struct VrDeviceInfo
hResolution::Cint
vResolution::Cint
hScreenSize::Cfloat
vScreenSize::Cfloat
vScreenCenter::Cfloat
eyeToScreenDistance::Cfloat
lensSeparationDistance::Cfloat
interpupillaryDistance::Cfloat
lensDistortionValues::Ptr{Cfloat}
chromaAbCorrection::Ptr{Cfloat}
end
struct VrStereoConfig
projection::Ptr{GLMatrix}
viewOffset::Ptr{GLMatrix}
leftLensCenter::Ptr{Cfloat}
rightLensCenter::Ptr{Cfloat}
leftScreenCenter::Ptr{Cfloat}
rightScreenCenter::Ptr{Cfloat}
scale::Ptr{Cfloat}
scaleIn::Ptr{Cfloat}
end
struct FilePathList
capacity::Cuint
count::Cuint
paths::Ptr{Ptr{Cchar}}
end
# end structs
# start functions
function InitWindow(width::Int64, height::Int64, title::String)
ccall(
(:InitWindow, raylib_lib_path),
Cvoid,
(Cint, Cint, Ptr{Cchar}),
width,
height,
title,
)
end
function WindowShouldClose()
return ccall((:WindowShouldClose, raylib_lib_path), Bool, ())
end
function CloseWindow()
ccall((:CloseWindow, raylib_lib_path), Cvoid, ())
end
function IsWindowReady()
return ccall((:IsWindowReady, raylib_lib_path), Bool, ())
end
function IsWindowFullscreen()
return ccall((:IsWindowFullscreen, raylib_lib_path), Bool, ())
end
function IsWindowHidden()
return ccall((:IsWindowHidden, raylib_lib_path), Bool, ())
end
function IsWindowMinimized()
return ccall((:IsWindowMinimized, raylib_lib_path), Bool, ())
end
function IsWindowMaximized()
return ccall((:IsWindowMaximized, raylib_lib_path), Bool, ())
end
function IsWindowFocused()
return ccall((:IsWindowFocused, raylib_lib_path), Bool, ())
end
function IsWindowResized()
return ccall((:IsWindowResized, raylib_lib_path), Bool, ())
end
function IsWindowState(flag::Cuint)
return ccall((:IsWindowState, raylib_lib_path), Bool, (Cuint,), flag)
end
function SetWindowState(flags::Cuint)
ccall((:SetWindowState, raylib_lib_path), Cvoid, (Cuint,), flags)
end
function ClearWindowState(flags::Cuint)
ccall((:ClearWindowState, raylib_lib_path), Cvoid, (Cuint,), flags)
end
function ToggleFullscreen()
ccall((:ToggleFullscreen, raylib_lib_path), Cvoid, ())
end
function MaximizeWindow()
ccall((:MaximizeWindow, raylib_lib_path), Cvoid, ())
end
function MinimizeWindow()
ccall((:MinimizeWindow, raylib_lib_path), Cvoid, ())
end
function RestoreWindow()
ccall((:RestoreWindow, raylib_lib_path), Cvoid, ())
end
function SetWindowIcon(image::Image)
ccall((:SetWindowIcon, raylib_lib_path), Cvoid, (Image,), image)
end
function SetWindowTitle(title::String)
ccall((:SetWindowTitle, raylib_lib_path), Cvoid, (Ptr{Cchar},), title)
end
function SetWindowPosition(x::Int64, y::Int64)
ccall((:SetWindowPosition, raylib_lib_path), Cvoid, (Cint, Cint), x, y)
end
function SetWindowMonitor(monitor::Int64)
ccall((:SetWindowMonitor, raylib_lib_path), Cvoid, (Cint,), monitor)
end
function SetWindowMinSize(width::Int64, height::Int64)
ccall((:SetWindowMinSize, raylib_lib_path), Cvoid, (Cint, Cint), width, height)
end
function SetWindowSize(width::Int64, height::Int64)
ccall((:SetWindowSize, raylib_lib_path), Cvoid, (Cint, Cint), width, height)
end
function SetWindowOpacity(opacity::Float64)
ccall((:SetWindowOpacity, raylib_lib_path), Cvoid, (Cfloat,), opacity)
end
function GetWindowHandle()
return ccall((:GetWindowHandle, raylib_lib_path), Ptr{Cvoid}, ())
end
function GetScreenWidth()
return ccall((:GetScreenWidth, raylib_lib_path), Cint, ())
end
function GetScreenHeight()
return ccall((:GetScreenHeight, raylib_lib_path), Cint, ())
end
function GetRenderWidth()
return ccall((:GetRenderWidth, raylib_lib_path), Cint, ())
end
function GetRenderHeight()
return ccall((:GetRenderHeight, raylib_lib_path), Cint, ())
end
function GetMonitorCount()
return ccall((:GetMonitorCount, raylib_lib_path), Cint, ())
end
function GetCurrentMonitor()
return ccall((:GetCurrentMonitor, raylib_lib_path), Cint, ())
end
function GetMonitorPosition(monitor::Int64)
return ccall((:GetMonitorPosition, raylib_lib_path), Vector2, (Cint,), monitor)
end
function GetMonitorWidth(monitor::Int64)
return ccall((:GetMonitorWidth, raylib_lib_path), Cint, (Cint,), monitor)
end
function GetMonitorHeight(monitor::Int64)
return ccall((:GetMonitorHeight, raylib_lib_path), Cint, (Cint,), monitor)
end
function GetMonitorPhysicalWidth(monitor::Int64)
return ccall((:GetMonitorPhysicalWidth, raylib_lib_path), Cint, (Cint,), monitor)
end
function GetMonitorPhysicalHeight(monitor::Int64)
return ccall((:GetMonitorPhysicalHeight, raylib_lib_path), Cint, (Cint,), monitor)
end
function GetMonitorRefreshRate(monitor::Int64)
return ccall((:GetMonitorRefreshRate, raylib_lib_path), Cint, (Cint,), monitor)
end
function GetWindowPosition()
return ccall((:GetWindowPosition, raylib_lib_path), Vector2, ())
end
function GetWindowScaleDPI()
return ccall((:GetWindowScaleDPI, raylib_lib_path), Vector2, ())
end
function GetMonitorName(monitor::Int64)
return ccall((:GetMonitorName, raylib_lib_path), Ptr{Cchar}, (Cint,), monitor)
end
function SetClipboardText(text::String)
ccall((:SetClipboardText, raylib_lib_path), Cvoid, (Ptr{Cchar},), text)
end
function GetClipboardText()
return ccall((:GetClipboardText, raylib_lib_path), Ptr{Cchar}, ())
end
function EnableEventWaiting()
ccall((:EnableEventWaiting, raylib_lib_path), Cvoid, ())
end
function DisableEventWaiting()
ccall((:DisableEventWaiting, raylib_lib_path), Cvoid, ())
end
function SwapScreenBuffer()
ccall((:SwapScreenBuffer, raylib_lib_path), Cvoid, ())
end
function PollInputEvents()
ccall((:PollInputEvents, raylib_lib_path), Cvoid, ())
end
function WaitTime(seconds::Cdouble)
ccall((:WaitTime, raylib_lib_path), Cvoid, (Cdouble,), seconds)
end
function ShowCursor()
ccall((:ShowCursor, raylib_lib_path), Cvoid, ())
end
function HideCursor()
ccall((:HideCursor, raylib_lib_path), Cvoid, ())
end
function IsCursorHidden()
return ccall((:IsCursorHidden, raylib_lib_path), Bool, ())
end
function EnableCursor()
ccall((:EnableCursor, raylib_lib_path), Cvoid, ())
end
function DisableCursor()
ccall((:DisableCursor, raylib_lib_path), Cvoid, ())
end
function IsCursorOnScreen()
return ccall((:IsCursorOnScreen, raylib_lib_path), Bool, ())
end
function ClearBackground(color::Color)
ccall((:ClearBackground, raylib_lib_path), Cvoid, (Color,), color)
end
function BeginDrawing()
ccall((:BeginDrawing, raylib_lib_path), Cvoid, ())
end
function EndDrawing()
ccall((:EndDrawing, raylib_lib_path), Cvoid, ())
end
function BeginMode2D(camera::Camera2D)
ccall((:BeginMode2D, raylib_lib_path), Cvoid, (Camera2D,), camera)
end
function EndMode2D()
ccall((:EndMode2D, raylib_lib_path), Cvoid, ())
end
function BeginMode3D(camera::Camera3D)
ccall((:BeginMode3D, raylib_lib_path), Cvoid, (Camera3D,), camera)
end
function EndMode3D()
ccall((:EndMode3D, raylib_lib_path), Cvoid, ())
end
function BeginTextureMode(target::RenderTexture)
ccall((:BeginTextureMode, raylib_lib_path), Cvoid, (RenderTexture,), target)
end
function EndTextureMode()
ccall((:EndTextureMode, raylib_lib_path), Cvoid, ())
end
function BeginShaderMode(shader::Shader)
ccall((:BeginShaderMode, raylib_lib_path), Cvoid, (Shader,), shader)
end
function EndShaderMode()
ccall((:EndShaderMode, raylib_lib_path), Cvoid, ())
end
function BeginBlendMode(mode::Int64)
ccall((:BeginBlendMode, raylib_lib_path), Cvoid, (Cint,), mode)
end
function EndBlendMode()
ccall((:EndBlendMode, raylib_lib_path), Cvoid, ())
end
function BeginScissorMode(x::Int64, y::Int64, width::Int64, height::Int64)
ccall(
(:BeginScissorMode, raylib_lib_path),
Cvoid,
(Cint, Cint, Cint, Cint),
x,
y,
width,
height,
)
end
function EndScissorMode()
ccall((:EndScissorMode, raylib_lib_path), Cvoid, ())
end
function BeginVrStereoMode(config::VrStereoConfig)
ccall((:BeginVrStereoMode, raylib_lib_path), Cvoid, (VrStereoConfig,), config)
end
function EndVrStereoMode()
ccall((:EndVrStereoMode, raylib_lib_path), Cvoid, ())
end
function LoadVrStereoConfig(device::VrDeviceInfo)
return ccall(
(:LoadVrStereoConfig, raylib_lib_path),
VrStereoConfig,
(VrDeviceInfo,),
device,
)
end
function UnloadVrStereoConfig(config::VrStereoConfig)
ccall((:UnloadVrStereoConfig, raylib_lib_path), Cvoid, (VrStereoConfig,), config)
end
function LoadShader(vsFileName::String, fsFileName::String)
return ccall(
(:LoadShader, raylib_lib_path),
Shader,
(Ptr{Cchar}, Ptr{Cchar}),
vsFileName,
fsFileName,
)
end
function LoadShaderFromMemory(vsCode::String, fsCode::String)
return ccall(
(:LoadShaderFromMemory, raylib_lib_path),
Shader,
(Ptr{Cchar}, Ptr{Cchar}),
vsCode,
fsCode,
)
end
function GetShaderLocation(shader::Shader, uniformName::String)
return ccall(
(:GetShaderLocation, raylib_lib_path),
Cint,
(Shader, Ptr{Cchar}),
shader,
uniformName,
)
end
function GetShaderLocationAttrib(shader::Shader, attribName::String)
return ccall(
(:GetShaderLocationAttrib, raylib_lib_path),
Cint,
(Shader, Ptr{Cchar}),
shader,
attribName,
)
end
function SetShaderValue(
shader::Shader,
locIndex::Int64,
value::Ptr{Cvoid},
uniformType::Int64,
)
ccall(
(:SetShaderValue, raylib_lib_path),
Cvoid,
(Shader, Cint, Ptr{Cvoid}, Cint),
shader,
locIndex,
value,
uniformType,
)
end
function SetShaderValueV(
shader::Shader,
locIndex::Int64,
value::Ptr{Cvoid},
uniformType::Int64,
count::Int64,
)
ccall(
(:SetShaderValueV, raylib_lib_path),
Cvoid,
(Shader, Cint, Ptr{Cvoid}, Cint, Cint),
shader,
locIndex,
value,
uniformType,
count,
)
end
function SetShaderValueMatrix(shader::Shader, locIndex::Int64, mat::GLMatrix)
ccall(
(:SetShaderValueMatrix, raylib_lib_path),
Cvoid,
(Shader, Cint, GLMatrix),
shader,
locIndex,
mat,
)
end
function SetShaderValueTexture(shader::Shader, locIndex::Int64, texture::Texture)
ccall(
(:SetShaderValueTexture, raylib_lib_path),
Cvoid,
(Shader, Cint, Texture),
shader,
locIndex,
texture,
)
end
function UnloadShader(shader::Shader)
ccall((:UnloadShader, raylib_lib_path), Cvoid, (Shader,), shader)
end
function GetMouseRay(mousePosition::Vector2, camera::Camera3D)
return ccall(
(:GetMouseRay, raylib_lib_path),
Ray,
(Vector2, Camera3D),
mousePosition,
camera,
)
end
function GetCameraMatrix(camera::Camera3D)
return ccall((:GetCameraMatrix, raylib_lib_path), GLMatrix, (Camera3D,), camera)
end
function GetCameraMatrix2D(camera::Camera2D)
return ccall((:GetCameraMatrix2D, raylib_lib_path), GLMatrix, (Camera2D,), camera)
end
function GetWorldToScreen(position::Vector3, camera::Camera3D)
return ccall(
(:GetWorldToScreen, raylib_lib_path),
Vector2,
(Vector3, Camera3D),
position,
camera,
)
end
function GetScreenToWorld2D(position::Vector2, camera::Camera2D)
return ccall(
(:GetScreenToWorld2D, raylib_lib_path),
Vector2,
(Vector2, Camera2D),
position,
camera,
)
end
function GetWorldToScreenEx(
position::Vector3,
camera::Camera3D,
width::Int64,
height::Int64,
)
return ccall(
(:GetWorldToScreenEx, raylib_lib_path),
Vector2,
(Vector3, Camera3D, Cint, Cint),
position,
camera,
width,
height,
)
end
function GetWorldToScreen2D(position::Vector2, camera::Camera2D)
return ccall(
(:GetWorldToScreen2D, raylib_lib_path),