-
Notifications
You must be signed in to change notification settings - Fork 2
/
raylib-umka.h
14462 lines (13660 loc) · 503 KB
/
raylib-umka.h
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-umka v0.1.0 - Umka bindings for raylib.
*
* https://github.com/RobLoach/raylib-umka
*
* DEPENDENCIES:
* - raylib 4.5 https://www.raylib.com/
* - Umka https://github.com/vtereshkov/umka-lang
*
* NOTE: Do not edit this file, as it is automatically generated.
*
* LICENSE: zlib/libpng
*
* raylib-umka 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) 2022 Rob Loach (https://robloach.net)
*
* 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.
*
**********************************************************************************************/
#ifndef RAYLIB_UMKA_H_
#define RAYLIB_UMKA_H_
#if defined(__cplusplus)
extern "C" {
#endif
/**
* Adds the raylib module to an Umka instance.
*
* @param umka The Umka instance you would like to add the raylib module to.
*
* @return True if it succeeds, false otherwise.
*/
bool umkaAddRaylib(void *umka);
#if defined(__cplusplus)
}
#endif
#endif // RAYLIB_UMKA_H_
#ifdef RAYLIB_UMKA_IMPLEMENTATION
#ifndef RAYLIB_UMKA_IMPLEMENTATION_ONCE
#define RAYLIB_UMKA_IMPLEMENTATION_ONCE
// raylib.h
#ifndef RAYLIB_UMKA_RAYLIB_H
#define RAYLIB_UMKA_RAYLIB_H "raylib.h"
#endif
#include RAYLIB_UMKA_RAYLIB_H
// raymath.h
#ifndef RAYLIB_UMKA_RAYMATH_H
#define RAYLIB_UMKA_RAYMATH_H "raymath.h"
#endif
#include RAYLIB_UMKA_RAYMATH_H
// rlgl.h
#ifndef RAYLIB_UMKA_RLGL_H
#define RAYLIB_UMKA_RLGL_H "rlgl.h"
#endif
#include RAYLIB_UMKA_RLGL_H
// umka_api.h
#ifndef RAYLIB_UMKA_UMKA_API_H
#define RAYLIB_UMKA_UMKA_API_H "umka_api.h"
#endif
#include RAYLIB_UMKA_UMKA_API_H
// memcpy()
#ifndef RAYLIB_UMKA_MEMCPY
#include <string.h>
#define RAYLIB_UMKA_MEMCPY memcpy
#endif
#if defined(__cplusplus)
extern "C" {
#endif
/**
* Umka bindings for InitWindow().
*
* @see InitWindow()
*/
void umkaInitWindow(UmkaStackSlot *params, UmkaStackSlot *result) {
int width = params[2].intVal;
int height = params[1].intVal;
const char * title = (const char *)params[0].ptrVal;
InitWindow(width, height, title);
}
/**
* Umka bindings for WindowShouldClose().
*
* @see WindowShouldClose()
*/
void umkaWindowShouldClose(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = (int)WindowShouldClose();
}
/**
* Umka bindings for CloseWindow().
*
* @see CloseWindow()
*/
void umkaCloseWindow(UmkaStackSlot *params, UmkaStackSlot *result) {
CloseWindow();
}
/**
* Umka bindings for IsWindowReady().
*
* @see IsWindowReady()
*/
void umkaIsWindowReady(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = (int)IsWindowReady();
}
/**
* Umka bindings for IsWindowFullscreen().
*
* @see IsWindowFullscreen()
*/
void umkaIsWindowFullscreen(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = (int)IsWindowFullscreen();
}
/**
* Umka bindings for IsWindowHidden().
*
* @see IsWindowHidden()
*/
void umkaIsWindowHidden(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = (int)IsWindowHidden();
}
/**
* Umka bindings for IsWindowMinimized().
*
* @see IsWindowMinimized()
*/
void umkaIsWindowMinimized(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = (int)IsWindowMinimized();
}
/**
* Umka bindings for IsWindowMaximized().
*
* @see IsWindowMaximized()
*/
void umkaIsWindowMaximized(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = (int)IsWindowMaximized();
}
/**
* Umka bindings for IsWindowFocused().
*
* @see IsWindowFocused()
*/
void umkaIsWindowFocused(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = (int)IsWindowFocused();
}
/**
* Umka bindings for IsWindowResized().
*
* @see IsWindowResized()
*/
void umkaIsWindowResized(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = (int)IsWindowResized();
}
/**
* Umka bindings for IsWindowState().
*
* @see IsWindowState()
*/
void umkaIsWindowState(UmkaStackSlot *params, UmkaStackSlot *result) {
unsigned int flag = params[0].uintVal;
result->intVal = (int)IsWindowState(flag);
}
/**
* Umka bindings for SetWindowState().
*
* @see SetWindowState()
*/
void umkaSetWindowState(UmkaStackSlot *params, UmkaStackSlot *result) {
unsigned int flags = params[0].uintVal;
SetWindowState(flags);
}
/**
* Umka bindings for ClearWindowState().
*
* @see ClearWindowState()
*/
void umkaClearWindowState(UmkaStackSlot *params, UmkaStackSlot *result) {
unsigned int flags = params[0].uintVal;
ClearWindowState(flags);
}
/**
* Umka bindings for ToggleFullscreen().
*
* @see ToggleFullscreen()
*/
void umkaToggleFullscreen(UmkaStackSlot *params, UmkaStackSlot *result) {
ToggleFullscreen();
}
/**
* Umka bindings for MaximizeWindow().
*
* @see MaximizeWindow()
*/
void umkaMaximizeWindow(UmkaStackSlot *params, UmkaStackSlot *result) {
MaximizeWindow();
}
/**
* Umka bindings for MinimizeWindow().
*
* @see MinimizeWindow()
*/
void umkaMinimizeWindow(UmkaStackSlot *params, UmkaStackSlot *result) {
MinimizeWindow();
}
/**
* Umka bindings for RestoreWindow().
*
* @see RestoreWindow()
*/
void umkaRestoreWindow(UmkaStackSlot *params, UmkaStackSlot *result) {
RestoreWindow();
}
/**
* Umka bindings for SetWindowIcon().
*
* @see SetWindowIcon()
*/
void umkaSetWindowIcon(UmkaStackSlot *params, UmkaStackSlot *result) {
Image* image = (Image*)¶ms[0];
SetWindowIcon(*image);
}
/**
* Umka bindings for SetWindowIcons().
*
* @see SetWindowIcons()
*/
void umkaSetWindowIcons(UmkaStackSlot *params, UmkaStackSlot *result) {
Image * images = (Image *)params[1].ptrVal;
int count = params[0].intVal;
SetWindowIcons(images, count);
}
/**
* Umka bindings for SetWindowTitle().
*
* @see SetWindowTitle()
*/
void umkaSetWindowTitle(UmkaStackSlot *params, UmkaStackSlot *result) {
const char * title = (const char *)params[0].ptrVal;
SetWindowTitle(title);
}
/**
* Umka bindings for SetWindowPosition().
*
* @see SetWindowPosition()
*/
void umkaSetWindowPosition(UmkaStackSlot *params, UmkaStackSlot *result) {
int x = params[1].intVal;
int y = params[0].intVal;
SetWindowPosition(x, y);
}
/**
* Umka bindings for SetWindowMonitor().
*
* @see SetWindowMonitor()
*/
void umkaSetWindowMonitor(UmkaStackSlot *params, UmkaStackSlot *result) {
int monitor = params[0].intVal;
SetWindowMonitor(monitor);
}
/**
* Umka bindings for SetWindowMinSize().
*
* @see SetWindowMinSize()
*/
void umkaSetWindowMinSize(UmkaStackSlot *params, UmkaStackSlot *result) {
int width = params[1].intVal;
int height = params[0].intVal;
SetWindowMinSize(width, height);
}
/**
* Umka bindings for SetWindowSize().
*
* @see SetWindowSize()
*/
void umkaSetWindowSize(UmkaStackSlot *params, UmkaStackSlot *result) {
int width = params[1].intVal;
int height = params[0].intVal;
SetWindowSize(width, height);
}
/**
* Umka bindings for SetWindowOpacity().
*
* @see SetWindowOpacity()
*/
void umkaSetWindowOpacity(UmkaStackSlot *params, UmkaStackSlot *result) {
float opacity = params[0].real32Val;
SetWindowOpacity(opacity);
}
/**
* Umka bindings for GetWindowHandle().
*
* @see GetWindowHandle()
*/
void umkaGetWindowHandle(UmkaStackSlot *params, UmkaStackSlot *result) {
result->ptrVal = (void*)GetWindowHandle();
}
/**
* Umka bindings for GetScreenWidth().
*
* @see GetScreenWidth()
*/
void umkaGetScreenWidth(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = GetScreenWidth();
}
/**
* Umka bindings for GetScreenHeight().
*
* @see GetScreenHeight()
*/
void umkaGetScreenHeight(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = GetScreenHeight();
}
/**
* Umka bindings for GetRenderWidth().
*
* @see GetRenderWidth()
*/
void umkaGetRenderWidth(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = GetRenderWidth();
}
/**
* Umka bindings for GetRenderHeight().
*
* @see GetRenderHeight()
*/
void umkaGetRenderHeight(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = GetRenderHeight();
}
/**
* Umka bindings for GetMonitorCount().
*
* @see GetMonitorCount()
*/
void umkaGetMonitorCount(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = GetMonitorCount();
}
/**
* Umka bindings for GetCurrentMonitor().
*
* @see GetCurrentMonitor()
*/
void umkaGetCurrentMonitor(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = GetCurrentMonitor();
}
/**
* Umka bindings for GetMonitorPosition().
*
* @see GetMonitorPosition()
*/
void umkaGetMonitorPosition(UmkaStackSlot *params, UmkaStackSlot *result) {
// Skipping params[0], as it's a reference to Umka's internal filename
int monitor = params[1].intVal;
result->ptrVal = umkaAllocData(result->ptrVal, sizeof(Vector2), NULL);
Vector2 out = GetMonitorPosition(monitor);
RAYLIB_UMKA_MEMCPY(result->ptrVal, &out, sizeof(Vector2));
}
/**
* Umka bindings for GetMonitorWidth().
*
* @see GetMonitorWidth()
*/
void umkaGetMonitorWidth(UmkaStackSlot *params, UmkaStackSlot *result) {
int monitor = params[0].intVal;
result->intVal = GetMonitorWidth(monitor);
}
/**
* Umka bindings for GetMonitorHeight().
*
* @see GetMonitorHeight()
*/
void umkaGetMonitorHeight(UmkaStackSlot *params, UmkaStackSlot *result) {
int monitor = params[0].intVal;
result->intVal = GetMonitorHeight(monitor);
}
/**
* Umka bindings for GetMonitorPhysicalWidth().
*
* @see GetMonitorPhysicalWidth()
*/
void umkaGetMonitorPhysicalWidth(UmkaStackSlot *params, UmkaStackSlot *result) {
int monitor = params[0].intVal;
result->intVal = GetMonitorPhysicalWidth(monitor);
}
/**
* Umka bindings for GetMonitorPhysicalHeight().
*
* @see GetMonitorPhysicalHeight()
*/
void umkaGetMonitorPhysicalHeight(UmkaStackSlot *params, UmkaStackSlot *result) {
int monitor = params[0].intVal;
result->intVal = GetMonitorPhysicalHeight(monitor);
}
/**
* Umka bindings for GetMonitorRefreshRate().
*
* @see GetMonitorRefreshRate()
*/
void umkaGetMonitorRefreshRate(UmkaStackSlot *params, UmkaStackSlot *result) {
int monitor = params[0].intVal;
result->intVal = GetMonitorRefreshRate(monitor);
}
/**
* Umka bindings for GetWindowPosition().
*
* @see GetWindowPosition()
*/
void umkaGetWindowPosition(UmkaStackSlot *params, UmkaStackSlot *result) {
result->ptrVal = umkaAllocData(result->ptrVal, sizeof(Vector2), NULL);
Vector2 out = GetWindowPosition();
RAYLIB_UMKA_MEMCPY(result->ptrVal, &out, sizeof(Vector2));
}
/**
* Umka bindings for GetWindowScaleDPI().
*
* @see GetWindowScaleDPI()
*/
void umkaGetWindowScaleDPI(UmkaStackSlot *params, UmkaStackSlot *result) {
result->ptrVal = umkaAllocData(result->ptrVal, sizeof(Vector2), NULL);
Vector2 out = GetWindowScaleDPI();
RAYLIB_UMKA_MEMCPY(result->ptrVal, &out, sizeof(Vector2));
}
/**
* Umka bindings for GetMonitorName().
*
* @see GetMonitorName()
*/
void umkaGetMonitorName(UmkaStackSlot *params, UmkaStackSlot *result) {
int monitor = params[0].intVal;
result->ptrVal = (void*)GetMonitorName(monitor);
}
/**
* Umka bindings for SetClipboardText().
*
* @see SetClipboardText()
*/
void umkaSetClipboardText(UmkaStackSlot *params, UmkaStackSlot *result) {
const char * text = (const char *)params[0].ptrVal;
SetClipboardText(text);
}
/**
* Umka bindings for GetClipboardText().
*
* @see GetClipboardText()
*/
void umkaGetClipboardText(UmkaStackSlot *params, UmkaStackSlot *result) {
result->ptrVal = (void*)GetClipboardText();
}
/**
* Umka bindings for EnableEventWaiting().
*
* @see EnableEventWaiting()
*/
void umkaEnableEventWaiting(UmkaStackSlot *params, UmkaStackSlot *result) {
EnableEventWaiting();
}
/**
* Umka bindings for DisableEventWaiting().
*
* @see DisableEventWaiting()
*/
void umkaDisableEventWaiting(UmkaStackSlot *params, UmkaStackSlot *result) {
DisableEventWaiting();
}
/**
* Umka bindings for SwapScreenBuffer().
*
* @see SwapScreenBuffer()
*/
void umkaSwapScreenBuffer(UmkaStackSlot *params, UmkaStackSlot *result) {
SwapScreenBuffer();
}
/**
* Umka bindings for PollInputEvents().
*
* @see PollInputEvents()
*/
void umkaPollInputEvents(UmkaStackSlot *params, UmkaStackSlot *result) {
PollInputEvents();
}
/**
* Umka bindings for WaitTime().
*
* @see WaitTime()
*/
void umkaWaitTime(UmkaStackSlot *params, UmkaStackSlot *result) {
double seconds = params[0].realVal;
WaitTime(seconds);
}
/**
* Umka bindings for ShowCursor().
*
* @see ShowCursor()
*/
void umkaShowCursor(UmkaStackSlot *params, UmkaStackSlot *result) {
ShowCursor();
}
/**
* Umka bindings for HideCursor().
*
* @see HideCursor()
*/
void umkaHideCursor(UmkaStackSlot *params, UmkaStackSlot *result) {
HideCursor();
}
/**
* Umka bindings for IsCursorHidden().
*
* @see IsCursorHidden()
*/
void umkaIsCursorHidden(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = (int)IsCursorHidden();
}
/**
* Umka bindings for EnableCursor().
*
* @see EnableCursor()
*/
void umkaEnableCursor(UmkaStackSlot *params, UmkaStackSlot *result) {
EnableCursor();
}
/**
* Umka bindings for DisableCursor().
*
* @see DisableCursor()
*/
void umkaDisableCursor(UmkaStackSlot *params, UmkaStackSlot *result) {
DisableCursor();
}
/**
* Umka bindings for IsCursorOnScreen().
*
* @see IsCursorOnScreen()
*/
void umkaIsCursorOnScreen(UmkaStackSlot *params, UmkaStackSlot *result) {
result->intVal = (int)IsCursorOnScreen();
}
/**
* Umka bindings for ClearBackground().
*
* @see ClearBackground()
*/
void umkaClearBackground(UmkaStackSlot *params, UmkaStackSlot *result) {
Color* color = (Color*)¶ms[0];
ClearBackground(*color);
}
/**
* Umka bindings for BeginDrawing().
*
* @see BeginDrawing()
*/
void umkaBeginDrawing(UmkaStackSlot *params, UmkaStackSlot *result) {
BeginDrawing();
}
/**
* Umka bindings for EndDrawing().
*
* @see EndDrawing()
*/
void umkaEndDrawing(UmkaStackSlot *params, UmkaStackSlot *result) {
EndDrawing();
}
/**
* Umka bindings for BeginMode2D().
*
* @see BeginMode2D()
*/
void umkaBeginMode2D(UmkaStackSlot *params, UmkaStackSlot *result) {
Camera2D* camera = (Camera2D*)¶ms[0];
BeginMode2D(*camera);
}
/**
* Umka bindings for EndMode2D().
*
* @see EndMode2D()
*/
void umkaEndMode2D(UmkaStackSlot *params, UmkaStackSlot *result) {
EndMode2D();
}
/**
* Umka bindings for BeginMode3D().
*
* @see BeginMode3D()
*/
void umkaBeginMode3D(UmkaStackSlot *params, UmkaStackSlot *result) {
Camera3D* camera = (Camera3D*)¶ms[0];
BeginMode3D(*camera);
}
/**
* Umka bindings for EndMode3D().
*
* @see EndMode3D()
*/
void umkaEndMode3D(UmkaStackSlot *params, UmkaStackSlot *result) {
EndMode3D();
}
/**
* Umka bindings for BeginTextureMode().
*
* @see BeginTextureMode()
*/
void umkaBeginTextureMode(UmkaStackSlot *params, UmkaStackSlot *result) {
RenderTexture2D* target = (RenderTexture2D*)¶ms[0];
BeginTextureMode(*target);
}
/**
* Umka bindings for EndTextureMode().
*
* @see EndTextureMode()
*/
void umkaEndTextureMode(UmkaStackSlot *params, UmkaStackSlot *result) {
EndTextureMode();
}
/**
* Umka bindings for BeginShaderMode().
*
* @see BeginShaderMode()
*/
void umkaBeginShaderMode(UmkaStackSlot *params, UmkaStackSlot *result) {
Shader* shader = (Shader*)¶ms[0];
BeginShaderMode(*shader);
}
/**
* Umka bindings for EndShaderMode().
*
* @see EndShaderMode()
*/
void umkaEndShaderMode(UmkaStackSlot *params, UmkaStackSlot *result) {
EndShaderMode();
}
/**
* Umka bindings for BeginBlendMode().
*
* @see BeginBlendMode()
*/
void umkaBeginBlendMode(UmkaStackSlot *params, UmkaStackSlot *result) {
int mode = params[0].intVal;
BeginBlendMode(mode);
}
/**
* Umka bindings for EndBlendMode().
*
* @see EndBlendMode()
*/
void umkaEndBlendMode(UmkaStackSlot *params, UmkaStackSlot *result) {
EndBlendMode();
}
/**
* Umka bindings for BeginScissorMode().
*
* @see BeginScissorMode()
*/
void umkaBeginScissorMode(UmkaStackSlot *params, UmkaStackSlot *result) {
int x = params[3].intVal;
int y = params[2].intVal;
int width = params[1].intVal;
int height = params[0].intVal;
BeginScissorMode(x, y, width, height);
}
/**
* Umka bindings for EndScissorMode().
*
* @see EndScissorMode()
*/
void umkaEndScissorMode(UmkaStackSlot *params, UmkaStackSlot *result) {
EndScissorMode();
}
/**
* Umka bindings for BeginVrStereoMode().
*
* @see BeginVrStereoMode()
*/
void umkaBeginVrStereoMode(UmkaStackSlot *params, UmkaStackSlot *result) {
VrStereoConfig* config = (VrStereoConfig*)¶ms[0];
BeginVrStereoMode(*config);
}
/**
* Umka bindings for EndVrStereoMode().
*
* @see EndVrStereoMode()
*/
void umkaEndVrStereoMode(UmkaStackSlot *params, UmkaStackSlot *result) {
EndVrStereoMode();
}
/**
* Umka bindings for LoadVrStereoConfig().
*
* @see LoadVrStereoConfig()
*/
void umkaLoadVrStereoConfig(UmkaStackSlot *params, UmkaStackSlot *result) {
// Skipping params[0], as it's a reference to Umka's internal filename
VrDeviceInfo* device = (VrDeviceInfo*)¶ms[1];
result->ptrVal = umkaAllocData(result->ptrVal, sizeof(VrStereoConfig), NULL);
VrStereoConfig out = LoadVrStereoConfig(*device);
RAYLIB_UMKA_MEMCPY(result->ptrVal, &out, sizeof(VrStereoConfig));
}
/**
* Umka bindings for UnloadVrStereoConfig().
*
* @see UnloadVrStereoConfig()
*/
void umkaUnloadVrStereoConfig(UmkaStackSlot *params, UmkaStackSlot *result) {
VrStereoConfig* config = (VrStereoConfig*)¶ms[0];
UnloadVrStereoConfig(*config);
}
/**
* Umka bindings for LoadShader().
*
* @see LoadShader()
*/
void umkaLoadShader(UmkaStackSlot *params, UmkaStackSlot *result) {
// Skipping params[0], as it's a reference to Umka's internal filename
const char * vsFileName = (const char *)params[2].ptrVal;
const char * fsFileName = (const char *)params[1].ptrVal;
result->ptrVal = umkaAllocData(result->ptrVal, sizeof(Shader), NULL);
Shader out = LoadShader(vsFileName, fsFileName);
RAYLIB_UMKA_MEMCPY(result->ptrVal, &out, sizeof(Shader));
}
/**
* Umka bindings for LoadShaderFromMemory().
*
* @see LoadShaderFromMemory()
*/
void umkaLoadShaderFromMemory(UmkaStackSlot *params, UmkaStackSlot *result) {
// Skipping params[0], as it's a reference to Umka's internal filename
const char * vsCode = (const char *)params[2].ptrVal;
const char * fsCode = (const char *)params[1].ptrVal;
result->ptrVal = umkaAllocData(result->ptrVal, sizeof(Shader), NULL);
Shader out = LoadShaderFromMemory(vsCode, fsCode);
RAYLIB_UMKA_MEMCPY(result->ptrVal, &out, sizeof(Shader));
}
/**
* Umka bindings for IsShaderReady().
*
* @see IsShaderReady()
*/
void umkaIsShaderReady(UmkaStackSlot *params, UmkaStackSlot *result) {
Shader* shader = (Shader*)¶ms[0];
result->intVal = (int)IsShaderReady(*shader);
}
/**
* Umka bindings for GetShaderLocation().
*
* @see GetShaderLocation()
*/
void umkaGetShaderLocation(UmkaStackSlot *params, UmkaStackSlot *result) {
Shader* shader = (Shader*)¶ms[1];
const char * uniformName = (const char *)params[0].ptrVal;
result->intVal = GetShaderLocation(*shader, uniformName);
}
/**
* Umka bindings for GetShaderLocationAttrib().
*
* @see GetShaderLocationAttrib()
*/
void umkaGetShaderLocationAttrib(UmkaStackSlot *params, UmkaStackSlot *result) {
Shader* shader = (Shader*)¶ms[1];
const char * attribName = (const char *)params[0].ptrVal;
result->intVal = GetShaderLocationAttrib(*shader, attribName);
}
/**
* Umka bindings for SetShaderValue().
*
* @see SetShaderValue()
*/
void umkaSetShaderValue(UmkaStackSlot *params, UmkaStackSlot *result) {
Shader* shader = (Shader*)¶ms[3];
int locIndex = params[2].intVal;
const void * value = (const void *)params[1].ptrVal;
int uniformType = params[0].intVal;
SetShaderValue(*shader, locIndex, value, uniformType);
}
/**
* Umka bindings for SetShaderValueV().
*
* @see SetShaderValueV()
*/
void umkaSetShaderValueV(UmkaStackSlot *params, UmkaStackSlot *result) {
Shader* shader = (Shader*)¶ms[4];
int locIndex = params[3].intVal;
const void * value = (const void *)params[2].ptrVal;
int uniformType = params[1].intVal;
int count = params[0].intVal;
SetShaderValueV(*shader, locIndex, value, uniformType, count);
}
/**
* Umka bindings for SetShaderValueMatrix().
*
* @see SetShaderValueMatrix()
*/
void umkaSetShaderValueMatrix(UmkaStackSlot *params, UmkaStackSlot *result) {
Shader* shader = (Shader*)¶ms[2];
int locIndex = params[1].intVal;
Matrix* mat = (Matrix*)¶ms[0];
SetShaderValueMatrix(*shader, locIndex, *mat);
}
/**
* Umka bindings for SetShaderValueTexture().
*
* @see SetShaderValueTexture()
*/
void umkaSetShaderValueTexture(UmkaStackSlot *params, UmkaStackSlot *result) {
Shader* shader = (Shader*)¶ms[2];
int locIndex = params[1].intVal;
Texture2D* texture = (Texture2D*)¶ms[0];
SetShaderValueTexture(*shader, locIndex, *texture);
}
/**
* Umka bindings for UnloadShader().
*
* @see UnloadShader()
*/
void umkaUnloadShader(UmkaStackSlot *params, UmkaStackSlot *result) {
Shader* shader = (Shader*)¶ms[0];
UnloadShader(*shader);
}
/**
* Umka bindings for GetMouseRay().
*
* @see GetMouseRay()
*/
void umkaGetMouseRay(UmkaStackSlot *params, UmkaStackSlot *result) {
// Skipping params[0], as it's a reference to Umka's internal filename
Vector2* mousePosition = (Vector2*)¶ms[2];
Camera* camera = (Camera*)¶ms[1];
result->ptrVal = umkaAllocData(result->ptrVal, sizeof(Ray), NULL);
Ray out = GetMouseRay(*mousePosition, *camera);
RAYLIB_UMKA_MEMCPY(result->ptrVal, &out, sizeof(Ray));
}
/**
* Umka bindings for GetCameraMatrix().
*
* @see GetCameraMatrix()
*/
void umkaGetCameraMatrix(UmkaStackSlot *params, UmkaStackSlot *result) {
// Skipping params[0], as it's a reference to Umka's internal filename
Camera* camera = (Camera*)¶ms[1];
result->ptrVal = umkaAllocData(result->ptrVal, sizeof(Matrix), NULL);
Matrix out = GetCameraMatrix(*camera);
RAYLIB_UMKA_MEMCPY(result->ptrVal, &out, sizeof(Matrix));
}
/**
* Umka bindings for GetCameraMatrix2D().
*
* @see GetCameraMatrix2D()
*/
void umkaGetCameraMatrix2D(UmkaStackSlot *params, UmkaStackSlot *result) {
// Skipping params[0], as it's a reference to Umka's internal filename
Camera2D* camera = (Camera2D*)¶ms[1];
result->ptrVal = umkaAllocData(result->ptrVal, sizeof(Matrix), NULL);
Matrix out = GetCameraMatrix2D(*camera);
RAYLIB_UMKA_MEMCPY(result->ptrVal, &out, sizeof(Matrix));
}
/**
* Umka bindings for GetWorldToScreen().
*
* @see GetWorldToScreen()
*/
void umkaGetWorldToScreen(UmkaStackSlot *params, UmkaStackSlot *result) {
// Skipping params[0], as it's a reference to Umka's internal filename
Vector3* position = (Vector3*)¶ms[2];
Camera* camera = (Camera*)¶ms[1];
result->ptrVal = umkaAllocData(result->ptrVal, sizeof(Vector2), NULL);
Vector2 out = GetWorldToScreen(*position, *camera);
RAYLIB_UMKA_MEMCPY(result->ptrVal, &out, sizeof(Vector2));
}
/**
* Umka bindings for GetScreenToWorld2D().
*
* @see GetScreenToWorld2D()
*/
void umkaGetScreenToWorld2D(UmkaStackSlot *params, UmkaStackSlot *result) {
// Skipping params[0], as it's a reference to Umka's internal filename
Vector2* position = (Vector2*)¶ms[2];
Camera2D* camera = (Camera2D*)¶ms[1];
result->ptrVal = umkaAllocData(result->ptrVal, sizeof(Vector2), NULL);
Vector2 out = GetScreenToWorld2D(*position, *camera);
RAYLIB_UMKA_MEMCPY(result->ptrVal, &out, sizeof(Vector2));
}
/**
* Umka bindings for GetWorldToScreenEx().
*
* @see GetWorldToScreenEx()
*/
void umkaGetWorldToScreenEx(UmkaStackSlot *params, UmkaStackSlot *result) {
// Skipping params[0], as it's a reference to Umka's internal filename
Vector3* position = (Vector3*)¶ms[4];