raylib-bindings 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +13 -0
- data/README.md +9 -1
- data/lib/libraylib.aarch64.so +0 -0
- data/lib/libraylib.arm64.dylib +0 -0
- data/lib/libraylib.dll +0 -0
- data/lib/libraylib.x86_64.dylib +0 -0
- data/lib/libraylib.x86_64.so +0 -0
- data/lib/physac.dll +0 -0
- data/lib/physac.rb +11 -2
- data/lib/raygui.aarch64.so +0 -0
- data/lib/raygui.arm64.dylib +0 -0
- data/lib/raygui.dll +0 -0
- data/lib/raygui.x86_64.dylib +0 -0
- data/lib/raygui.x86_64.so +0 -0
- data/lib/raygui_main.rb +25 -16
- data/lib/raylib.rb +9 -9
- data/lib/raylib_helper.rb +3 -0
- data/lib/raylib_main.rb +12 -3
- data/lib/raymath.rb +11 -2
- data/lib/rcamera.rb +11 -2
- data/lib/rlgl.rb +18 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e935d742cc8c2d199ae7db8272cd334f6c832f4a46f059752c1a9de01fa54203
|
4
|
+
data.tar.gz: 18eb540a946b82e593a487812c03329a2789bfe0a58982b2de81bd059103bc17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d33bbe65b446c6dd1567a6bb241627852cd38ffc1b442c0010e54c5a27cf90d1529faf7aa33ad69ba31ce2be704cb93c9d180862ed1d7d5d4a873661c8b01af1
|
7
|
+
data.tar.gz: 2673214f8c6a27f89465bfa33397ebb31d7efdc69a879bae16a4202970dc4a6bf1deda178253c67a6bcfff2affff049670184097bd9b49c1974da21d6704e36e
|
data/ChangeLog
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
2024-02-03 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
|
+
|
3
|
+
* Updated with latest raylib ( https://github.com/raysan5/raylib/commit/29ff658d9223068378269e4a705811f085fafdf4 ) and raygui ( https://github.com/raysan5/raygui/commit/58411f4cceb8ae82933f2001461db9940278fdeb )
|
4
|
+
|
5
|
+
2024-01-27 vaiorabbit <http://twitter.com/vaiorabbit>
|
6
|
+
|
7
|
+
* examples/snake_case_rlgl : Added
|
8
|
+
|
9
|
+
2024-01-20 vaiorabbit <http://twitter.com/vaiorabbit>
|
10
|
+
|
11
|
+
* Raylib.load_lib : Added 'method_naming' option to import APIs in snake case convention
|
12
|
+
* examples/snake_case_api.rb : Added
|
13
|
+
|
1
14
|
2024-01-07 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
15
|
|
3
16
|
* Updated README
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# Yet another raylib wrapper for Ruby #
|
4
4
|
|
5
5
|
* Created : 2021-10-17
|
6
|
-
* Last modified : 2024-
|
6
|
+
* Last modified : 2024-02-03
|
7
7
|
|
8
8
|
Provides Ruby bindings for raylib-related libraries including:
|
9
9
|
|
@@ -133,6 +133,8 @@ D:\> ruby template.rb
|
|
133
133
|
|
134
134
|
## Projects ##
|
135
135
|
|
136
|
+
### Games ###
|
137
|
+
|
136
138
|
See the projects below to learn how to use this library:
|
137
139
|
|
138
140
|
* Whac-a-Mole! : Ruby raylib bindings demo
|
@@ -147,6 +149,12 @@ See the projects below to learn how to use this library:
|
|
147
149
|
* <img src="https://raw.githubusercontent.com/vaiorabbit/raylib-bindings-flapper/main/doc/screenshot_01.png" width="150">
|
148
150
|
* <https://github.com/vaiorabbit/raylib-bindings-flapper>
|
149
151
|
|
152
|
+
### Libraries ###
|
153
|
+
|
154
|
+
* raylib-bindings-tileson : Provides Ruby bindings for raylib-tileson ( https://github.com/RobLoach/raylib-tileson )
|
155
|
+
* <img src="https://raw.githubusercontent.com/vaiorabbit/raylib-bindings-tileson/main/doc/screenshot_00.png" width="600">
|
156
|
+
* <https://github.com/vaiorabbit/raylib-bindings-tileson>
|
157
|
+
|
150
158
|
## Limitation ##
|
151
159
|
|
152
160
|
* `SetTraceLogCallback` and `TraceLogCallback` are unusable since Ruby-FFI does not support `:varargs` parameter in callbacks (`Proc`, etc.)
|
data/lib/libraylib.aarch64.so
CHANGED
Binary file
|
data/lib/libraylib.arm64.dylib
CHANGED
Binary file
|
data/lib/libraylib.dll
CHANGED
Binary file
|
data/lib/libraylib.x86_64.dylib
CHANGED
Binary file
|
data/lib/libraylib.x86_64.so
CHANGED
Binary file
|
data/lib/physac.dll
CHANGED
Binary file
|
data/lib/physac.rb
CHANGED
@@ -186,7 +186,7 @@ module Raylib
|
|
186
186
|
|
187
187
|
# Function
|
188
188
|
|
189
|
-
def self.setup_physac_symbols
|
189
|
+
def self.setup_physac_symbols(method_naming: :original)
|
190
190
|
entries = [
|
191
191
|
|
192
192
|
# @!method InitPhysics()
|
@@ -314,7 +314,16 @@ module Raylib
|
|
314
314
|
[:GetPhysicsShapeVertex, :GetPhysicsShapeVertex, [:pointer, :int], Vector2.by_value],
|
315
315
|
]
|
316
316
|
entries.each do |entry|
|
317
|
-
|
317
|
+
api_name = if method_naming == :snake_case
|
318
|
+
snake_case_name = entry[0].to_s.gsub(/([A-Z]+)([A-Z0-9][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z0-9])/, '\1_\2').downcase
|
319
|
+
snake_case_name.gsub!('vector_3', 'vector3_') if snake_case_name.include?('vector_3')
|
320
|
+
snake_case_name.gsub!('vector_2', 'vector2_') if snake_case_name.include?('vector_2')
|
321
|
+
snake_case_name.chop! if snake_case_name.end_with?('_')
|
322
|
+
snake_case_name.to_sym
|
323
|
+
else
|
324
|
+
entry[0]
|
325
|
+
end
|
326
|
+
attach_function api_name, entry[1], entry[2], entry[3]
|
318
327
|
rescue FFI::NotFoundError => e
|
319
328
|
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
320
329
|
end
|
data/lib/raygui.aarch64.so
CHANGED
Binary file
|
data/lib/raygui.arm64.dylib
CHANGED
Binary file
|
data/lib/raygui.dll
CHANGED
Binary file
|
data/lib/raygui.x86_64.dylib
CHANGED
Binary file
|
data/lib/raygui.x86_64.so
CHANGED
Binary file
|
data/lib/raygui_main.rb
CHANGED
@@ -454,7 +454,7 @@ module Raylib
|
|
454
454
|
|
455
455
|
# Function
|
456
456
|
|
457
|
-
def self.setup_raygui_symbols
|
457
|
+
def self.setup_raygui_symbols(method_naming: :original)
|
458
458
|
entries = [
|
459
459
|
|
460
460
|
# @!method GuiEnable()
|
@@ -635,7 +635,7 @@ module Raylib
|
|
635
635
|
[:GuiScrollPanel, :GuiScrollPanel, [Rectangle.by_value, :pointer, Rectangle.by_value, :pointer, :pointer], :int],
|
636
636
|
|
637
637
|
# @!method GuiLabel(bounds, text)
|
638
|
-
# GuiLabel : Label control
|
638
|
+
# GuiLabel : Label control
|
639
639
|
# @param bounds [Rectangle]
|
640
640
|
# @param text [const char *]
|
641
641
|
# @return [int]
|
@@ -649,14 +649,14 @@ module Raylib
|
|
649
649
|
[:GuiButton, :GuiButton, [Rectangle.by_value, :pointer], :int],
|
650
650
|
|
651
651
|
# @!method GuiLabelButton(bounds, text)
|
652
|
-
# GuiLabelButton : Label button control,
|
652
|
+
# GuiLabelButton : Label button control, returns true when clicked
|
653
653
|
# @param bounds [Rectangle]
|
654
654
|
# @param text [const char *]
|
655
655
|
# @return [int]
|
656
656
|
[:GuiLabelButton, :GuiLabelButton, [Rectangle.by_value, :pointer], :int],
|
657
657
|
|
658
658
|
# @!method GuiToggle(bounds, text, active)
|
659
|
-
# GuiToggle : Toggle Button control
|
659
|
+
# GuiToggle : Toggle Button control
|
660
660
|
# @param bounds [Rectangle]
|
661
661
|
# @param text [const char *]
|
662
662
|
# @param active [bool *]
|
@@ -664,7 +664,7 @@ module Raylib
|
|
664
664
|
[:GuiToggle, :GuiToggle, [Rectangle.by_value, :pointer, :pointer], :int],
|
665
665
|
|
666
666
|
# @!method GuiToggleGroup(bounds, text, active)
|
667
|
-
# GuiToggleGroup : Toggle Group control
|
667
|
+
# GuiToggleGroup : Toggle Group control
|
668
668
|
# @param bounds [Rectangle]
|
669
669
|
# @param text [const char *]
|
670
670
|
# @param active [int *]
|
@@ -672,7 +672,7 @@ module Raylib
|
|
672
672
|
[:GuiToggleGroup, :GuiToggleGroup, [Rectangle.by_value, :pointer, :pointer], :int],
|
673
673
|
|
674
674
|
# @!method GuiToggleSlider(bounds, text, active)
|
675
|
-
# GuiToggleSlider : Toggle Slider control
|
675
|
+
# GuiToggleSlider : Toggle Slider control
|
676
676
|
# @param bounds [Rectangle]
|
677
677
|
# @param text [const char *]
|
678
678
|
# @param active [int *]
|
@@ -688,7 +688,7 @@ module Raylib
|
|
688
688
|
[:GuiCheckBox, :GuiCheckBox, [Rectangle.by_value, :pointer, :pointer], :int],
|
689
689
|
|
690
690
|
# @!method GuiComboBox(bounds, text, active)
|
691
|
-
# GuiComboBox : Combo Box control
|
691
|
+
# GuiComboBox : Combo Box control
|
692
692
|
# @param bounds [Rectangle]
|
693
693
|
# @param text [const char *]
|
694
694
|
# @param active [int *]
|
@@ -696,7 +696,7 @@ module Raylib
|
|
696
696
|
[:GuiComboBox, :GuiComboBox, [Rectangle.by_value, :pointer, :pointer], :int],
|
697
697
|
|
698
698
|
# @!method GuiDropdownBox(bounds, text, active, editMode)
|
699
|
-
# GuiDropdownBox : Dropdown Box control
|
699
|
+
# GuiDropdownBox : Dropdown Box control
|
700
700
|
# @param bounds [Rectangle]
|
701
701
|
# @param text [const char *]
|
702
702
|
# @param active [int *]
|
@@ -705,7 +705,7 @@ module Raylib
|
|
705
705
|
[:GuiDropdownBox, :GuiDropdownBox, [Rectangle.by_value, :pointer, :pointer, :bool], :int],
|
706
706
|
|
707
707
|
# @!method GuiSpinner(bounds, text, value, minValue, maxValue, editMode)
|
708
|
-
# GuiSpinner : Spinner control
|
708
|
+
# GuiSpinner : Spinner control
|
709
709
|
# @param bounds [Rectangle]
|
710
710
|
# @param text [const char *]
|
711
711
|
# @param value [int *]
|
@@ -736,7 +736,7 @@ module Raylib
|
|
736
736
|
[:GuiTextBox, :GuiTextBox, [Rectangle.by_value, :pointer, :int, :bool], :int],
|
737
737
|
|
738
738
|
# @!method GuiSlider(bounds, textLeft, textRight, value, minValue, maxValue)
|
739
|
-
# GuiSlider : Slider control
|
739
|
+
# GuiSlider : Slider control
|
740
740
|
# @param bounds [Rectangle]
|
741
741
|
# @param textLeft [const char *]
|
742
742
|
# @param textRight [const char *]
|
@@ -747,7 +747,7 @@ module Raylib
|
|
747
747
|
[:GuiSlider, :GuiSlider, [Rectangle.by_value, :pointer, :pointer, :pointer, :float, :float], :int],
|
748
748
|
|
749
749
|
# @!method GuiSliderBar(bounds, textLeft, textRight, value, minValue, maxValue)
|
750
|
-
# GuiSliderBar : Slider Bar control
|
750
|
+
# GuiSliderBar : Slider Bar control
|
751
751
|
# @param bounds [Rectangle]
|
752
752
|
# @param textLeft [const char *]
|
753
753
|
# @param textRight [const char *]
|
@@ -758,7 +758,7 @@ module Raylib
|
|
758
758
|
[:GuiSliderBar, :GuiSliderBar, [Rectangle.by_value, :pointer, :pointer, :pointer, :float, :float], :int],
|
759
759
|
|
760
760
|
# @!method GuiProgressBar(bounds, textLeft, textRight, value, minValue, maxValue)
|
761
|
-
# GuiProgressBar : Progress Bar control
|
761
|
+
# GuiProgressBar : Progress Bar control
|
762
762
|
# @param bounds [Rectangle]
|
763
763
|
# @param textLeft [const char *]
|
764
764
|
# @param textRight [const char *]
|
@@ -783,7 +783,7 @@ module Raylib
|
|
783
783
|
[:GuiDummyRec, :GuiDummyRec, [Rectangle.by_value, :pointer], :int],
|
784
784
|
|
785
785
|
# @!method GuiGrid(bounds, text, spacing, subdivs, mouseCell)
|
786
|
-
# GuiGrid : Grid control
|
786
|
+
# GuiGrid : Grid control
|
787
787
|
# @param bounds [Rectangle]
|
788
788
|
# @param text [const char *]
|
789
789
|
# @param spacing [float]
|
@@ -793,7 +793,7 @@ module Raylib
|
|
793
793
|
[:GuiGrid, :GuiGrid, [Rectangle.by_value, :pointer, :float, :int, :pointer], :int],
|
794
794
|
|
795
795
|
# @!method GuiListView(bounds, text, scrollIndex, active)
|
796
|
-
# GuiListView : List View control
|
796
|
+
# GuiListView : List View control
|
797
797
|
# @param bounds [Rectangle]
|
798
798
|
# @param text [const char *]
|
799
799
|
# @param scrollIndex [int *]
|
@@ -874,7 +874,7 @@ module Raylib
|
|
874
874
|
[:GuiColorPickerHSV, :GuiColorPickerHSV, [Rectangle.by_value, :pointer, :pointer], :int],
|
875
875
|
|
876
876
|
# @!method GuiColorPanelHSV(bounds, text, colorHsv)
|
877
|
-
# GuiColorPanelHSV : Color Panel control that
|
877
|
+
# GuiColorPanelHSV : Color Panel control that updates Hue-Saturation-Value color value, used by GuiColorPickerHSV()
|
878
878
|
# @param bounds [Rectangle]
|
879
879
|
# @param text [const char *]
|
880
880
|
# @param colorHsv [Vector3 *]
|
@@ -882,7 +882,16 @@ module Raylib
|
|
882
882
|
[:GuiColorPanelHSV, :GuiColorPanelHSV, [Rectangle.by_value, :pointer, :pointer], :int],
|
883
883
|
]
|
884
884
|
entries.each do |entry|
|
885
|
-
|
885
|
+
api_name = if method_naming == :snake_case
|
886
|
+
snake_case_name = entry[0].to_s.gsub(/([A-Z]+)([A-Z0-9][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z0-9])/, '\1_\2').downcase
|
887
|
+
snake_case_name.gsub!('vector_3', 'vector3_') if snake_case_name.include?('vector_3')
|
888
|
+
snake_case_name.gsub!('vector_2', 'vector2_') if snake_case_name.include?('vector_2')
|
889
|
+
snake_case_name.chop! if snake_case_name.end_with?('_')
|
890
|
+
snake_case_name.to_sym
|
891
|
+
else
|
892
|
+
entry[0]
|
893
|
+
end
|
894
|
+
attach_function api_name, entry[1], entry[2], entry[3]
|
886
895
|
rescue FFI::NotFoundError => e
|
887
896
|
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
888
897
|
end
|
data/lib/raylib.rb
CHANGED
@@ -17,24 +17,24 @@ require_relative 'raygui_helper'
|
|
17
17
|
module Raylib
|
18
18
|
extend FFI::Library
|
19
19
|
|
20
|
-
def self.load_lib(libpath, raygui_libpath: nil, physac_libpath: nil)
|
20
|
+
def self.load_lib(libpath, raygui_libpath: nil, physac_libpath: nil, method_naming: :original)
|
21
21
|
lib_paths = [libpath, raygui_libpath, physac_libpath].compact
|
22
22
|
|
23
23
|
ffi_lib_flags :now, :global
|
24
24
|
ffi_lib(*lib_paths)
|
25
|
-
setup_symbols
|
25
|
+
setup_symbols(method_naming: method_naming)
|
26
26
|
|
27
|
-
setup_raygui_symbols unless raygui_libpath.nil?
|
28
|
-
setup_physac_symbols unless physac_libpath.nil?
|
27
|
+
setup_raygui_symbols(method_naming: method_naming) unless raygui_libpath.nil?
|
28
|
+
setup_physac_symbols(method_naming: method_naming) unless physac_libpath.nil?
|
29
29
|
rescue LoadError => e
|
30
30
|
warn e
|
31
31
|
end
|
32
32
|
|
33
|
-
def self.setup_symbols
|
34
|
-
setup_raylib_symbols
|
35
|
-
setup_raymath_symbols
|
36
|
-
setup_rcamera_symbols
|
37
|
-
setup_rlgl_symbols
|
33
|
+
def self.setup_symbols(method_naming: :original)
|
34
|
+
setup_raylib_symbols(method_naming: method_naming)
|
35
|
+
setup_raymath_symbols(method_naming: method_naming)
|
36
|
+
setup_rcamera_symbols(method_naming: method_naming)
|
37
|
+
setup_rlgl_symbols(method_naming: method_naming)
|
38
38
|
end
|
39
39
|
|
40
40
|
#
|
data/lib/raylib_helper.rb
CHANGED
data/lib/raylib_main.rb
CHANGED
@@ -157,7 +157,7 @@ module Raylib
|
|
157
157
|
KEY_KP_ENTER = 335 # Key: Keypad Enter
|
158
158
|
KEY_KP_EQUAL = 336 # Key: Keypad =
|
159
159
|
KEY_BACK = 4 # Key: Android back button
|
160
|
-
KEY_MENU =
|
160
|
+
KEY_MENU = 5 # Key: Android menu button
|
161
161
|
KEY_VOLUME_UP = 24 # Key: Android volume up button
|
162
162
|
KEY_VOLUME_DOWN = 25 # Key: Android volume down button
|
163
163
|
|
@@ -1123,7 +1123,7 @@ module Raylib
|
|
1123
1123
|
|
1124
1124
|
# Function
|
1125
1125
|
|
1126
|
-
def self.setup_raylib_symbols
|
1126
|
+
def self.setup_raylib_symbols(method_naming: :original)
|
1127
1127
|
entries = [
|
1128
1128
|
|
1129
1129
|
# @!method InitWindow(width, height, title)
|
@@ -5117,7 +5117,16 @@ module Raylib
|
|
5117
5117
|
[:DetachAudioMixedProcessor, :DetachAudioMixedProcessor, [:AudioCallback], :void],
|
5118
5118
|
]
|
5119
5119
|
entries.each do |entry|
|
5120
|
-
|
5120
|
+
api_name = if method_naming == :snake_case
|
5121
|
+
snake_case_name = entry[0].to_s.gsub(/([A-Z]+)([A-Z0-9][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z0-9])/, '\1_\2').downcase
|
5122
|
+
snake_case_name.gsub!('vector_3', 'vector3_') if snake_case_name.include?('vector_3')
|
5123
|
+
snake_case_name.gsub!('vector_2', 'vector2_') if snake_case_name.include?('vector_2')
|
5124
|
+
snake_case_name.chop! if snake_case_name.end_with?('_')
|
5125
|
+
snake_case_name.to_sym
|
5126
|
+
else
|
5127
|
+
entry[0]
|
5128
|
+
end
|
5129
|
+
attach_function api_name, entry[1], entry[2], entry[3]
|
5121
5130
|
rescue FFI::NotFoundError => e
|
5122
5131
|
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
5123
5132
|
end
|
data/lib/raymath.rb
CHANGED
@@ -38,7 +38,7 @@ module Raylib
|
|
38
38
|
|
39
39
|
# Function
|
40
40
|
|
41
|
-
def self.setup_raymath_symbols
|
41
|
+
def self.setup_raymath_symbols(method_naming: :original)
|
42
42
|
entries = [
|
43
43
|
|
44
44
|
# @!method Clamp(value, min, max)
|
@@ -837,7 +837,16 @@ module Raylib
|
|
837
837
|
[:QuaternionEquals, :QuaternionEquals, [Quaternion.by_value, Quaternion.by_value], :int],
|
838
838
|
]
|
839
839
|
entries.each do |entry|
|
840
|
-
|
840
|
+
api_name = if method_naming == :snake_case
|
841
|
+
snake_case_name = entry[0].to_s.gsub(/([A-Z]+)([A-Z0-9][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z0-9])/, '\1_\2').downcase
|
842
|
+
snake_case_name.gsub!('vector_3', 'vector3_') if snake_case_name.include?('vector_3')
|
843
|
+
snake_case_name.gsub!('vector_2', 'vector2_') if snake_case_name.include?('vector_2')
|
844
|
+
snake_case_name.chop! if snake_case_name.end_with?('_')
|
845
|
+
snake_case_name.to_sym
|
846
|
+
else
|
847
|
+
entry[0]
|
848
|
+
end
|
849
|
+
attach_function api_name, entry[1], entry[2], entry[3]
|
841
850
|
rescue FFI::NotFoundError => e
|
842
851
|
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
843
852
|
end
|
data/lib/rcamera.rb
CHANGED
@@ -19,7 +19,7 @@ module Raylib
|
|
19
19
|
|
20
20
|
# Function
|
21
21
|
|
22
|
-
def self.setup_rcamera_symbols
|
22
|
+
def self.setup_rcamera_symbols(method_naming: :original)
|
23
23
|
entries = [
|
24
24
|
|
25
25
|
# @!method GetCameraForward(camera)
|
@@ -109,7 +109,16 @@ module Raylib
|
|
109
109
|
[:GetCameraProjectionMatrix, :GetCameraProjectionMatrix, [:pointer, :float], Matrix.by_value],
|
110
110
|
]
|
111
111
|
entries.each do |entry|
|
112
|
-
|
112
|
+
api_name = if method_naming == :snake_case
|
113
|
+
snake_case_name = entry[0].to_s.gsub(/([A-Z]+)([A-Z0-9][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z0-9])/, '\1_\2').downcase
|
114
|
+
snake_case_name.gsub!('vector_3', 'vector3_') if snake_case_name.include?('vector_3')
|
115
|
+
snake_case_name.gsub!('vector_2', 'vector2_') if snake_case_name.include?('vector_2')
|
116
|
+
snake_case_name.chop! if snake_case_name.end_with?('_')
|
117
|
+
snake_case_name.to_sym
|
118
|
+
else
|
119
|
+
entry[0]
|
120
|
+
end
|
121
|
+
attach_function api_name, entry[1], entry[2], entry[3]
|
113
122
|
rescue FFI::NotFoundError => e
|
114
123
|
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
115
124
|
end
|
data/lib/rlgl.rb
CHANGED
@@ -77,6 +77,8 @@ module Raylib
|
|
77
77
|
RL_BLEND_DST_ALPHA = 0x80CA # GL_BLEND_DST_ALPHA
|
78
78
|
RL_BLEND_SRC_ALPHA = 0x80CB # GL_BLEND_SRC_ALPHA
|
79
79
|
RL_BLEND_COLOR = 0x8005 # GL_BLEND_COLOR
|
80
|
+
RL_READ_FRAMEBUFFER = 0x8CA8 # GL_READ_FRAMEBUFFER
|
81
|
+
RL_DRAW_FRAMEBUFFER = 0x8CA9 # GL_DRAW_FRAMEBUFFER
|
80
82
|
|
81
83
|
# Enum
|
82
84
|
|
@@ -313,7 +315,7 @@ module Raylib
|
|
313
315
|
|
314
316
|
# Function
|
315
317
|
|
316
|
-
def self.setup_rlgl_symbols
|
318
|
+
def self.setup_rlgl_symbols(method_naming: :original)
|
317
319
|
entries = [
|
318
320
|
|
319
321
|
# @!method rlMatrixMode(mode)
|
@@ -584,6 +586,11 @@ module Raylib
|
|
584
586
|
# @return [void]
|
585
587
|
[:rlDisableFramebuffer, :rlDisableFramebuffer, [], :void],
|
586
588
|
|
589
|
+
# @!method rlGetActiveFramebuffer()
|
590
|
+
# rlGetActiveFramebuffer : Get the currently active render texture (fbo), 0 for default framebuffer
|
591
|
+
# @return [unsigned int]
|
592
|
+
[:rlGetActiveFramebuffer, :rlGetActiveFramebuffer, [], :uint],
|
593
|
+
|
587
594
|
# @!method rlActiveDrawBuffers(count)
|
588
595
|
# rlActiveDrawBuffers : Activate multiple draw color buffers
|
589
596
|
# @param count [int]
|
@@ -1319,7 +1326,16 @@ module Raylib
|
|
1319
1326
|
[:rlLoadDrawQuad, :rlLoadDrawQuad, [], :void],
|
1320
1327
|
]
|
1321
1328
|
entries.each do |entry|
|
1322
|
-
|
1329
|
+
api_name = if method_naming == :snake_case
|
1330
|
+
snake_case_name = entry[0].to_s.gsub(/([A-Z]+)([A-Z0-9][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z0-9])/, '\1_\2').downcase
|
1331
|
+
snake_case_name.gsub!('vector_3', 'vector3_') if snake_case_name.include?('vector_3')
|
1332
|
+
snake_case_name.gsub!('vector_2', 'vector2_') if snake_case_name.include?('vector_2')
|
1333
|
+
snake_case_name.chop! if snake_case_name.end_with?('_')
|
1334
|
+
snake_case_name.to_sym
|
1335
|
+
else
|
1336
|
+
entry[0]
|
1337
|
+
end
|
1338
|
+
attach_function api_name, entry[1], entry[2], entry[3]
|
1323
1339
|
rescue FFI::NotFoundError => e
|
1324
1340
|
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
1325
1341
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raylib-bindings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaiorabbit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
- !ruby/object:Gem::Version
|
84
84
|
version: '0'
|
85
85
|
requirements: []
|
86
|
-
rubygems_version: 3.5.
|
86
|
+
rubygems_version: 3.5.5
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Ruby bindings for raylib, raygui and Physac
|