raylib-bindings 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +12 -0
- data/README.md +1 -1
- data/lib/libraylib.dll +0 -0
- data/lib/libraylib.dylib +0 -0
- data/lib/physac.dll +0 -0
- data/lib/physac.rb +154 -108
- data/lib/raygui.dll +0 -0
- data/lib/raygui.rb +387 -200
- data/lib/raylib.rb +8 -8
- data/lib/raylib_main.rb +3643 -1996
- data/lib/raymath.rb +671 -346
- data/lib/rlgl.rb +1016 -633
- metadata +2 -2
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"
|
@@ -24,17 +25,17 @@ module Raylib
|
|
24
25
|
TEXT_ALIGN_CENTER = 1
|
25
26
|
TEXT_ALIGN_RIGHT = 2
|
26
27
|
DEFAULT = 0
|
27
|
-
LABEL = 1
|
28
|
+
LABEL = 1 # Used also for: LABELBUTTON
|
28
29
|
BUTTON = 2
|
29
|
-
TOGGLE = 3
|
30
|
-
SLIDER = 4
|
30
|
+
TOGGLE = 3 # Used also for: TOGGLEGROUP
|
31
|
+
SLIDER = 4 # Used also for: SLIDERBAR
|
31
32
|
PROGRESSBAR = 5
|
32
33
|
CHECKBOX = 6
|
33
34
|
COMBOBOX = 7
|
34
35
|
DROPDOWNBOX = 8
|
35
|
-
TEXTBOX = 9
|
36
|
+
TEXTBOX = 9 # Used also for: TEXTBOXMULTI
|
36
37
|
VALUEBOX = 10
|
37
|
-
SPINNER = 11
|
38
|
+
SPINNER = 11 # Uses: BUTTON, VALUEBOX
|
38
39
|
LISTVIEW = 12
|
39
40
|
COLORPICKER = 13
|
40
41
|
SCROLLBAR = 14
|
@@ -55,38 +56,38 @@ module Raylib
|
|
55
56
|
TEXT_PADDING = 13
|
56
57
|
TEXT_ALIGNMENT = 14
|
57
58
|
RESERVED = 15
|
58
|
-
TEXT_SIZE = 16
|
59
|
-
TEXT_SPACING = 17
|
60
|
-
LINE_COLOR = 18
|
61
|
-
BACKGROUND_COLOR = 19
|
62
|
-
GROUP_PADDING = 16
|
63
|
-
SLIDER_WIDTH = 16
|
64
|
-
SLIDER_PADDING = 17
|
65
|
-
PROGRESS_PADDING = 16
|
59
|
+
TEXT_SIZE = 16 # Text size (glyphs max height)
|
60
|
+
TEXT_SPACING = 17 # Text spacing between glyphs
|
61
|
+
LINE_COLOR = 18 # Line control color
|
62
|
+
BACKGROUND_COLOR = 19 # Background color
|
63
|
+
GROUP_PADDING = 16 # ToggleGroup separation between toggles
|
64
|
+
SLIDER_WIDTH = 16 # Slider size of internal bar
|
65
|
+
SLIDER_PADDING = 17 # Slider/SliderBar internal bar padding
|
66
|
+
PROGRESS_PADDING = 16 # ProgressBar internal padding
|
66
67
|
ARROWS_SIZE = 16
|
67
68
|
ARROWS_VISIBLE = 17
|
68
|
-
SCROLL_SLIDER_PADDING = 18
|
69
|
+
SCROLL_SLIDER_PADDING = 18 # (SLIDERBAR, SLIDER_PADDING)
|
69
70
|
SCROLL_SLIDER_SIZE = 19
|
70
71
|
SCROLL_PADDING = 20
|
71
72
|
SCROLL_SPEED = 21
|
72
|
-
CHECK_PADDING = 16
|
73
|
-
COMBO_BUTTON_WIDTH = 16
|
74
|
-
COMBO_BUTTON_SPACING = 17
|
75
|
-
ARROW_PADDING = 16
|
76
|
-
DROPDOWN_ITEMS_SPACING = 17
|
77
|
-
TEXT_INNER_PADDING = 16
|
78
|
-
TEXT_LINES_SPACING = 17
|
79
|
-
SPIN_BUTTON_WIDTH = 16
|
80
|
-
SPIN_BUTTON_SPACING = 17
|
81
|
-
LIST_ITEMS_HEIGHT = 16
|
82
|
-
LIST_ITEMS_SPACING = 17
|
83
|
-
SCROLLBAR_WIDTH = 18
|
84
|
-
SCROLLBAR_SIDE = 19
|
73
|
+
CHECK_PADDING = 16 # CheckBox internal check padding
|
74
|
+
COMBO_BUTTON_WIDTH = 16 # ComboBox right button width
|
75
|
+
COMBO_BUTTON_SPACING = 17 # ComboBox button separation
|
76
|
+
ARROW_PADDING = 16 # DropdownBox arrow separation from border and items
|
77
|
+
DROPDOWN_ITEMS_SPACING = 17 # DropdownBox items separation
|
78
|
+
TEXT_INNER_PADDING = 16 # TextBox/TextBoxMulti/ValueBox/Spinner inner text padding
|
79
|
+
TEXT_LINES_SPACING = 17 # TextBoxMulti lines separation
|
80
|
+
SPIN_BUTTON_WIDTH = 16 # Spinner left/right buttons width
|
81
|
+
SPIN_BUTTON_SPACING = 17 # Spinner buttons separation
|
82
|
+
LIST_ITEMS_HEIGHT = 16 # ListView items height
|
83
|
+
LIST_ITEMS_SPACING = 17 # ListView items separation
|
84
|
+
SCROLLBAR_WIDTH = 18 # ListView scrollbar size (usually width)
|
85
|
+
SCROLLBAR_SIDE = 19 # ListView scrollbar side (0-left, 1-right)
|
85
86
|
COLOR_SELECTOR_SIZE = 16
|
86
|
-
HUEBAR_WIDTH = 17
|
87
|
-
HUEBAR_PADDING = 18
|
88
|
-
HUEBAR_SELECTOR_HEIGHT = 19
|
89
|
-
HUEBAR_SELECTOR_OVERFLOW = 20
|
87
|
+
HUEBAR_WIDTH = 17 # ColorPicker right hue bar width
|
88
|
+
HUEBAR_PADDING = 18 # ColorPicker right hue bar separation from panel
|
89
|
+
HUEBAR_SELECTOR_HEIGHT = 19 # ColorPicker right hue bar selector height
|
90
|
+
HUEBAR_SELECTOR_OVERFLOW = 20 # ColorPicker right hue bar selector overflow
|
90
91
|
ICON_NONE = 0
|
91
92
|
ICON_FOLDER_FILE_OPEN = 1
|
92
93
|
ICON_FILE_SAVE_CLASSIC = 2
|
@@ -366,6 +367,7 @@ module Raylib
|
|
366
367
|
|
367
368
|
# Struct
|
368
369
|
|
370
|
+
# Style property
|
369
371
|
class GuiStyleProp < FFI::Struct
|
370
372
|
layout(
|
371
373
|
:controlId, :ushort,
|
@@ -377,177 +379,362 @@ module Raylib
|
|
377
379
|
|
378
380
|
# Function
|
379
381
|
|
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
|
-
|
382
|
+
def self.setup_raygui_symbols(output_error = false)
|
383
|
+
entries = [
|
384
|
+
|
385
|
+
# GuiEnable : Enable gui controls (global state)
|
386
|
+
# @return [void]
|
387
|
+
[:GuiEnable, :GuiEnable, [], :void],
|
388
|
+
|
389
|
+
# GuiDisable : Disable gui controls (global state)
|
390
|
+
# @return [void]
|
391
|
+
[:GuiDisable, :GuiDisable, [], :void],
|
392
|
+
|
393
|
+
# GuiLock : Lock gui controls (global state)
|
394
|
+
# @return [void]
|
395
|
+
[:GuiLock, :GuiLock, [], :void],
|
396
|
+
|
397
|
+
# GuiUnlock : Unlock gui controls (global state)
|
398
|
+
# @return [void]
|
399
|
+
[:GuiUnlock, :GuiUnlock, [], :void],
|
400
|
+
|
401
|
+
# GuiIsLocked : Check if gui is locked (global state)
|
402
|
+
# @return [bool]
|
403
|
+
[:GuiIsLocked, :GuiIsLocked, [], :bool],
|
404
|
+
|
405
|
+
# GuiFade : Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
|
406
|
+
# @param alpha [float]
|
407
|
+
# @return [void]
|
408
|
+
[:GuiFade, :GuiFade, [:float], :void],
|
409
|
+
|
410
|
+
# GuiSetState : Set gui state (global state)
|
411
|
+
# @param state [int]
|
412
|
+
# @return [void]
|
413
|
+
[:GuiSetState, :GuiSetState, [:int], :void],
|
414
|
+
|
415
|
+
# GuiGetState : Get gui state (global state)
|
416
|
+
# @return [int]
|
417
|
+
[:GuiGetState, :GuiGetState, [], :int],
|
418
|
+
|
419
|
+
# GuiSetFont : Set gui custom font (global state)
|
420
|
+
# @param font [Font]
|
421
|
+
# @return [void]
|
422
|
+
[:GuiSetFont, :GuiSetFont, [Font.by_value], :void],
|
423
|
+
|
424
|
+
# GuiGetFont : Get gui custom font (global state)
|
425
|
+
# @return [Font]
|
426
|
+
[:GuiGetFont, :GuiGetFont, [], Font.by_value],
|
427
|
+
|
428
|
+
# GuiSetStyle : Set one style property
|
429
|
+
# @param control [int]
|
430
|
+
# @param property [int]
|
431
|
+
# @param value [int]
|
432
|
+
# @return [void]
|
433
|
+
[:GuiSetStyle, :GuiSetStyle, [:int, :int, :int], :void],
|
434
|
+
|
435
|
+
# GuiGetStyle : Get one style property
|
436
|
+
# @param control [int]
|
437
|
+
# @param property [int]
|
438
|
+
# @return [int]
|
439
|
+
[:GuiGetStyle, :GuiGetStyle, [:int, :int], :int],
|
440
|
+
|
441
|
+
# GuiWindowBox : Window Box control, shows a window that can be closed
|
442
|
+
# @param bounds [Rectangle]
|
443
|
+
# @param title [const char *]
|
444
|
+
# @return [bool]
|
445
|
+
[:GuiWindowBox, :GuiWindowBox, [Rectangle.by_value, :pointer], :bool],
|
446
|
+
|
447
|
+
# GuiGroupBox : Group Box control with text name
|
448
|
+
# @param bounds [Rectangle]
|
449
|
+
# @param text [const char *]
|
450
|
+
# @return [void]
|
451
|
+
[:GuiGroupBox, :GuiGroupBox, [Rectangle.by_value, :pointer], :void],
|
452
|
+
|
453
|
+
# GuiLine : Line separator control, could contain text
|
454
|
+
# @param bounds [Rectangle]
|
455
|
+
# @param text [const char *]
|
456
|
+
# @return [void]
|
457
|
+
[:GuiLine, :GuiLine, [Rectangle.by_value, :pointer], :void],
|
458
|
+
|
459
|
+
# GuiPanel : Panel control, useful to group controls
|
460
|
+
# @param bounds [Rectangle]
|
461
|
+
# @param text [const char *]
|
462
|
+
# @return [void]
|
463
|
+
[:GuiPanel, :GuiPanel, [Rectangle.by_value, :pointer], :void],
|
464
|
+
|
465
|
+
# GuiTabBar : Tab Bar control, returns TAB to be closed or -1
|
466
|
+
# @param bounds [Rectangle]
|
467
|
+
# @param text [const char **]
|
468
|
+
# @param count [int]
|
469
|
+
# @param active [int *]
|
470
|
+
# @return [int]
|
471
|
+
[:GuiTabBar, :GuiTabBar, [Rectangle.by_value, :pointer, :int, :pointer], :int],
|
472
|
+
|
473
|
+
# GuiScrollPanel : Scroll Panel control
|
474
|
+
# @param bounds [Rectangle]
|
475
|
+
# @param text [const char *]
|
476
|
+
# @param content [Rectangle]
|
477
|
+
# @param scroll [Vector2 *]
|
478
|
+
# @return [Rectangle]
|
479
|
+
[:GuiScrollPanel, :GuiScrollPanel, [Rectangle.by_value, :pointer, Rectangle.by_value, :pointer], Rectangle.by_value],
|
480
|
+
|
481
|
+
# GuiLabel : Label control, shows text
|
482
|
+
# @param bounds [Rectangle]
|
483
|
+
# @param text [const char *]
|
484
|
+
# @return [void]
|
485
|
+
[:GuiLabel, :GuiLabel, [Rectangle.by_value, :pointer], :void],
|
486
|
+
|
487
|
+
# GuiButton : Button control, returns true when clicked
|
488
|
+
# @param bounds [Rectangle]
|
489
|
+
# @param text [const char *]
|
490
|
+
# @return [bool]
|
491
|
+
[:GuiButton, :GuiButton, [Rectangle.by_value, :pointer], :bool],
|
492
|
+
|
493
|
+
# GuiLabelButton : Label button control, show true when clicked
|
494
|
+
# @param bounds [Rectangle]
|
495
|
+
# @param text [const char *]
|
496
|
+
# @return [bool]
|
497
|
+
[:GuiLabelButton, :GuiLabelButton, [Rectangle.by_value, :pointer], :bool],
|
498
|
+
|
499
|
+
# GuiToggle : Toggle Button control, returns true when active
|
500
|
+
# @param bounds [Rectangle]
|
501
|
+
# @param text [const char *]
|
502
|
+
# @param active [bool]
|
503
|
+
# @return [bool]
|
504
|
+
[:GuiToggle, :GuiToggle, [Rectangle.by_value, :pointer, :bool], :bool],
|
505
|
+
|
506
|
+
# GuiToggleGroup : Toggle Group control, returns active toggle index
|
507
|
+
# @param bounds [Rectangle]
|
508
|
+
# @param text [const char *]
|
509
|
+
# @param active [int]
|
510
|
+
# @return [int]
|
511
|
+
[:GuiToggleGroup, :GuiToggleGroup, [Rectangle.by_value, :pointer, :int], :int],
|
512
|
+
|
513
|
+
# GuiCheckBox : Check Box control, returns true when active
|
514
|
+
# @param bounds [Rectangle]
|
515
|
+
# @param text [const char *]
|
516
|
+
# @param checked [bool]
|
517
|
+
# @return [bool]
|
518
|
+
[:GuiCheckBox, :GuiCheckBox, [Rectangle.by_value, :pointer, :bool], :bool],
|
519
|
+
|
520
|
+
# GuiComboBox : Combo Box control, returns selected item index
|
521
|
+
# @param bounds [Rectangle]
|
522
|
+
# @param text [const char *]
|
523
|
+
# @param active [int]
|
524
|
+
# @return [int]
|
525
|
+
[:GuiComboBox, :GuiComboBox, [Rectangle.by_value, :pointer, :int], :int],
|
526
|
+
|
527
|
+
# GuiDropdownBox : Dropdown Box control, returns selected item
|
528
|
+
# @param bounds [Rectangle]
|
529
|
+
# @param text [const char *]
|
530
|
+
# @param active [int *]
|
531
|
+
# @param editMode [bool]
|
532
|
+
# @return [bool]
|
533
|
+
[:GuiDropdownBox, :GuiDropdownBox, [Rectangle.by_value, :pointer, :pointer, :bool], :bool],
|
534
|
+
|
535
|
+
# GuiSpinner : Spinner control, returns selected value
|
536
|
+
# @param bounds [Rectangle]
|
537
|
+
# @param text [const char *]
|
538
|
+
# @param value [int *]
|
539
|
+
# @param minValue [int]
|
540
|
+
# @param maxValue [int]
|
541
|
+
# @param editMode [bool]
|
542
|
+
# @return [bool]
|
543
|
+
[:GuiSpinner, :GuiSpinner, [Rectangle.by_value, :pointer, :pointer, :int, :int, :bool], :bool],
|
544
|
+
|
545
|
+
# GuiValueBox : Value Box control, updates input text with numbers
|
546
|
+
# @param bounds [Rectangle]
|
547
|
+
# @param text [const char *]
|
548
|
+
# @param value [int *]
|
549
|
+
# @param minValue [int]
|
550
|
+
# @param maxValue [int]
|
551
|
+
# @param editMode [bool]
|
552
|
+
# @return [bool]
|
553
|
+
[:GuiValueBox, :GuiValueBox, [Rectangle.by_value, :pointer, :pointer, :int, :int, :bool], :bool],
|
554
|
+
|
555
|
+
# GuiTextBox : Text Box control, updates input text
|
556
|
+
# @param bounds [Rectangle]
|
557
|
+
# @param text [char *]
|
558
|
+
# @param textSize [int]
|
559
|
+
# @param editMode [bool]
|
560
|
+
# @return [bool]
|
561
|
+
[:GuiTextBox, :GuiTextBox, [Rectangle.by_value, :pointer, :int, :bool], :bool],
|
562
|
+
|
563
|
+
# GuiTextBoxMulti : Text Box control with multiple lines
|
564
|
+
# @param bounds [Rectangle]
|
565
|
+
# @param text [char *]
|
566
|
+
# @param textSize [int]
|
567
|
+
# @param editMode [bool]
|
568
|
+
# @return [bool]
|
569
|
+
[:GuiTextBoxMulti, :GuiTextBoxMulti, [Rectangle.by_value, :pointer, :int, :bool], :bool],
|
570
|
+
|
571
|
+
# GuiSlider : Slider control, returns selected value
|
572
|
+
# @param bounds [Rectangle]
|
573
|
+
# @param textLeft [const char *]
|
574
|
+
# @param textRight [const char *]
|
575
|
+
# @param value [float]
|
576
|
+
# @param minValue [float]
|
577
|
+
# @param maxValue [float]
|
578
|
+
# @return [float]
|
579
|
+
[:GuiSlider, :GuiSlider, [Rectangle.by_value, :pointer, :pointer, :float, :float, :float], :float],
|
580
|
+
|
581
|
+
# GuiSliderBar : Slider Bar control, returns selected value
|
582
|
+
# @param bounds [Rectangle]
|
583
|
+
# @param textLeft [const char *]
|
584
|
+
# @param textRight [const char *]
|
585
|
+
# @param value [float]
|
586
|
+
# @param minValue [float]
|
587
|
+
# @param maxValue [float]
|
588
|
+
# @return [float]
|
589
|
+
[:GuiSliderBar, :GuiSliderBar, [Rectangle.by_value, :pointer, :pointer, :float, :float, :float], :float],
|
590
|
+
|
591
|
+
# GuiProgressBar : Progress Bar control, shows current progress value
|
592
|
+
# @param bounds [Rectangle]
|
593
|
+
# @param textLeft [const char *]
|
594
|
+
# @param textRight [const char *]
|
595
|
+
# @param value [float]
|
596
|
+
# @param minValue [float]
|
597
|
+
# @param maxValue [float]
|
598
|
+
# @return [float]
|
599
|
+
[:GuiProgressBar, :GuiProgressBar, [Rectangle.by_value, :pointer, :pointer, :float, :float, :float], :float],
|
600
|
+
|
601
|
+
# GuiStatusBar : Status Bar control, shows info text
|
602
|
+
# @param bounds [Rectangle]
|
603
|
+
# @param text [const char *]
|
604
|
+
# @return [void]
|
605
|
+
[:GuiStatusBar, :GuiStatusBar, [Rectangle.by_value, :pointer], :void],
|
606
|
+
|
607
|
+
# GuiDummyRec : Dummy control for placeholders
|
608
|
+
# @param bounds [Rectangle]
|
609
|
+
# @param text [const char *]
|
610
|
+
# @return [void]
|
611
|
+
[:GuiDummyRec, :GuiDummyRec, [Rectangle.by_value, :pointer], :void],
|
612
|
+
|
613
|
+
# GuiGrid : Grid control, returns mouse cell position
|
614
|
+
# @param bounds [Rectangle]
|
615
|
+
# @param text [const char *]
|
616
|
+
# @param spacing [float]
|
617
|
+
# @param subdivs [int]
|
618
|
+
# @return [Vector2]
|
619
|
+
[:GuiGrid, :GuiGrid, [Rectangle.by_value, :pointer, :float, :int], Vector2.by_value],
|
620
|
+
|
621
|
+
# GuiListView : List View control, returns selected list item index
|
622
|
+
# @param bounds [Rectangle]
|
623
|
+
# @param text [const char *]
|
624
|
+
# @param scrollIndex [int *]
|
625
|
+
# @param active [int]
|
626
|
+
# @return [int]
|
627
|
+
[:GuiListView, :GuiListView, [Rectangle.by_value, :pointer, :pointer, :int], :int],
|
628
|
+
|
629
|
+
# GuiListViewEx : List View with extended parameters
|
630
|
+
# @param bounds [Rectangle]
|
631
|
+
# @param text [const char **]
|
632
|
+
# @param count [int]
|
633
|
+
# @param focus [int *]
|
634
|
+
# @param scrollIndex [int *]
|
635
|
+
# @param active [int]
|
636
|
+
# @return [int]
|
637
|
+
[:GuiListViewEx, :GuiListViewEx, [Rectangle.by_value, :pointer, :int, :pointer, :pointer, :int], :int],
|
638
|
+
|
639
|
+
# GuiMessageBox : Message Box control, displays a message
|
640
|
+
# @param bounds [Rectangle]
|
641
|
+
# @param title [const char *]
|
642
|
+
# @param message [const char *]
|
643
|
+
# @param buttons [const char *]
|
644
|
+
# @return [int]
|
645
|
+
[:GuiMessageBox, :GuiMessageBox, [Rectangle.by_value, :pointer, :pointer, :pointer], :int],
|
646
|
+
|
647
|
+
# GuiTextInputBox : Text Input Box control, ask for text, supports secret
|
648
|
+
# @param bounds [Rectangle]
|
649
|
+
# @param title [const char *]
|
650
|
+
# @param message [const char *]
|
651
|
+
# @param buttons [const char *]
|
652
|
+
# @param text [char *]
|
653
|
+
# @param textMaxSize [int]
|
654
|
+
# @param secretViewActive [int *]
|
655
|
+
# @return [int]
|
656
|
+
[:GuiTextInputBox, :GuiTextInputBox, [Rectangle.by_value, :pointer, :pointer, :pointer, :pointer, :int, :pointer], :int],
|
657
|
+
|
658
|
+
# GuiColorPicker : Color Picker control (multiple color controls)
|
659
|
+
# @param bounds [Rectangle]
|
660
|
+
# @param text [const char *]
|
661
|
+
# @param color [Color]
|
662
|
+
# @return [Color]
|
663
|
+
[:GuiColorPicker, :GuiColorPicker, [Rectangle.by_value, :pointer, Color.by_value], Color.by_value],
|
664
|
+
|
665
|
+
# GuiColorPanel : Color Panel control
|
666
|
+
# @param bounds [Rectangle]
|
667
|
+
# @param text [const char *]
|
668
|
+
# @param color [Color]
|
669
|
+
# @return [Color]
|
670
|
+
[:GuiColorPanel, :GuiColorPanel, [Rectangle.by_value, :pointer, Color.by_value], Color.by_value],
|
671
|
+
|
672
|
+
# GuiColorBarAlpha : Color Bar Alpha control
|
673
|
+
# @param bounds [Rectangle]
|
674
|
+
# @param text [const char *]
|
675
|
+
# @param alpha [float]
|
676
|
+
# @return [float]
|
677
|
+
[:GuiColorBarAlpha, :GuiColorBarAlpha, [Rectangle.by_value, :pointer, :float], :float],
|
678
|
+
|
679
|
+
# GuiColorBarHue : Color Bar Hue control
|
680
|
+
# @param bounds [Rectangle]
|
681
|
+
# @param text [const char *]
|
682
|
+
# @param value [float]
|
683
|
+
# @return [float]
|
684
|
+
[:GuiColorBarHue, :GuiColorBarHue, [Rectangle.by_value, :pointer, :float], :float],
|
685
|
+
|
686
|
+
# GuiLoadStyle : Load style file over global style variable (.rgs)
|
687
|
+
# @param fileName [const char *]
|
688
|
+
# @return [void]
|
689
|
+
[:GuiLoadStyle, :GuiLoadStyle, [:pointer], :void],
|
690
|
+
|
691
|
+
# GuiLoadStyleDefault : Load style default over global style
|
692
|
+
# @return [void]
|
693
|
+
[:GuiLoadStyleDefault, :GuiLoadStyleDefault, [], :void],
|
694
|
+
|
695
|
+
# GuiEnableTooltip : Enable gui tooltips (global state)
|
696
|
+
# @return [void]
|
697
|
+
[:GuiEnableTooltip, :GuiEnableTooltip, [], :void],
|
698
|
+
|
699
|
+
# GuiDisableTooltip : Disable gui tooltips (global state)
|
700
|
+
# @return [void]
|
701
|
+
[:GuiDisableTooltip, :GuiDisableTooltip, [], :void],
|
702
|
+
|
703
|
+
# GuiSetTooltip : Set tooltip string
|
704
|
+
# @param tooltip [const char *]
|
705
|
+
# @return [void]
|
706
|
+
[:GuiSetTooltip, :GuiSetTooltip, [:pointer], :void],
|
707
|
+
|
708
|
+
# GuiIconText : Get text with icon id prepended (if supported)
|
709
|
+
# @param iconId [int]
|
710
|
+
# @param text [const char *]
|
711
|
+
# @return [const char *]
|
712
|
+
[:GuiIconText, :GuiIconText, [:int, :pointer], :pointer],
|
713
|
+
|
714
|
+
# GuiGetIcons : Get raygui icons data pointer
|
715
|
+
# @return [unsigned int *]
|
716
|
+
[:GuiGetIcons, :GuiGetIcons, [], :pointer],
|
717
|
+
|
718
|
+
# GuiLoadIcons : Load raygui icons file (.rgi) into internal icons data
|
719
|
+
# @param fileName [const char *]
|
720
|
+
# @param loadIconsName [bool]
|
721
|
+
# @return [char **]
|
722
|
+
[:GuiLoadIcons, :GuiLoadIcons, [:pointer, :bool], :pointer],
|
723
|
+
|
724
|
+
# GuiDrawIcon :
|
725
|
+
# @param iconId [int]
|
726
|
+
# @param posX [int]
|
727
|
+
# @param posY [int]
|
728
|
+
# @param pixelSize [int]
|
729
|
+
# @param color [Color]
|
730
|
+
# @return [void]
|
731
|
+
[:GuiDrawIcon, :GuiDrawIcon, [:int, :int, :int, :int, Color.by_value], :void],
|
435
732
|
]
|
436
|
-
|
437
|
-
:GuiEnable => [],
|
438
|
-
:GuiDisable => [],
|
439
|
-
:GuiLock => [],
|
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|
|
733
|
+
entries.each do |entry|
|
547
734
|
begin
|
548
|
-
attach_function
|
735
|
+
attach_function entry[0], entry[1], entry[2], entry[3]
|
549
736
|
rescue FFI::NotFoundError => error
|
550
|
-
$stderr.puts("[Warning] Failed to import #{
|
737
|
+
$stderr.puts("[Warning] Failed to import #{entry[0]} (#{error}).") if output_error
|
551
738
|
end
|
552
739
|
end
|
553
740
|
end
|
data/lib/raylib.rb
CHANGED
@@ -15,7 +15,7 @@ module Raylib
|
|
15
15
|
extend FFI::Library
|
16
16
|
|
17
17
|
@@raylib_import_done = false
|
18
|
-
def self.load_lib(libpath, raygui_libpath: nil, physac_libpath: nil)
|
18
|
+
def self.load_lib(libpath, output_error = false, raygui_libpath: nil, physac_libpath: nil)
|
19
19
|
|
20
20
|
unless @@raylib_import_done
|
21
21
|
begin
|
@@ -23,10 +23,10 @@ module Raylib
|
|
23
23
|
|
24
24
|
ffi_lib_flags :now, :global
|
25
25
|
ffi_lib *lib_paths
|
26
|
-
setup_symbols()
|
26
|
+
setup_symbols(output_error)
|
27
27
|
|
28
|
-
setup_raygui_symbols() if raygui_libpath != nil
|
29
|
-
setup_physac_symbols() if physac_libpath != nil
|
28
|
+
setup_raygui_symbols(output_error) if raygui_libpath != nil
|
29
|
+
setup_physac_symbols(output_error) if physac_libpath != nil
|
30
30
|
rescue => error
|
31
31
|
puts error
|
32
32
|
end
|
@@ -34,10 +34,10 @@ module Raylib
|
|
34
34
|
|
35
35
|
end
|
36
36
|
|
37
|
-
def self.setup_symbols()
|
38
|
-
setup_raylib_symbols()
|
39
|
-
setup_raymath_symbols()
|
40
|
-
setup_rlgl_symbols()
|
37
|
+
def self.setup_symbols(output_error)
|
38
|
+
setup_raylib_symbols(output_error)
|
39
|
+
setup_raymath_symbols(output_error)
|
40
|
+
setup_rlgl_symbols(output_error)
|
41
41
|
end
|
42
42
|
|
43
43
|
#
|