raylib-bindings 0.6.0-aarch64-linux → 0.7.0-aarch64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +46 -0
- data/LICENSE.txt +1 -1
- data/README.md +37 -14
- data/examples/template.rb +2 -1
- data/lib/libraylib.aarch64.so +0 -0
- data/lib/physac.aarch64.so +0 -0
- data/lib/physac.rb +11 -2
- data/lib/raygui.aarch64.so +0 -0
- data/lib/raygui_main.rb +25 -16
- data/lib/raylib.rb +9 -9
- data/lib/raylib_helper.rb +15 -0
- data/lib/raylib_main.rb +64 -18
- data/lib/raymath.rb +11 -2
- data/lib/rcamera.rb +11 -2
- data/lib/rlgl.rb +50 -18
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da46865198fe416cdeccb2c9c9b96d5094f9ce39e0d560a6db1d5d6212bc878f
|
4
|
+
data.tar.gz: d314ee512cc4e903107f1be7edf962c5c9b2bc8618b758648f0fa3b64f9ec548
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5752c140e57a779931c9053b5a48c90252d8987e7a4c122f1d16de6e26036a89a0d11c5646cc062a310966ba94c3d87bf3e4f4ac46db392695688ddd73b85324
|
7
|
+
data.tar.gz: 8b22607835a9becda47139b676eac5825014fff696ff5d1a58348616610b570fdd8542f4a369695a0c3bcee7d39ca0fa2b36db9b798ea32a69892ff779f3f618
|
data/ChangeLog
CHANGED
@@ -1,3 +1,49 @@
|
|
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
|
+
|
14
|
+
2024-01-07 vaiorabbit <http://twitter.com/vaiorabbit>
|
15
|
+
|
16
|
+
* Updated README
|
17
|
+
* Updated with latest raylib ( https://github.com/raysan5/raylib/commit/be0ea89f830cce2fcb62acfedc69da4faca11b43 )
|
18
|
+
|
19
|
+
2024-01-05 vaiorabbit <http://twitter.com/vaiorabbit>
|
20
|
+
|
21
|
+
* Updated with latest raylib ( https://github.com/raysan5/raylib/commit/eb6dcab308162037272edbad93ea1f10797c7352 ) and raygui ( https://github.com/raysan5/raygui/commit/e30a826909cefbce39bae4ceaee76da6b163e2b1 )
|
22
|
+
|
23
|
+
2023-12-30 vaiorabbit <http://twitter.com/vaiorabbit>
|
24
|
+
|
25
|
+
* examples/raylib_with_tileson.rb : Added
|
26
|
+
|
27
|
+
2023-12-17 vaiorabbit <http://twitter.com/vaiorabbit>
|
28
|
+
|
29
|
+
* examples/shaders_basic_pbr.rb : Added
|
30
|
+
|
31
|
+
2023-12-16 vaiorabbit <http://twitter.com/vaiorabbit>
|
32
|
+
|
33
|
+
* Updated with latest raylib ( https://github.com/raysan5/raylib/commit/fd84ab3cf735a643a074780ba73559d125e35aad ) and raygui ( https://github.com/raysan5/raygui/commit/2c8dc854d4e585761c2d4c77b4abbc46d298d5be )
|
34
|
+
|
35
|
+
2023-12-09 vaiorabbit <http://twitter.com/vaiorabbit>
|
36
|
+
|
37
|
+
* Updated with latest raylib ( https://github.com/raysan5/raylib/commit/a9ba51aa72cfc9c75c2230726a49e1d9065b3c01 ) and raygui ( https://github.com/raysan5/raygui/commit/dc103715435a258c68b00a89ba48b95c146e5b87 )
|
38
|
+
|
39
|
+
2023-11-30 vaiorabbit <http://twitter.com/vaiorabbit>
|
40
|
+
|
41
|
+
* Updated with latest raylib ( https://github.com/raysan5/raylib/commit/e7a486fa81adac1833253c849ca73c5b3f7ef361 )
|
42
|
+
|
43
|
+
2023-11-20 vaiorabbit <http://twitter.com/vaiorabbit>
|
44
|
+
|
45
|
+
* Removed unnecessary dependency
|
46
|
+
|
1
47
|
2023-11-18 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
48
|
|
3
49
|
* Updated with latest raylib ( https://github.com/raysan5/raylib/commit/ae50bfa2cc569c0f8d5bc4315d39db64005b1b08 ) and raygui ( https://github.com/raysan5/raygui/commit/141ae0cd312656b7764b01079e43fc887aaaf4ce )
|
data/LICENSE.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
Ruby-raylib : Yet another raylib wrapper for Ruby
|
2
|
-
Copyright (c) 2021-
|
2
|
+
Copyright (c) 2021-2024 vaiorabbit <http://twitter.com/vaiorabbit>
|
3
3
|
|
4
4
|
This software is provided 'as-is', without any express or implied
|
5
5
|
warranty. In no event will the authors be held liable for any damages
|
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 :
|
6
|
+
* Last modified : 2024-02-03
|
7
7
|
|
8
8
|
Provides Ruby bindings for raylib-related libraries including:
|
9
9
|
|
@@ -23,7 +23,7 @@ Provides Ruby bindings for raylib-related libraries including:
|
|
23
23
|
* Pre-built binaries are inside:
|
24
24
|
* Windows (x86_64)
|
25
25
|
* macOS (x86_64, ARM64)
|
26
|
-
* Linux (x86_64
|
26
|
+
* Linux (x86_64, ARM64)
|
27
27
|
|
28
28
|
## Quick Start ##
|
29
29
|
|
@@ -48,13 +48,13 @@ D:\> ruby template.rb
|
|
48
48
|
* Ruby interpreter
|
49
49
|
* Tested on:
|
50
50
|
* [macOS] https://rvm.io
|
51
|
-
* ruby 3.
|
51
|
+
* ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [arm64-darwin23]
|
52
52
|
* [Windows] https://rubyinstaller.org/downloads/ Ruby+Devkit
|
53
|
-
* ruby 3.
|
53
|
+
* ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x64-mingw-ucrt]
|
54
54
|
* [Linux/x86_64 WSL] https://github.com/rvm/ubuntu_rvm
|
55
55
|
* ruby 3.2.0preview1 (2022-04-03 master f801386f0c) [x86_64-linux]
|
56
56
|
* [Linux/ARM64 Chromebook] https://github.com/rvm/ubuntu_rvm
|
57
|
-
* ruby 3.
|
57
|
+
* ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [aarch64-linux]
|
58
58
|
|
59
59
|
* If you need to build DLLs/shared libralies for your own runtime envrioenment (Linux, etc.):
|
60
60
|
* CMake https://cmake.org/download/
|
@@ -63,19 +63,19 @@ D:\> ruby template.rb
|
|
63
63
|
* [macOS] clang
|
64
64
|
|
65
65
|
$ clang --version
|
66
|
-
Apple clang version
|
67
|
-
Target: arm64-apple-
|
66
|
+
Apple clang version 15.0.0 (clang-1500.0.40.1)
|
67
|
+
Target: arm64-apple-darwin23.0.0
|
68
68
|
Thread model: posix
|
69
69
|
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
|
70
70
|
|
71
71
|
* [Windows] gcc
|
72
72
|
|
73
|
-
gcc (
|
73
|
+
gcc (Rev3, Built by MSYS2 project) 13.2.0
|
74
74
|
|
75
75
|
* [Linux] gcc, clang
|
76
76
|
|
77
77
|
(x86_64) Ubuntu clang version 14.0.0-1ubuntu1
|
78
|
-
(arm64)
|
78
|
+
(arm64) Debian clang version 14.0.6
|
79
79
|
|
80
80
|
<details>
|
81
81
|
<summary>Older versions</summary>
|
@@ -83,19 +83,29 @@ D:\> ruby template.rb
|
|
83
83
|
* Ruby interpreter
|
84
84
|
* Tested on:
|
85
85
|
* [macOS]
|
86
|
+
* ruby 3.2.1 (2023-02-08 revision 31819e82c8) [arm64-darwin22]
|
86
87
|
* ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin21]
|
87
88
|
* ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
|
88
89
|
* ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin20]
|
89
90
|
* ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [arm64-darwin20]
|
90
91
|
* [Windows] https://rubyinstaller.org/downloads/ Ruby+Devkit
|
92
|
+
* ruby 3.2.0 (2022-12-25 revision a528908271) [x64-mingw-ucrt]
|
91
93
|
* ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]
|
92
94
|
* ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x64-mingw-ucrt]
|
93
95
|
* ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x64-mingw32]
|
96
|
+
* [Linux/ARM64 Chromebook] https://github.com/rvm/ubuntu_rvm
|
97
|
+
* ruby 3.2.0 (2022-12-25 revision a528908271) [aarch64-linux]
|
94
98
|
|
95
99
|
* Compiler
|
96
100
|
* Tested on:
|
97
101
|
* [macOS] clang
|
98
102
|
|
103
|
+
$ clang --version
|
104
|
+
Apple clang version 14.0.0 (clang-1400.0.29.202)
|
105
|
+
Target: arm64-apple-darwin22.2.0
|
106
|
+
Thread model: posix
|
107
|
+
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
|
108
|
+
|
99
109
|
$ clang --version
|
100
110
|
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
|
101
111
|
Target: arm64-apple-darwin21.5.0
|
@@ -115,13 +125,16 @@ D:\> ruby template.rb
|
|
115
125
|
|
116
126
|
* [Windows] gcc
|
117
127
|
|
118
|
-
gcc (
|
128
|
+
gcc (Rev7, Built by MSYS2 project) 12.2.0
|
119
129
|
gcc (Rev10, Built by MSYS2 project) 11.2.0
|
130
|
+
gcc (Rev9, Built by MSYS2 project) 11.2.0
|
120
131
|
|
121
132
|
</details>
|
122
133
|
|
123
134
|
## Projects ##
|
124
135
|
|
136
|
+
### Games ###
|
137
|
+
|
125
138
|
See the projects below to learn how to use this library:
|
126
139
|
|
127
140
|
* Whac-a-Mole! : Ruby raylib bindings demo
|
@@ -132,6 +145,16 @@ See the projects below to learn how to use this library:
|
|
132
145
|
* <img src="https://raw.githubusercontent.com/vaiorabbit/raylib-bindings-pacone/main/doc/screenshot_00.png" width="600">
|
133
146
|
* <https://github.com/vaiorabbit/raylib-bindings-pacone>
|
134
147
|
|
148
|
+
* flapper.rb : Ruby raylib bindings demo
|
149
|
+
* <img src="https://raw.githubusercontent.com/vaiorabbit/raylib-bindings-flapper/main/doc/screenshot_01.png" width="150">
|
150
|
+
* <https://github.com/vaiorabbit/raylib-bindings-flapper>
|
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
|
+
|
135
158
|
## Limitation ##
|
136
159
|
|
137
160
|
* `SetTraceLogCallback` and `TraceLogCallback` are unusable since Ruby-FFI does not support `:varargs` parameter in callbacks (`Proc`, etc.)
|
@@ -141,20 +164,20 @@ See the projects below to learn how to use this library:
|
|
141
164
|
|
142
165
|
Shared libraries in `lib` directory are built on top of these products and are available under the terms of these licenses:
|
143
166
|
|
144
|
-
* `libraylib.dylib`, `libraylib.dll`, `libraylib.aarch64.so`, `libraylib.x86_64.so`
|
167
|
+
* `libraylib.arm64.dylib`, `libraylib.x86_64.dylib`, `libraylib.dll`, `libraylib.aarch64.so`, `libraylib.x86_64.so`
|
145
168
|
* raylib ( https://github.com/raysan5/raylib )
|
146
169
|
* zlib License https://github.com/raysan5/raylib/blob/master/LICENSE
|
147
|
-
* `raygui.dylib`, `raygui.dll`, `raygui.aarch64.so`, `raygui.x86_64.so`
|
170
|
+
* `raygui.arm64.dylib`, `raygui.x86_64.dylib`, `raygui.dll`, `raygui.aarch64.so`, `raygui.x86_64.so`
|
148
171
|
* raygui ( https://github.com/raysan5/raygui )
|
149
172
|
* zlib License https://github.com/raysan5/raygui/blob/master/LICENSE
|
150
|
-
* `physac.dylib`, `physac.dll`, `physac.aarch64.so
|
173
|
+
* `physac.arm64.dylib`, `physac.x86_64.dylib`, `physac.dll`, `physac.aarch64.so`, `physac.x86_64.so`
|
151
174
|
* Physac ( https://github.com/raysan5/physac )
|
152
175
|
* LICENSE: zlib/libpng https://github.com/raysan5/physac/blob/4a8e17f263fb8e1150b3fbafc96f880c7d7a4833/src/physac.h#L51-L68
|
153
176
|
|
154
177
|
All ruby codes here are available under the terms of the zlib/libpng License ( http://opensource.org/licenses/Zlib ).
|
155
178
|
|
156
179
|
Ruby-raylib : Yet another raylib wrapper for Ruby
|
157
|
-
Copyright (c) 2021-
|
180
|
+
Copyright (c) 2021-2024 vaiorabbit <http://twitter.com/vaiorabbit>
|
158
181
|
|
159
182
|
This software is provided 'as-is', without any express or implied
|
160
183
|
warranty. In no event will the authors be held liable for any damages
|
data/examples/template.rb
CHANGED
@@ -19,7 +19,8 @@ case RUBY_PLATFORM
|
|
19
19
|
when /mswin|msys|mingw|cygwin/
|
20
20
|
Raylib.load_lib(shared_lib_path + 'libraylib.dll', raygui_libpath: shared_lib_path + 'raygui.dll', physac_libpath: shared_lib_path + 'physac.dll')
|
21
21
|
when /darwin/
|
22
|
-
|
22
|
+
arch = RUBY_PLATFORM.split('-')[0]
|
23
|
+
Raylib.load_lib(shared_lib_path + "libraylib.#{arch}.dylib", raygui_libpath: shared_lib_path + "raygui.#{arch}.dylib", physac_libpath: shared_lib_path + "physac.#{arch}.dylib")
|
23
24
|
when /linux/
|
24
25
|
arch = RUBY_PLATFORM.split('-')[0]
|
25
26
|
Raylib.load_lib(shared_lib_path + "libraylib.#{arch}.so", raygui_libpath: shared_lib_path + "raygui.#{arch}.so", physac_libpath: shared_lib_path + "physac.#{arch}.so")
|
data/lib/libraylib.aarch64.so
CHANGED
Binary file
|
data/lib/physac.aarch64.so
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_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
@@ -61,6 +61,9 @@ module Raylib
|
|
61
61
|
# Math helper
|
62
62
|
#
|
63
63
|
|
64
|
+
DEG2RAD = Math::PI / 180.0
|
65
|
+
RAD2DEG = 180.0 / Math::PI
|
66
|
+
|
64
67
|
class Vector2
|
65
68
|
def self.create(x = 0, y = 0)
|
66
69
|
Vector2.new.set(x, y)
|
@@ -76,6 +79,18 @@ module Raylib
|
|
76
79
|
self
|
77
80
|
end
|
78
81
|
|
82
|
+
def add(x, y)
|
83
|
+
self[:x] = self[:x] + x
|
84
|
+
self[:y] = self[:y] + y
|
85
|
+
self
|
86
|
+
end
|
87
|
+
|
88
|
+
def add_vector(v)
|
89
|
+
self[:x] = self[:x] + v[:x]
|
90
|
+
self[:y] = self[:y] + v[:y]
|
91
|
+
self
|
92
|
+
end
|
93
|
+
|
79
94
|
def to_a
|
80
95
|
[x, y]
|
81
96
|
end
|
data/lib/raylib_main.rb
CHANGED
@@ -12,9 +12,9 @@ module Raylib
|
|
12
12
|
# Define/Macro
|
13
13
|
|
14
14
|
RAYLIB_VERSION_MAJOR = 5
|
15
|
-
RAYLIB_VERSION_MINOR =
|
15
|
+
RAYLIB_VERSION_MINOR = 1
|
16
16
|
RAYLIB_VERSION_PATCH = 0
|
17
|
-
RAYLIB_VERSION = "5.
|
17
|
+
RAYLIB_VERSION = "5.1-dev"
|
18
18
|
|
19
19
|
# Enum
|
20
20
|
|
@@ -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
|
|
@@ -1019,7 +1019,6 @@ module Raylib
|
|
1019
1019
|
:vResolution, :int, # Vertical resolution in pixels
|
1020
1020
|
:hScreenSize, :float, # Horizontal size in meters
|
1021
1021
|
:vScreenSize, :float, # Vertical size in meters
|
1022
|
-
:vScreenCenter, :float, # Screen center in meters
|
1023
1022
|
:eyeToScreenDistance, :float, # Distance between eye and display in meters
|
1024
1023
|
:lensSeparationDistance, :float, # Lens separation distance in meters
|
1025
1024
|
:interpupillaryDistance, :float, # IPD (distance between pupils) in meters
|
@@ -1034,8 +1033,6 @@ module Raylib
|
|
1034
1033
|
def hScreenSize=(v) self[:hScreenSize] = v end
|
1035
1034
|
def vScreenSize = self[:vScreenSize]
|
1036
1035
|
def vScreenSize=(v) self[:vScreenSize] = v end
|
1037
|
-
def vScreenCenter = self[:vScreenCenter]
|
1038
|
-
def vScreenCenter=(v) self[:vScreenCenter] = v end
|
1039
1036
|
def eyeToScreenDistance = self[:eyeToScreenDistance]
|
1040
1037
|
def eyeToScreenDistance=(v) self[:eyeToScreenDistance] = v end
|
1041
1038
|
def lensSeparationDistance = self[:lensSeparationDistance]
|
@@ -1126,7 +1123,7 @@ module Raylib
|
|
1126
1123
|
|
1127
1124
|
# Function
|
1128
1125
|
|
1129
|
-
def self.setup_raylib_symbols
|
1126
|
+
def self.setup_raylib_symbols(method_naming: :original)
|
1130
1127
|
entries = [
|
1131
1128
|
|
1132
1129
|
# @!method InitWindow(width, height, title)
|
@@ -2010,9 +2007,9 @@ module Raylib
|
|
2010
2007
|
|
2011
2008
|
# @!method UnloadAutomationEventList(list)
|
2012
2009
|
# UnloadAutomationEventList : Unload automation events list from file
|
2013
|
-
# @param list [AutomationEventList
|
2010
|
+
# @param list [AutomationEventList]
|
2014
2011
|
# @return [void]
|
2015
|
-
[:UnloadAutomationEventList, :UnloadAutomationEventList, [
|
2012
|
+
[:UnloadAutomationEventList, :UnloadAutomationEventList, [AutomationEventList.by_value], :void],
|
2016
2013
|
|
2017
2014
|
# @!method ExportAutomationEventList(list, fileName)
|
2018
2015
|
# ExportAutomationEventList : Export automation events list as text file
|
@@ -2332,6 +2329,16 @@ module Raylib
|
|
2332
2329
|
# @return [void]
|
2333
2330
|
[:SetShapesTexture, :SetShapesTexture, [Texture2D.by_value, Rectangle.by_value], :void],
|
2334
2331
|
|
2332
|
+
# @!method GetShapesTexture()
|
2333
|
+
# GetShapesTexture : Get texture that is used for shapes drawing
|
2334
|
+
# @return [Texture2D]
|
2335
|
+
[:GetShapesTexture, :GetShapesTexture, [], Texture2D.by_value],
|
2336
|
+
|
2337
|
+
# @!method GetShapesTextureRectangle()
|
2338
|
+
# GetShapesTextureRectangle : Get texture source rectangle that is used for shapes drawing
|
2339
|
+
# @return [Rectangle]
|
2340
|
+
[:GetShapesTextureRectangle, :GetShapesTextureRectangle, [], Rectangle.by_value],
|
2341
|
+
|
2335
2342
|
# @!method DrawPixel(posX, posY, color)
|
2336
2343
|
# DrawPixel : Draw a pixel
|
2337
2344
|
# @param posX [int]
|
@@ -2926,6 +2933,15 @@ module Raylib
|
|
2926
2933
|
# @return [Image]
|
2927
2934
|
[:LoadImageAnim, :LoadImageAnim, [:pointer, :pointer], Image.by_value],
|
2928
2935
|
|
2936
|
+
# @!method LoadImageAnimFromMemory(fileType, fileData, dataSize, frames)
|
2937
|
+
# LoadImageAnimFromMemory : Load image sequence from memory buffer
|
2938
|
+
# @param fileType [const char *]
|
2939
|
+
# @param fileData [const unsigned char *]
|
2940
|
+
# @param dataSize [int]
|
2941
|
+
# @param frames [int *]
|
2942
|
+
# @return [Image]
|
2943
|
+
[:LoadImageAnimFromMemory, :LoadImageAnimFromMemory, [:pointer, :pointer, :int, :pointer], Image.by_value],
|
2944
|
+
|
2929
2945
|
# @!method LoadImageFromMemory(fileType, fileData, dataSize)
|
2930
2946
|
# LoadImageFromMemory : Load image from memory buffer, fileType refers to extension: i.e. '.png'
|
2931
2947
|
# @param fileType [const char *]
|
@@ -3149,6 +3165,14 @@ module Raylib
|
|
3149
3165
|
# @return [void]
|
3150
3166
|
[:ImageBlurGaussian, :ImageBlurGaussian, [:pointer, :int], :void],
|
3151
3167
|
|
3168
|
+
# @!method ImageKernelConvolution(image, kernel, kernelSize)
|
3169
|
+
# ImageKernelConvolution : Apply Custom Square image convolution kernel
|
3170
|
+
# @param image [Image *]
|
3171
|
+
# @param kernel [float*]
|
3172
|
+
# @param kernelSize [int]
|
3173
|
+
# @return [void]
|
3174
|
+
[:ImageKernelConvolution, :ImageKernelConvolution, [:pointer, :pointer, :int], :void],
|
3175
|
+
|
3152
3176
|
# @!method ImageResize(image, newWidth, newHeight)
|
3153
3177
|
# ImageResize : Resize image (Bicubic scaling algorithm)
|
3154
3178
|
# @param image [Image *]
|
@@ -3994,7 +4018,7 @@ module Raylib
|
|
3994
4018
|
|
3995
4019
|
# @!method TextReplace(text, replace, by)
|
3996
4020
|
# TextReplace : Replace text string (WARNING: memory must be freed!)
|
3997
|
-
# @param text [char *]
|
4021
|
+
# @param text [const char *]
|
3998
4022
|
# @param replace [const char *]
|
3999
4023
|
# @param by [const char *]
|
4000
4024
|
# @return [char *]
|
@@ -4063,6 +4087,12 @@ module Raylib
|
|
4063
4087
|
# @return [int]
|
4064
4088
|
[:TextToInteger, :TextToInteger, [:pointer], :int],
|
4065
4089
|
|
4090
|
+
# @!method TextToFloat(text)
|
4091
|
+
# TextToFloat : Get float value from text (negative values not supported)
|
4092
|
+
# @param text [const char *]
|
4093
|
+
# @return [float]
|
4094
|
+
[:TextToFloat, :TextToFloat, [:pointer], :float],
|
4095
|
+
|
4066
4096
|
# @!method DrawLine3D(startPos, endPos, color)
|
4067
4097
|
# DrawLine3D : Draw a line in 3D world space
|
4068
4098
|
# @param startPos [Vector3]
|
@@ -4409,13 +4439,6 @@ module Raylib
|
|
4409
4439
|
# @return [void]
|
4410
4440
|
[:DrawMeshInstanced, :DrawMeshInstanced, [Mesh.by_value, Material.by_value, :pointer, :int], :void],
|
4411
4441
|
|
4412
|
-
# @!method ExportMesh(mesh, fileName)
|
4413
|
-
# ExportMesh : Export mesh data to file, returns true on success
|
4414
|
-
# @param mesh [Mesh]
|
4415
|
-
# @param fileName [const char *]
|
4416
|
-
# @return [bool]
|
4417
|
-
[:ExportMesh, :ExportMesh, [Mesh.by_value, :pointer], :bool],
|
4418
|
-
|
4419
4442
|
# @!method GetMeshBoundingBox(mesh)
|
4420
4443
|
# GetMeshBoundingBox : Compute mesh bounding box limits
|
4421
4444
|
# @param mesh [Mesh]
|
@@ -4428,6 +4451,20 @@ module Raylib
|
|
4428
4451
|
# @return [void]
|
4429
4452
|
[:GenMeshTangents, :GenMeshTangents, [:pointer], :void],
|
4430
4453
|
|
4454
|
+
# @!method ExportMesh(mesh, fileName)
|
4455
|
+
# ExportMesh : Export mesh data to file, returns true on success
|
4456
|
+
# @param mesh [Mesh]
|
4457
|
+
# @param fileName [const char *]
|
4458
|
+
# @return [bool]
|
4459
|
+
[:ExportMesh, :ExportMesh, [Mesh.by_value, :pointer], :bool],
|
4460
|
+
|
4461
|
+
# @!method ExportMeshAsCode(mesh, fileName)
|
4462
|
+
# ExportMeshAsCode : Export mesh as code file (.h) defining multiple arrays of vertex attributes
|
4463
|
+
# @param mesh [Mesh]
|
4464
|
+
# @param fileName [const char *]
|
4465
|
+
# @return [bool]
|
4466
|
+
[:ExportMeshAsCode, :ExportMeshAsCode, [Mesh.by_value, :pointer], :bool],
|
4467
|
+
|
4431
4468
|
# @!method GenMeshPoly(sides, radius)
|
4432
4469
|
# GenMeshPoly : Generate polygonal mesh
|
4433
4470
|
# @param sides [int]
|
@@ -5080,7 +5117,16 @@ module Raylib
|
|
5080
5117
|
[:DetachAudioMixedProcessor, :DetachAudioMixedProcessor, [:AudioCallback], :void],
|
5081
5118
|
]
|
5082
5119
|
entries.each do |entry|
|
5083
|
-
|
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]
|
5084
5130
|
rescue FFI::NotFoundError => e
|
5085
5131
|
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
5086
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]
|
@@ -604,6 +611,13 @@ module Raylib
|
|
604
611
|
# @return [void]
|
605
612
|
[:rlBlitFramebuffer, :rlBlitFramebuffer, [:int, :int, :int, :int, :int, :int, :int, :int, :int], :void],
|
606
613
|
|
614
|
+
# @!method rlBindFramebuffer(target, framebuffer)
|
615
|
+
# rlBindFramebuffer : Bind framebuffer (FBO)
|
616
|
+
# @param target [unsigned int]
|
617
|
+
# @param framebuffer [unsigned int]
|
618
|
+
# @return [void]
|
619
|
+
[:rlBindFramebuffer, :rlBindFramebuffer, [:uint, :uint], :void],
|
620
|
+
|
607
621
|
# @!method rlEnableColorBlend()
|
608
622
|
# rlEnableColorBlend : Enable color blending
|
609
623
|
# @return [void]
|
@@ -644,6 +658,15 @@ module Raylib
|
|
644
658
|
# @return [void]
|
645
659
|
[:rlDisableBackfaceCulling, :rlDisableBackfaceCulling, [], :void],
|
646
660
|
|
661
|
+
# @!method rlColorMask(r, g, b, a)
|
662
|
+
# rlColorMask : Color mask control
|
663
|
+
# @param r [bool]
|
664
|
+
# @param g [bool]
|
665
|
+
# @param b [bool]
|
666
|
+
# @param a [bool]
|
667
|
+
# @return [void]
|
668
|
+
[:rlColorMask, :rlColorMask, [:bool, :bool, :bool, :bool], :void],
|
669
|
+
|
647
670
|
# @!method rlSetCullFace(mode)
|
648
671
|
# rlSetCullFace : Set face culling mode
|
649
672
|
# @param mode [int]
|
@@ -872,7 +895,7 @@ module Raylib
|
|
872
895
|
[:rlLoadVertexArray, :rlLoadVertexArray, [], :uint],
|
873
896
|
|
874
897
|
# @!method rlLoadVertexBuffer(buffer, size, dynamic)
|
875
|
-
# rlLoadVertexBuffer : Load a vertex buffer
|
898
|
+
# rlLoadVertexBuffer : Load a vertex buffer object
|
876
899
|
# @param buffer [const void *]
|
877
900
|
# @param size [int]
|
878
901
|
# @param dynamic [bool]
|
@@ -880,7 +903,7 @@ module Raylib
|
|
880
903
|
[:rlLoadVertexBuffer, :rlLoadVertexBuffer, [:pointer, :int, :bool], :uint],
|
881
904
|
|
882
905
|
# @!method rlLoadVertexBufferElement(buffer, size, dynamic)
|
883
|
-
# rlLoadVertexBufferElement : Load
|
906
|
+
# rlLoadVertexBufferElement : Load vertex buffer elements object
|
884
907
|
# @param buffer [const void *]
|
885
908
|
# @param size [int]
|
886
909
|
# @param dynamic [bool]
|
@@ -888,7 +911,7 @@ module Raylib
|
|
888
911
|
[:rlLoadVertexBufferElement, :rlLoadVertexBufferElement, [:pointer, :int, :bool], :uint],
|
889
912
|
|
890
913
|
# @!method rlUpdateVertexBuffer(bufferId, data, dataSize, offset)
|
891
|
-
# rlUpdateVertexBuffer : Update
|
914
|
+
# rlUpdateVertexBuffer : Update vertex buffer object data on GPU buffer
|
892
915
|
# @param bufferId [unsigned int]
|
893
916
|
# @param data [const void *]
|
894
917
|
# @param dataSize [int]
|
@@ -897,7 +920,7 @@ module Raylib
|
|
897
920
|
[:rlUpdateVertexBuffer, :rlUpdateVertexBuffer, [:uint, :pointer, :int, :int], :void],
|
898
921
|
|
899
922
|
# @!method rlUpdateVertexBufferElements(id, data, dataSize, offset)
|
900
|
-
# rlUpdateVertexBufferElements : Update vertex buffer elements
|
923
|
+
# rlUpdateVertexBufferElements : Update vertex buffer elements data on GPU buffer
|
901
924
|
# @param id [unsigned int]
|
902
925
|
# @param data [const void *]
|
903
926
|
# @param dataSize [int]
|
@@ -906,19 +929,19 @@ module Raylib
|
|
906
929
|
[:rlUpdateVertexBufferElements, :rlUpdateVertexBufferElements, [:uint, :pointer, :int, :int], :void],
|
907
930
|
|
908
931
|
# @!method rlUnloadVertexArray(vaoId)
|
909
|
-
# rlUnloadVertexArray
|
932
|
+
# rlUnloadVertexArray : Unload vertex array (vao)
|
910
933
|
# @param vaoId [unsigned int]
|
911
934
|
# @return [void]
|
912
935
|
[:rlUnloadVertexArray, :rlUnloadVertexArray, [:uint], :void],
|
913
936
|
|
914
937
|
# @!method rlUnloadVertexBuffer(vboId)
|
915
|
-
# rlUnloadVertexBuffer
|
938
|
+
# rlUnloadVertexBuffer : Unload vertex buffer object
|
916
939
|
# @param vboId [unsigned int]
|
917
940
|
# @return [void]
|
918
941
|
[:rlUnloadVertexBuffer, :rlUnloadVertexBuffer, [:uint], :void],
|
919
942
|
|
920
943
|
# @!method rlSetVertexAttribute(index, compSize, type, normalized, stride, pointer)
|
921
|
-
# rlSetVertexAttribute
|
944
|
+
# rlSetVertexAttribute : Set vertex attribute data configuration
|
922
945
|
# @param index [unsigned int]
|
923
946
|
# @param compSize [int]
|
924
947
|
# @param type [int]
|
@@ -929,14 +952,14 @@ module Raylib
|
|
929
952
|
[:rlSetVertexAttribute, :rlSetVertexAttribute, [:uint, :int, :int, :bool, :int, :pointer], :void],
|
930
953
|
|
931
954
|
# @!method rlSetVertexAttributeDivisor(index, divisor)
|
932
|
-
# rlSetVertexAttributeDivisor
|
955
|
+
# rlSetVertexAttributeDivisor : Set vertex attribute data divisor
|
933
956
|
# @param index [unsigned int]
|
934
957
|
# @param divisor [int]
|
935
958
|
# @return [void]
|
936
959
|
[:rlSetVertexAttributeDivisor, :rlSetVertexAttributeDivisor, [:uint, :int], :void],
|
937
960
|
|
938
961
|
# @!method rlSetVertexAttributeDefault(locIndex, value, attribType, count)
|
939
|
-
# rlSetVertexAttributeDefault : Set vertex attribute default value
|
962
|
+
# rlSetVertexAttributeDefault : Set vertex attribute default value, when attribute to provided
|
940
963
|
# @param locIndex [int]
|
941
964
|
# @param value [const void *]
|
942
965
|
# @param attribType [int]
|
@@ -945,14 +968,14 @@ module Raylib
|
|
945
968
|
[:rlSetVertexAttributeDefault, :rlSetVertexAttributeDefault, [:int, :pointer, :int, :int], :void],
|
946
969
|
|
947
970
|
# @!method rlDrawVertexArray(offset, count)
|
948
|
-
# rlDrawVertexArray
|
971
|
+
# rlDrawVertexArray : Draw vertex array (currently active vao)
|
949
972
|
# @param offset [int]
|
950
973
|
# @param count [int]
|
951
974
|
# @return [void]
|
952
975
|
[:rlDrawVertexArray, :rlDrawVertexArray, [:int, :int], :void],
|
953
976
|
|
954
977
|
# @!method rlDrawVertexArrayElements(offset, count, buffer)
|
955
|
-
# rlDrawVertexArrayElements
|
978
|
+
# rlDrawVertexArrayElements : Draw vertex array elements
|
956
979
|
# @param offset [int]
|
957
980
|
# @param count [int]
|
958
981
|
# @param buffer [const void *]
|
@@ -960,7 +983,7 @@ module Raylib
|
|
960
983
|
[:rlDrawVertexArrayElements, :rlDrawVertexArrayElements, [:int, :int, :pointer], :void],
|
961
984
|
|
962
985
|
# @!method rlDrawVertexArrayInstanced(offset, count, instances)
|
963
|
-
# rlDrawVertexArrayInstanced
|
986
|
+
# rlDrawVertexArrayInstanced : Draw vertex array (currently active vao) with instancing
|
964
987
|
# @param offset [int]
|
965
988
|
# @param count [int]
|
966
989
|
# @param instances [int]
|
@@ -968,7 +991,7 @@ module Raylib
|
|
968
991
|
[:rlDrawVertexArrayInstanced, :rlDrawVertexArrayInstanced, [:int, :int, :int], :void],
|
969
992
|
|
970
993
|
# @!method rlDrawVertexArrayElementsInstanced(offset, count, buffer, instances)
|
971
|
-
# rlDrawVertexArrayElementsInstanced
|
994
|
+
# rlDrawVertexArrayElementsInstanced : Draw vertex array elements with instancing
|
972
995
|
# @param offset [int]
|
973
996
|
# @param count [int]
|
974
997
|
# @param buffer [const void *]
|
@@ -977,7 +1000,7 @@ module Raylib
|
|
977
1000
|
[:rlDrawVertexArrayElementsInstanced, :rlDrawVertexArrayElementsInstanced, [:int, :int, :pointer, :int], :void],
|
978
1001
|
|
979
1002
|
# @!method rlLoadTexture(data, width, height, format, mipmapCount)
|
980
|
-
# rlLoadTexture : Load texture
|
1003
|
+
# rlLoadTexture : Load texture data
|
981
1004
|
# @param data [const void *]
|
982
1005
|
# @param width [int]
|
983
1006
|
# @param height [int]
|
@@ -995,7 +1018,7 @@ module Raylib
|
|
995
1018
|
[:rlLoadTextureDepth, :rlLoadTextureDepth, [:int, :int, :bool], :uint],
|
996
1019
|
|
997
1020
|
# @!method rlLoadTextureCubemap(data, size, format)
|
998
|
-
# rlLoadTextureCubemap : Load texture cubemap
|
1021
|
+
# rlLoadTextureCubemap : Load texture cubemap data
|
999
1022
|
# @param data [const void *]
|
1000
1023
|
# @param size [int]
|
1001
1024
|
# @param format [int]
|
@@ -1003,7 +1026,7 @@ module Raylib
|
|
1003
1026
|
[:rlLoadTextureCubemap, :rlLoadTextureCubemap, [:pointer, :int, :int], :uint],
|
1004
1027
|
|
1005
1028
|
# @!method rlUpdateTexture(id, offsetX, offsetY, width, height, format, data)
|
1006
|
-
# rlUpdateTexture : Update
|
1029
|
+
# rlUpdateTexture : Update texture with new data on GPU
|
1007
1030
|
# @param id [unsigned int]
|
1008
1031
|
# @param offsetX [int]
|
1009
1032
|
# @param offsetY [int]
|
@@ -1303,7 +1326,16 @@ module Raylib
|
|
1303
1326
|
[:rlLoadDrawQuad, :rlLoadDrawQuad, [], :void],
|
1304
1327
|
]
|
1305
1328
|
entries.each do |entry|
|
1306
|
-
|
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]
|
1307
1339
|
rescue FFI::NotFoundError => e
|
1308
1340
|
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
1309
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: aarch64-linux
|
6
6
|
authors:
|
7
7
|
- vaiorabbit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.16'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: opengl-bindings2
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '2'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '2'
|
41
27
|
description: 'Ruby bindings for raylib ( https://github.com/raysan5/raylib ), raygui
|
42
28
|
( https://github.com/raysan5/raygui ) and Physac ( https://github.com/raysan5/physac
|
43
29
|
).
|
@@ -85,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
71
|
- !ruby/object:Gem::Version
|
86
72
|
version: '0'
|
87
73
|
requirements: []
|
88
|
-
rubygems_version: 3.
|
74
|
+
rubygems_version: 3.5.5
|
89
75
|
signing_key:
|
90
76
|
specification_version: 4
|
91
77
|
summary: Ruby bindings for raylib, raygui and Physac
|