raylib-bindings 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +22 -0
- data/LICENSE.txt +1 -1
- data/README.md +16 -5
- data/examples/template.rb +24 -22
- data/lib/config.rb +98 -0
- data/lib/libraylib.dll +0 -0
- data/lib/libraylib.dylib +0 -0
- data/lib/physac.dll +0 -0
- data/lib/physac.rb +157 -113
- data/lib/raygui.dll +0 -0
- data/lib/raygui.rb +439 -205
- data/lib/raylib.rb +26 -145
- data/lib/raylib_helper.rb +419 -0
- data/lib/raylib_main.rb +3697 -2003
- data/lib/raymath.rb +672 -351
- data/lib/rlgl.rb +1043 -638
- metadata +5 -3
data/lib/raygui.rb
CHANGED
@@ -2,12 +2,13 @@
|
|
2
2
|
#
|
3
3
|
# * https://github.com/vaiorabbit/raylib-bindings
|
4
4
|
#
|
5
|
-
# [NOTICE]
|
5
|
+
# [NOTICE] Autogenerated. Do not edit.
|
6
6
|
|
7
7
|
require 'ffi'
|
8
8
|
|
9
9
|
module Raylib
|
10
10
|
extend FFI::Library
|
11
|
+
|
11
12
|
# Define/Macro
|
12
13
|
|
13
14
|
RAYGUI_VERSION = "3.2"
|
@@ -16,29 +17,40 @@ module Raylib
|
|
16
17
|
|
17
18
|
# Enum
|
18
19
|
|
20
|
+
# enum GuiState
|
21
|
+
# Gui control state
|
19
22
|
STATE_NORMAL = 0
|
20
23
|
STATE_FOCUSED = 1
|
21
24
|
STATE_PRESSED = 2
|
22
25
|
STATE_DISABLED = 3
|
26
|
+
|
27
|
+
# enum GuiTextAlignment
|
28
|
+
# Gui control text alignment
|
23
29
|
TEXT_ALIGN_LEFT = 0
|
24
30
|
TEXT_ALIGN_CENTER = 1
|
25
31
|
TEXT_ALIGN_RIGHT = 2
|
32
|
+
|
33
|
+
# enum GuiControl
|
34
|
+
# Gui controls
|
26
35
|
DEFAULT = 0
|
27
|
-
LABEL = 1
|
36
|
+
LABEL = 1 # Used also for: LABELBUTTON
|
28
37
|
BUTTON = 2
|
29
|
-
TOGGLE = 3
|
30
|
-
SLIDER = 4
|
38
|
+
TOGGLE = 3 # Used also for: TOGGLEGROUP
|
39
|
+
SLIDER = 4 # Used also for: SLIDERBAR
|
31
40
|
PROGRESSBAR = 5
|
32
41
|
CHECKBOX = 6
|
33
42
|
COMBOBOX = 7
|
34
43
|
DROPDOWNBOX = 8
|
35
|
-
TEXTBOX = 9
|
44
|
+
TEXTBOX = 9 # Used also for: TEXTBOXMULTI
|
36
45
|
VALUEBOX = 10
|
37
|
-
SPINNER = 11
|
46
|
+
SPINNER = 11 # Uses: BUTTON, VALUEBOX
|
38
47
|
LISTVIEW = 12
|
39
48
|
COLORPICKER = 13
|
40
49
|
SCROLLBAR = 14
|
41
50
|
STATUSBAR = 15
|
51
|
+
|
52
|
+
# enum GuiControlProperty
|
53
|
+
# Gui base properties for every control
|
42
54
|
BORDER_COLOR_NORMAL = 0
|
43
55
|
BASE_COLOR_NORMAL = 1
|
44
56
|
TEXT_COLOR_NORMAL = 2
|
@@ -55,38 +67,77 @@ module Raylib
|
|
55
67
|
TEXT_PADDING = 13
|
56
68
|
TEXT_ALIGNMENT = 14
|
57
69
|
RESERVED = 15
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
70
|
+
|
71
|
+
# enum GuiDefaultProperty
|
72
|
+
# DEFAULT extended properties
|
73
|
+
TEXT_SIZE = 16 # Text size (glyphs max height)
|
74
|
+
TEXT_SPACING = 17 # Text spacing between glyphs
|
75
|
+
LINE_COLOR = 18 # Line control color
|
76
|
+
BACKGROUND_COLOR = 19 # Background color
|
77
|
+
|
78
|
+
# enum GuiToggleProperty
|
79
|
+
# Toggle/ToggleGroup
|
80
|
+
GROUP_PADDING = 16 # ToggleGroup separation between toggles
|
81
|
+
|
82
|
+
# enum GuiSliderProperty
|
83
|
+
# Slider/SliderBar
|
84
|
+
SLIDER_WIDTH = 16 # Slider size of internal bar
|
85
|
+
SLIDER_PADDING = 17 # Slider/SliderBar internal bar padding
|
86
|
+
|
87
|
+
# enum GuiProgressBarProperty
|
88
|
+
# ProgressBar
|
89
|
+
PROGRESS_PADDING = 16 # ProgressBar internal padding
|
90
|
+
|
91
|
+
# enum GuiScrollBarProperty
|
92
|
+
# ScrollBar
|
66
93
|
ARROWS_SIZE = 16
|
67
94
|
ARROWS_VISIBLE = 17
|
68
|
-
SCROLL_SLIDER_PADDING = 18
|
95
|
+
SCROLL_SLIDER_PADDING = 18 # (SLIDERBAR, SLIDER_PADDING)
|
69
96
|
SCROLL_SLIDER_SIZE = 19
|
70
97
|
SCROLL_PADDING = 20
|
71
98
|
SCROLL_SPEED = 21
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
99
|
+
|
100
|
+
# enum GuiCheckBoxProperty
|
101
|
+
# CheckBox
|
102
|
+
CHECK_PADDING = 16 # CheckBox internal check padding
|
103
|
+
|
104
|
+
# enum GuiComboBoxProperty
|
105
|
+
# ComboBox
|
106
|
+
COMBO_BUTTON_WIDTH = 16 # ComboBox right button width
|
107
|
+
COMBO_BUTTON_SPACING = 17 # ComboBox button separation
|
108
|
+
|
109
|
+
# enum GuiDropdownBoxProperty
|
110
|
+
# DropdownBox
|
111
|
+
ARROW_PADDING = 16 # DropdownBox arrow separation from border and items
|
112
|
+
DROPDOWN_ITEMS_SPACING = 17 # DropdownBox items separation
|
113
|
+
|
114
|
+
# enum GuiTextBoxProperty
|
115
|
+
# TextBox/TextBoxMulti/ValueBox/Spinner
|
116
|
+
TEXT_INNER_PADDING = 16 # TextBox/TextBoxMulti/ValueBox/Spinner inner text padding
|
117
|
+
TEXT_LINES_SPACING = 17 # TextBoxMulti lines separation
|
118
|
+
|
119
|
+
# enum GuiSpinnerProperty
|
120
|
+
# Spinner
|
121
|
+
SPIN_BUTTON_WIDTH = 16 # Spinner left/right buttons width
|
122
|
+
SPIN_BUTTON_SPACING = 17 # Spinner buttons separation
|
123
|
+
|
124
|
+
# enum GuiListViewProperty
|
125
|
+
# ListView
|
126
|
+
LIST_ITEMS_HEIGHT = 16 # ListView items height
|
127
|
+
LIST_ITEMS_SPACING = 17 # ListView items separation
|
128
|
+
SCROLLBAR_WIDTH = 18 # ListView scrollbar size (usually width)
|
129
|
+
SCROLLBAR_SIDE = 19 # ListView scrollbar side (0-left, 1-right)
|
130
|
+
|
131
|
+
# enum GuiColorPickerProperty
|
132
|
+
# ColorPicker
|
85
133
|
COLOR_SELECTOR_SIZE = 16
|
86
|
-
HUEBAR_WIDTH = 17
|
87
|
-
HUEBAR_PADDING = 18
|
88
|
-
HUEBAR_SELECTOR_HEIGHT = 19
|
89
|
-
HUEBAR_SELECTOR_OVERFLOW = 20
|
134
|
+
HUEBAR_WIDTH = 17 # ColorPicker right hue bar width
|
135
|
+
HUEBAR_PADDING = 18 # ColorPicker right hue bar separation from panel
|
136
|
+
HUEBAR_SELECTOR_HEIGHT = 19 # ColorPicker right hue bar selector height
|
137
|
+
HUEBAR_SELECTOR_OVERFLOW = 20 # ColorPicker right hue bar selector overflow
|
138
|
+
|
139
|
+
# enum GuiIconName
|
140
|
+
#
|
90
141
|
ICON_NONE = 0
|
91
142
|
ICON_FOLDER_FILE_OPEN = 1
|
92
143
|
ICON_FILE_SAVE_CLASSIC = 2
|
@@ -344,6 +395,7 @@ module Raylib
|
|
344
395
|
ICON_254 = 254
|
345
396
|
ICON_255 = 255
|
346
397
|
|
398
|
+
|
347
399
|
# Typedef
|
348
400
|
|
349
401
|
typedef :int, :GuiState
|
@@ -366,6 +418,7 @@ module Raylib
|
|
366
418
|
|
367
419
|
# Struct
|
368
420
|
|
421
|
+
# Style property
|
369
422
|
class GuiStyleProp < FFI::Struct
|
370
423
|
layout(
|
371
424
|
:controlId, :ushort,
|
@@ -377,180 +430,361 @@ module Raylib
|
|
377
430
|
|
378
431
|
# Function
|
379
432
|
|
380
|
-
def self.setup_raygui_symbols
|
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
|
-
|
433
|
+
def self.setup_raygui_symbols
|
434
|
+
entries = [
|
435
|
+
|
436
|
+
# GuiEnable : Enable gui controls (global state)
|
437
|
+
# @return [void]
|
438
|
+
[:GuiEnable, :GuiEnable, [], :void],
|
439
|
+
|
440
|
+
# GuiDisable : Disable gui controls (global state)
|
441
|
+
# @return [void]
|
442
|
+
[:GuiDisable, :GuiDisable, [], :void],
|
443
|
+
|
444
|
+
# GuiLock : Lock gui controls (global state)
|
445
|
+
# @return [void]
|
446
|
+
[:GuiLock, :GuiLock, [], :void],
|
447
|
+
|
448
|
+
# GuiUnlock : Unlock gui controls (global state)
|
449
|
+
# @return [void]
|
450
|
+
[:GuiUnlock, :GuiUnlock, [], :void],
|
451
|
+
|
452
|
+
# GuiIsLocked : Check if gui is locked (global state)
|
453
|
+
# @return [bool]
|
454
|
+
[:GuiIsLocked, :GuiIsLocked, [], :bool],
|
455
|
+
|
456
|
+
# GuiFade : Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
|
457
|
+
# @param alpha [float]
|
458
|
+
# @return [void]
|
459
|
+
[:GuiFade, :GuiFade, [:float], :void],
|
460
|
+
|
461
|
+
# GuiSetState : Set gui state (global state)
|
462
|
+
# @param state [int]
|
463
|
+
# @return [void]
|
464
|
+
[:GuiSetState, :GuiSetState, [:int], :void],
|
465
|
+
|
466
|
+
# GuiGetState : Get gui state (global state)
|
467
|
+
# @return [int]
|
468
|
+
[:GuiGetState, :GuiGetState, [], :int],
|
469
|
+
|
470
|
+
# GuiSetFont : Set gui custom font (global state)
|
471
|
+
# @param font [Font]
|
472
|
+
# @return [void]
|
473
|
+
[:GuiSetFont, :GuiSetFont, [Font.by_value], :void],
|
474
|
+
|
475
|
+
# GuiGetFont : Get gui custom font (global state)
|
476
|
+
# @return [Font]
|
477
|
+
[:GuiGetFont, :GuiGetFont, [], Font.by_value],
|
478
|
+
|
479
|
+
# GuiSetStyle : Set one style property
|
480
|
+
# @param control [int]
|
481
|
+
# @param property [int]
|
482
|
+
# @param value [int]
|
483
|
+
# @return [void]
|
484
|
+
[:GuiSetStyle, :GuiSetStyle, [:int, :int, :int], :void],
|
485
|
+
|
486
|
+
# GuiGetStyle : Get one style property
|
487
|
+
# @param control [int]
|
488
|
+
# @param property [int]
|
489
|
+
# @return [int]
|
490
|
+
[:GuiGetStyle, :GuiGetStyle, [:int, :int], :int],
|
491
|
+
|
492
|
+
# GuiWindowBox : Window Box control, shows a window that can be closed
|
493
|
+
# @param bounds [Rectangle]
|
494
|
+
# @param title [const char *]
|
495
|
+
# @return [bool]
|
496
|
+
[:GuiWindowBox, :GuiWindowBox, [Rectangle.by_value, :pointer], :bool],
|
497
|
+
|
498
|
+
# GuiGroupBox : Group Box control with text name
|
499
|
+
# @param bounds [Rectangle]
|
500
|
+
# @param text [const char *]
|
501
|
+
# @return [void]
|
502
|
+
[:GuiGroupBox, :GuiGroupBox, [Rectangle.by_value, :pointer], :void],
|
503
|
+
|
504
|
+
# GuiLine : Line separator control, could contain text
|
505
|
+
# @param bounds [Rectangle]
|
506
|
+
# @param text [const char *]
|
507
|
+
# @return [void]
|
508
|
+
[:GuiLine, :GuiLine, [Rectangle.by_value, :pointer], :void],
|
509
|
+
|
510
|
+
# GuiPanel : Panel control, useful to group controls
|
511
|
+
# @param bounds [Rectangle]
|
512
|
+
# @param text [const char *]
|
513
|
+
# @return [void]
|
514
|
+
[:GuiPanel, :GuiPanel, [Rectangle.by_value, :pointer], :void],
|
515
|
+
|
516
|
+
# GuiTabBar : Tab Bar control, returns TAB to be closed or -1
|
517
|
+
# @param bounds [Rectangle]
|
518
|
+
# @param text [const char **]
|
519
|
+
# @param count [int]
|
520
|
+
# @param active [int *]
|
521
|
+
# @return [int]
|
522
|
+
[:GuiTabBar, :GuiTabBar, [Rectangle.by_value, :pointer, :int, :pointer], :int],
|
523
|
+
|
524
|
+
# GuiScrollPanel : Scroll Panel control
|
525
|
+
# @param bounds [Rectangle]
|
526
|
+
# @param text [const char *]
|
527
|
+
# @param content [Rectangle]
|
528
|
+
# @param scroll [Vector2 *]
|
529
|
+
# @return [Rectangle]
|
530
|
+
[:GuiScrollPanel, :GuiScrollPanel, [Rectangle.by_value, :pointer, Rectangle.by_value, :pointer], Rectangle.by_value],
|
531
|
+
|
532
|
+
# GuiLabel : Label control, shows text
|
533
|
+
# @param bounds [Rectangle]
|
534
|
+
# @param text [const char *]
|
535
|
+
# @return [void]
|
536
|
+
[:GuiLabel, :GuiLabel, [Rectangle.by_value, :pointer], :void],
|
537
|
+
|
538
|
+
# GuiButton : Button control, returns true when clicked
|
539
|
+
# @param bounds [Rectangle]
|
540
|
+
# @param text [const char *]
|
541
|
+
# @return [bool]
|
542
|
+
[:GuiButton, :GuiButton, [Rectangle.by_value, :pointer], :bool],
|
543
|
+
|
544
|
+
# GuiLabelButton : Label button control, show true when clicked
|
545
|
+
# @param bounds [Rectangle]
|
546
|
+
# @param text [const char *]
|
547
|
+
# @return [bool]
|
548
|
+
[:GuiLabelButton, :GuiLabelButton, [Rectangle.by_value, :pointer], :bool],
|
549
|
+
|
550
|
+
# GuiToggle : Toggle Button control, returns true when active
|
551
|
+
# @param bounds [Rectangle]
|
552
|
+
# @param text [const char *]
|
553
|
+
# @param active [bool]
|
554
|
+
# @return [bool]
|
555
|
+
[:GuiToggle, :GuiToggle, [Rectangle.by_value, :pointer, :bool], :bool],
|
556
|
+
|
557
|
+
# GuiToggleGroup : Toggle Group control, returns active toggle index
|
558
|
+
# @param bounds [Rectangle]
|
559
|
+
# @param text [const char *]
|
560
|
+
# @param active [int]
|
561
|
+
# @return [int]
|
562
|
+
[:GuiToggleGroup, :GuiToggleGroup, [Rectangle.by_value, :pointer, :int], :int],
|
563
|
+
|
564
|
+
# GuiCheckBox : Check Box control, returns true when active
|
565
|
+
# @param bounds [Rectangle]
|
566
|
+
# @param text [const char *]
|
567
|
+
# @param checked [bool]
|
568
|
+
# @return [bool]
|
569
|
+
[:GuiCheckBox, :GuiCheckBox, [Rectangle.by_value, :pointer, :bool], :bool],
|
570
|
+
|
571
|
+
# GuiComboBox : Combo Box control, returns selected item index
|
572
|
+
# @param bounds [Rectangle]
|
573
|
+
# @param text [const char *]
|
574
|
+
# @param active [int]
|
575
|
+
# @return [int]
|
576
|
+
[:GuiComboBox, :GuiComboBox, [Rectangle.by_value, :pointer, :int], :int],
|
577
|
+
|
578
|
+
# GuiDropdownBox : Dropdown Box control, returns selected item
|
579
|
+
# @param bounds [Rectangle]
|
580
|
+
# @param text [const char *]
|
581
|
+
# @param active [int *]
|
582
|
+
# @param editMode [bool]
|
583
|
+
# @return [bool]
|
584
|
+
[:GuiDropdownBox, :GuiDropdownBox, [Rectangle.by_value, :pointer, :pointer, :bool], :bool],
|
585
|
+
|
586
|
+
# GuiSpinner : Spinner control, returns selected value
|
587
|
+
# @param bounds [Rectangle]
|
588
|
+
# @param text [const char *]
|
589
|
+
# @param value [int *]
|
590
|
+
# @param minValue [int]
|
591
|
+
# @param maxValue [int]
|
592
|
+
# @param editMode [bool]
|
593
|
+
# @return [bool]
|
594
|
+
[:GuiSpinner, :GuiSpinner, [Rectangle.by_value, :pointer, :pointer, :int, :int, :bool], :bool],
|
595
|
+
|
596
|
+
# GuiValueBox : Value Box control, updates input text with numbers
|
597
|
+
# @param bounds [Rectangle]
|
598
|
+
# @param text [const char *]
|
599
|
+
# @param value [int *]
|
600
|
+
# @param minValue [int]
|
601
|
+
# @param maxValue [int]
|
602
|
+
# @param editMode [bool]
|
603
|
+
# @return [bool]
|
604
|
+
[:GuiValueBox, :GuiValueBox, [Rectangle.by_value, :pointer, :pointer, :int, :int, :bool], :bool],
|
605
|
+
|
606
|
+
# GuiTextBox : Text Box control, updates input text
|
607
|
+
# @param bounds [Rectangle]
|
608
|
+
# @param text [char *]
|
609
|
+
# @param textSize [int]
|
610
|
+
# @param editMode [bool]
|
611
|
+
# @return [bool]
|
612
|
+
[:GuiTextBox, :GuiTextBox, [Rectangle.by_value, :pointer, :int, :bool], :bool],
|
613
|
+
|
614
|
+
# GuiTextBoxMulti : Text Box control with multiple lines
|
615
|
+
# @param bounds [Rectangle]
|
616
|
+
# @param text [char *]
|
617
|
+
# @param textSize [int]
|
618
|
+
# @param editMode [bool]
|
619
|
+
# @return [bool]
|
620
|
+
[:GuiTextBoxMulti, :GuiTextBoxMulti, [Rectangle.by_value, :pointer, :int, :bool], :bool],
|
621
|
+
|
622
|
+
# GuiSlider : Slider control, returns selected value
|
623
|
+
# @param bounds [Rectangle]
|
624
|
+
# @param textLeft [const char *]
|
625
|
+
# @param textRight [const char *]
|
626
|
+
# @param value [float]
|
627
|
+
# @param minValue [float]
|
628
|
+
# @param maxValue [float]
|
629
|
+
# @return [float]
|
630
|
+
[:GuiSlider, :GuiSlider, [Rectangle.by_value, :pointer, :pointer, :float, :float, :float], :float],
|
631
|
+
|
632
|
+
# GuiSliderBar : Slider Bar control, returns selected value
|
633
|
+
# @param bounds [Rectangle]
|
634
|
+
# @param textLeft [const char *]
|
635
|
+
# @param textRight [const char *]
|
636
|
+
# @param value [float]
|
637
|
+
# @param minValue [float]
|
638
|
+
# @param maxValue [float]
|
639
|
+
# @return [float]
|
640
|
+
[:GuiSliderBar, :GuiSliderBar, [Rectangle.by_value, :pointer, :pointer, :float, :float, :float], :float],
|
641
|
+
|
642
|
+
# GuiProgressBar : Progress Bar control, shows current progress value
|
643
|
+
# @param bounds [Rectangle]
|
644
|
+
# @param textLeft [const char *]
|
645
|
+
# @param textRight [const char *]
|
646
|
+
# @param value [float]
|
647
|
+
# @param minValue [float]
|
648
|
+
# @param maxValue [float]
|
649
|
+
# @return [float]
|
650
|
+
[:GuiProgressBar, :GuiProgressBar, [Rectangle.by_value, :pointer, :pointer, :float, :float, :float], :float],
|
651
|
+
|
652
|
+
# GuiStatusBar : Status Bar control, shows info text
|
653
|
+
# @param bounds [Rectangle]
|
654
|
+
# @param text [const char *]
|
655
|
+
# @return [void]
|
656
|
+
[:GuiStatusBar, :GuiStatusBar, [Rectangle.by_value, :pointer], :void],
|
657
|
+
|
658
|
+
# GuiDummyRec : Dummy control for placeholders
|
659
|
+
# @param bounds [Rectangle]
|
660
|
+
# @param text [const char *]
|
661
|
+
# @return [void]
|
662
|
+
[:GuiDummyRec, :GuiDummyRec, [Rectangle.by_value, :pointer], :void],
|
663
|
+
|
664
|
+
# GuiGrid : Grid control, returns mouse cell position
|
665
|
+
# @param bounds [Rectangle]
|
666
|
+
# @param text [const char *]
|
667
|
+
# @param spacing [float]
|
668
|
+
# @param subdivs [int]
|
669
|
+
# @return [Vector2]
|
670
|
+
[:GuiGrid, :GuiGrid, [Rectangle.by_value, :pointer, :float, :int], Vector2.by_value],
|
671
|
+
|
672
|
+
# GuiListView : List View control, returns selected list item index
|
673
|
+
# @param bounds [Rectangle]
|
674
|
+
# @param text [const char *]
|
675
|
+
# @param scrollIndex [int *]
|
676
|
+
# @param active [int]
|
677
|
+
# @return [int]
|
678
|
+
[:GuiListView, :GuiListView, [Rectangle.by_value, :pointer, :pointer, :int], :int],
|
679
|
+
|
680
|
+
# GuiListViewEx : List View with extended parameters
|
681
|
+
# @param bounds [Rectangle]
|
682
|
+
# @param text [const char **]
|
683
|
+
# @param count [int]
|
684
|
+
# @param focus [int *]
|
685
|
+
# @param scrollIndex [int *]
|
686
|
+
# @param active [int]
|
687
|
+
# @return [int]
|
688
|
+
[:GuiListViewEx, :GuiListViewEx, [Rectangle.by_value, :pointer, :int, :pointer, :pointer, :int], :int],
|
689
|
+
|
690
|
+
# GuiMessageBox : Message Box control, displays a message
|
691
|
+
# @param bounds [Rectangle]
|
692
|
+
# @param title [const char *]
|
693
|
+
# @param message [const char *]
|
694
|
+
# @param buttons [const char *]
|
695
|
+
# @return [int]
|
696
|
+
[:GuiMessageBox, :GuiMessageBox, [Rectangle.by_value, :pointer, :pointer, :pointer], :int],
|
697
|
+
|
698
|
+
# GuiTextInputBox : Text Input Box control, ask for text, supports secret
|
699
|
+
# @param bounds [Rectangle]
|
700
|
+
# @param title [const char *]
|
701
|
+
# @param message [const char *]
|
702
|
+
# @param buttons [const char *]
|
703
|
+
# @param text [char *]
|
704
|
+
# @param textMaxSize [int]
|
705
|
+
# @param secretViewActive [int *]
|
706
|
+
# @return [int]
|
707
|
+
[:GuiTextInputBox, :GuiTextInputBox, [Rectangle.by_value, :pointer, :pointer, :pointer, :pointer, :int, :pointer], :int],
|
708
|
+
|
709
|
+
# GuiColorPicker : Color Picker control (multiple color controls)
|
710
|
+
# @param bounds [Rectangle]
|
711
|
+
# @param text [const char *]
|
712
|
+
# @param color [Color]
|
713
|
+
# @return [Color]
|
714
|
+
[:GuiColorPicker, :GuiColorPicker, [Rectangle.by_value, :pointer, Color.by_value], Color.by_value],
|
715
|
+
|
716
|
+
# GuiColorPanel : Color Panel control
|
717
|
+
# @param bounds [Rectangle]
|
718
|
+
# @param text [const char *]
|
719
|
+
# @param color [Color]
|
720
|
+
# @return [Color]
|
721
|
+
[:GuiColorPanel, :GuiColorPanel, [Rectangle.by_value, :pointer, Color.by_value], Color.by_value],
|
722
|
+
|
723
|
+
# GuiColorBarAlpha : Color Bar Alpha control
|
724
|
+
# @param bounds [Rectangle]
|
725
|
+
# @param text [const char *]
|
726
|
+
# @param alpha [float]
|
727
|
+
# @return [float]
|
728
|
+
[:GuiColorBarAlpha, :GuiColorBarAlpha, [Rectangle.by_value, :pointer, :float], :float],
|
729
|
+
|
730
|
+
# GuiColorBarHue : Color Bar Hue control
|
731
|
+
# @param bounds [Rectangle]
|
732
|
+
# @param text [const char *]
|
733
|
+
# @param value [float]
|
734
|
+
# @return [float]
|
735
|
+
[:GuiColorBarHue, :GuiColorBarHue, [Rectangle.by_value, :pointer, :float], :float],
|
736
|
+
|
737
|
+
# GuiLoadStyle : Load style file over global style variable (.rgs)
|
738
|
+
# @param fileName [const char *]
|
739
|
+
# @return [void]
|
740
|
+
[:GuiLoadStyle, :GuiLoadStyle, [:pointer], :void],
|
741
|
+
|
742
|
+
# GuiLoadStyleDefault : Load style default over global style
|
743
|
+
# @return [void]
|
744
|
+
[:GuiLoadStyleDefault, :GuiLoadStyleDefault, [], :void],
|
745
|
+
|
746
|
+
# GuiEnableTooltip : Enable gui tooltips (global state)
|
747
|
+
# @return [void]
|
748
|
+
[:GuiEnableTooltip, :GuiEnableTooltip, [], :void],
|
749
|
+
|
750
|
+
# GuiDisableTooltip : Disable gui tooltips (global state)
|
751
|
+
# @return [void]
|
752
|
+
[:GuiDisableTooltip, :GuiDisableTooltip, [], :void],
|
753
|
+
|
754
|
+
# GuiSetTooltip : Set tooltip string
|
755
|
+
# @param tooltip [const char *]
|
756
|
+
# @return [void]
|
757
|
+
[:GuiSetTooltip, :GuiSetTooltip, [:pointer], :void],
|
758
|
+
|
759
|
+
# GuiIconText : Get text with icon id prepended (if supported)
|
760
|
+
# @param iconId [int]
|
761
|
+
# @param text [const char *]
|
762
|
+
# @return [const char *]
|
763
|
+
[:GuiIconText, :GuiIconText, [:int, :pointer], :pointer],
|
764
|
+
|
765
|
+
# GuiGetIcons : Get raygui icons data pointer
|
766
|
+
# @return [unsigned int *]
|
767
|
+
[:GuiGetIcons, :GuiGetIcons, [], :pointer],
|
768
|
+
|
769
|
+
# GuiLoadIcons : Load raygui icons file (.rgi) into internal icons data
|
770
|
+
# @param fileName [const char *]
|
771
|
+
# @param loadIconsName [bool]
|
772
|
+
# @return [char **]
|
773
|
+
[:GuiLoadIcons, :GuiLoadIcons, [:pointer, :bool], :pointer],
|
774
|
+
|
775
|
+
# GuiDrawIcon
|
776
|
+
# @param iconId [int]
|
777
|
+
# @param posX [int]
|
778
|
+
# @param posY [int]
|
779
|
+
# @param pixelSize [int]
|
780
|
+
# @param color [Color]
|
781
|
+
# @return [void]
|
782
|
+
[:GuiDrawIcon, :GuiDrawIcon, [:int, :int, :int, :int, Color.by_value], :void],
|
435
783
|
]
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
:GuiUnlock => [],
|
441
|
-
:GuiIsLocked => [],
|
442
|
-
:GuiFade => [:float],
|
443
|
-
:GuiSetState => [:int],
|
444
|
-
:GuiGetState => [],
|
445
|
-
:GuiSetFont => [Font.by_value],
|
446
|
-
:GuiGetFont => [],
|
447
|
-
:GuiSetStyle => [:int, :int, :int],
|
448
|
-
:GuiGetStyle => [:int, :int],
|
449
|
-
:GuiWindowBox => [Rectangle.by_value, :pointer],
|
450
|
-
:GuiGroupBox => [Rectangle.by_value, :pointer],
|
451
|
-
:GuiLine => [Rectangle.by_value, :pointer],
|
452
|
-
:GuiPanel => [Rectangle.by_value, :pointer],
|
453
|
-
:GuiTabBar => [Rectangle.by_value, :pointer, :int, :pointer],
|
454
|
-
:GuiScrollPanel => [Rectangle.by_value, :pointer, Rectangle.by_value, :pointer],
|
455
|
-
:GuiLabel => [Rectangle.by_value, :pointer],
|
456
|
-
:GuiButton => [Rectangle.by_value, :pointer],
|
457
|
-
:GuiLabelButton => [Rectangle.by_value, :pointer],
|
458
|
-
:GuiToggle => [Rectangle.by_value, :pointer, :bool],
|
459
|
-
:GuiToggleGroup => [Rectangle.by_value, :pointer, :int],
|
460
|
-
:GuiCheckBox => [Rectangle.by_value, :pointer, :bool],
|
461
|
-
:GuiComboBox => [Rectangle.by_value, :pointer, :int],
|
462
|
-
:GuiDropdownBox => [Rectangle.by_value, :pointer, :pointer, :bool],
|
463
|
-
:GuiSpinner => [Rectangle.by_value, :pointer, :pointer, :int, :int, :bool],
|
464
|
-
:GuiValueBox => [Rectangle.by_value, :pointer, :pointer, :int, :int, :bool],
|
465
|
-
:GuiTextBox => [Rectangle.by_value, :pointer, :int, :bool],
|
466
|
-
:GuiTextBoxMulti => [Rectangle.by_value, :pointer, :int, :bool],
|
467
|
-
:GuiSlider => [Rectangle.by_value, :pointer, :pointer, :float, :float, :float],
|
468
|
-
:GuiSliderBar => [Rectangle.by_value, :pointer, :pointer, :float, :float, :float],
|
469
|
-
:GuiProgressBar => [Rectangle.by_value, :pointer, :pointer, :float, :float, :float],
|
470
|
-
:GuiStatusBar => [Rectangle.by_value, :pointer],
|
471
|
-
:GuiDummyRec => [Rectangle.by_value, :pointer],
|
472
|
-
:GuiGrid => [Rectangle.by_value, :pointer, :float, :int],
|
473
|
-
:GuiListView => [Rectangle.by_value, :pointer, :pointer, :int],
|
474
|
-
:GuiListViewEx => [Rectangle.by_value, :pointer, :int, :pointer, :pointer, :int],
|
475
|
-
:GuiMessageBox => [Rectangle.by_value, :pointer, :pointer, :pointer],
|
476
|
-
:GuiTextInputBox => [Rectangle.by_value, :pointer, :pointer, :pointer, :pointer, :int, :pointer],
|
477
|
-
:GuiColorPicker => [Rectangle.by_value, :pointer, Color.by_value],
|
478
|
-
:GuiColorPanel => [Rectangle.by_value, :pointer, Color.by_value],
|
479
|
-
:GuiColorBarAlpha => [Rectangle.by_value, :pointer, :float],
|
480
|
-
:GuiColorBarHue => [Rectangle.by_value, :pointer, :float],
|
481
|
-
:GuiLoadStyle => [:pointer],
|
482
|
-
:GuiLoadStyleDefault => [],
|
483
|
-
:GuiEnableTooltip => [],
|
484
|
-
:GuiDisableTooltip => [],
|
485
|
-
:GuiSetTooltip => [:pointer],
|
486
|
-
:GuiIconText => [:int, :pointer],
|
487
|
-
:GuiGetIcons => [],
|
488
|
-
:GuiLoadIcons => [:pointer, :bool],
|
489
|
-
:GuiDrawIcon => [:int, :int, :int, :int, Color.by_value],
|
490
|
-
}
|
491
|
-
retvals = {
|
492
|
-
:GuiEnable => :void,
|
493
|
-
:GuiDisable => :void,
|
494
|
-
:GuiLock => :void,
|
495
|
-
:GuiUnlock => :void,
|
496
|
-
:GuiIsLocked => :bool,
|
497
|
-
:GuiFade => :void,
|
498
|
-
:GuiSetState => :void,
|
499
|
-
:GuiGetState => :int,
|
500
|
-
:GuiSetFont => :void,
|
501
|
-
:GuiGetFont => Font.by_value,
|
502
|
-
:GuiSetStyle => :void,
|
503
|
-
:GuiGetStyle => :int,
|
504
|
-
:GuiWindowBox => :bool,
|
505
|
-
:GuiGroupBox => :void,
|
506
|
-
:GuiLine => :void,
|
507
|
-
:GuiPanel => :void,
|
508
|
-
:GuiTabBar => :int,
|
509
|
-
:GuiScrollPanel => Rectangle.by_value,
|
510
|
-
:GuiLabel => :void,
|
511
|
-
:GuiButton => :bool,
|
512
|
-
:GuiLabelButton => :bool,
|
513
|
-
:GuiToggle => :bool,
|
514
|
-
:GuiToggleGroup => :int,
|
515
|
-
:GuiCheckBox => :bool,
|
516
|
-
:GuiComboBox => :int,
|
517
|
-
:GuiDropdownBox => :bool,
|
518
|
-
:GuiSpinner => :bool,
|
519
|
-
:GuiValueBox => :bool,
|
520
|
-
:GuiTextBox => :bool,
|
521
|
-
:GuiTextBoxMulti => :bool,
|
522
|
-
:GuiSlider => :float,
|
523
|
-
:GuiSliderBar => :float,
|
524
|
-
:GuiProgressBar => :float,
|
525
|
-
:GuiStatusBar => :void,
|
526
|
-
:GuiDummyRec => :void,
|
527
|
-
:GuiGrid => Vector2.by_value,
|
528
|
-
:GuiListView => :int,
|
529
|
-
:GuiListViewEx => :int,
|
530
|
-
:GuiMessageBox => :int,
|
531
|
-
:GuiTextInputBox => :int,
|
532
|
-
:GuiColorPicker => Color.by_value,
|
533
|
-
:GuiColorPanel => Color.by_value,
|
534
|
-
:GuiColorBarAlpha => :float,
|
535
|
-
:GuiColorBarHue => :float,
|
536
|
-
:GuiLoadStyle => :void,
|
537
|
-
:GuiLoadStyleDefault => :void,
|
538
|
-
:GuiEnableTooltip => :void,
|
539
|
-
:GuiDisableTooltip => :void,
|
540
|
-
:GuiSetTooltip => :void,
|
541
|
-
:GuiIconText => :pointer,
|
542
|
-
:GuiGetIcons => :pointer,
|
543
|
-
:GuiLoadIcons => :pointer,
|
544
|
-
:GuiDrawIcon => :void,
|
545
|
-
}
|
546
|
-
symbols.each do |sym|
|
547
|
-
begin
|
548
|
-
attach_function sym, args[sym], retvals[sym]
|
549
|
-
rescue FFI::NotFoundError => error
|
550
|
-
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).")
|
551
|
-
end
|
784
|
+
entries.each do |entry|
|
785
|
+
attach_function entry[0], entry[1], entry[2], entry[3]
|
786
|
+
rescue FFI::NotFoundError => e
|
787
|
+
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
552
788
|
end
|
553
789
|
end
|
554
|
-
|
555
790
|
end
|
556
|
-
|