raylib-bindings 0.5.6 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60c0ed2e964a28a7b861f1dd9f2b8f35e9d8e65bec1f7c90746675b58d2407e4
4
- data.tar.gz: e3030f30c9520538fae1eee5cc58db9308c6cd17fed35c58c311035927692a28
3
+ metadata.gz: e3fbac3602a46b5d91f37bae57e044b14c00a5067d95f7b1175d2a80a0a3c300
4
+ data.tar.gz: 3cd2950960e81b4ca50c05754ccf7cfea42da671bb332ab611add263cf2bad07
5
5
  SHA512:
6
- metadata.gz: 4284b47b0c43125635254ed3eb44986ce29b0df6541521e46d1df37663c134717255a4746f959d6d320429be87c9f7d4d6f23d9c540c61045474a4ca8503d24e
7
- data.tar.gz: b36f8196992e4b8ee6002d1b8ebea803a1eb5a019ceedda5f4477ea7d14baaa0214bd549a86184883ce9473964e9480775c05fd6bcef0a732e5d6bdf7cf912c3
6
+ metadata.gz: c977faefd030c09b8be636947f760ce868f50e9507d48cd8692beb551a0a291a7c9a4d23b7ab79e2cd362d2323ee631b3de260bfb72dc98586193bfb2b8cf497
7
+ data.tar.gz: 444503a05977130ba0422fd7e55c984662305124c9a8c430abbfe45fde7e8f1eba15bb6e4679dd5592050b9952344df430e7aef4266484f19f8c6f57825364e4
data/ChangeLog CHANGED
@@ -1,3 +1,25 @@
1
+ 2023-10-08 vaiorabbit <http://twitter.com/vaiorabbit>
2
+
3
+ * Updated with latest raylib ( https://github.com/raysan5/raylib/commit/97c2744a16ad7e6cf6b546a7a6416ec6b21e3a6c ) and raygui ( https://github.com/raysan5/raygui/commit/85a5c104f509b183c8cc7db0d90c2ab7a2b198c8)
4
+
5
+ 2023-09-30 vaiorabbit <http://twitter.com/vaiorabbit>
6
+
7
+ * Use Ruby-FFI 1.16 ( https://github.com/ffi/ffi )
8
+
9
+ 2023-09-23 vaiorabbit <http://twitter.com/vaiorabbit>
10
+
11
+ * example/raylib_with_imgui.rb : Added
12
+
13
+ 2023-09-16 vaiorabbit <http://twitter.com/vaiorabbit>
14
+
15
+ * lib/raygui_helper.rb: Added more APIs
16
+ * example/gui_controls.rb: Added
17
+ * example/shaders_basic_lighting.rb: Added
18
+
19
+ 2023-09-12 vaiorabbit <http://twitter.com/vaiorabbit>
20
+
21
+ * Updated with latest raylib ( https://github.com/raysan5/raylib/commit/2e7a7877a51ca33487642bd7ed0367b017b54486 ) and raygui ( https://github.com/raysan5/raygui/commit/1c3305031d2dcab2fbd3c7d7ded8b7aee1738908)
22
+
1
23
  2023-09-09 vaiorabbit <http://twitter.com/vaiorabbit>
2
24
 
3
25
  * Updated with latest raylib ( https://github.com/raysan5/raylib/commit/37f60e75e72eebd5ff687b8857bf9043d291b0df ) and raygui ( https://github.com/raysan5/raygui/commit/0fccdc61fbd787fdfa9e254fd99def2cdb34fb10 )
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 : 2023-09-09
6
+ * Last modified : 2023-10-08
7
7
 
8
8
  Provides Ruby bindings for raylib-related libraries including:
9
9
 
Binary file
data/lib/libraylib.dll CHANGED
Binary file
data/lib/libraylib.dylib CHANGED
Binary file
Binary file
Binary file
data/lib/physac.dll CHANGED
Binary file
Binary file
data/lib/raygui.dll CHANGED
Binary file
data/lib/raygui.dylib CHANGED
Binary file
data/lib/raygui.x86_64.so CHANGED
Binary file
data/lib/raygui_helper.rb CHANGED
@@ -6,23 +6,122 @@ require 'ffi'
6
6
 
7
7
  module Raylib
8
8
 
9
- def RGuiButton(bounds, text)
10
- result = GuiButton(bounds, text)
11
- return result == 1
9
+ def RGuiTabBar(bounds, text, count, active)
10
+ active_buf = FFI::MemoryPointer.new(:int, 1)
11
+ active_buf.put(:int, 0, active)
12
+ result = GuiTabBar(bounds, text, count, active_buf)
13
+ return active_buf.get(:int, 0), result
12
14
  end
13
15
 
14
- def RGuiSliderBar(bounds, textLeft, textRight, value, minValue, maxValue)
15
- value_buf = FFI::MemoryPointer.new(:float, 1)
16
- value_buf.put_float(0, value)
17
- result = GuiSliderBar(bounds, textLeft, textRight, value_buf, minValue, maxValue)
18
- return value_buf.read_float
16
+ def RGuiToggle(bounds, text, active)
17
+ active_buf = FFI::MemoryPointer.new(:int, 1)
18
+ active_buf.put(:int, 0, active)
19
+ result = GuiToggle(bounds, text, active_buf)
20
+ return active_buf.get(:int, 0), result
21
+ end
22
+
23
+ def RGuiToggleGroup(bounds, text, active)
24
+ active_buf = FFI::MemoryPointer.new(:int, 1)
25
+ active_buf.put(:int, 0, active)
26
+ result = GuiToggleGroup(bounds, text, active_buf)
27
+ return active_buf.get(:int, 0), result
28
+ end
29
+
30
+ def RGuiToggleSlider(bounds, text, active)
31
+ active_buf = FFI::MemoryPointer.new(:int, 1)
32
+ active_buf.put(:int, 0, active)
33
+ result = GuiToggleSlider(bounds, text, active_buf)
34
+ return active_buf.get(:int, 0), result
19
35
  end
20
36
 
21
37
  def RGuiCheckBox(bounds, text, checked)
22
38
  checked_buf = FFI::MemoryPointer.new(:bool, 1)
23
39
  checked_buf.put(:bool, 0, checked)
24
40
  result = GuiCheckBox(bounds, text, checked_buf)
25
- return checked_buf.get(:bool, 0)
41
+ return checked_buf.get(:bool, 0), result
42
+ end
43
+
44
+ def RGuiComboBox(bounds, text, active)
45
+ active_buf = FFI::MemoryPointer.new(:int, 1)
46
+ active_buf.put(:int, 0, active)
47
+ result = GuiComboBox(bounds, text, active_buf)
48
+ return active_buf.get(:int, 0), result
49
+ end
50
+
51
+ def RGuiDropdownBox(bounds, text, active, editMode)
52
+ active_buf = FFI::MemoryPointer.new(:int, 1)
53
+ active_buf.put(:int, 0, active)
54
+ result = GuiDropdownBox(bounds, text, active_buf, editMode)
55
+ return active_buf.get(:int, 0), result
56
+ end
57
+
58
+ def RGuiSpinner(bounds, text, value, minValue, maxValue, editMode)
59
+ value_buf = FFI::MemoryPointer.new(:int, 1)
60
+ value_buf.put(:int, 0, value)
61
+ result = GuiSpinner(bounds, text, value_buf, minValue, maxValue, editMode)
62
+ return value_buf.get(:int, 0), result
63
+ end
64
+
65
+ def RGuiValueBox(bounds, text, value, minValue, maxValue, editMode)
66
+ value_buf = FFI::MemoryPointer.new(:int, 1)
67
+ value_buf.put(:int, 0, value)
68
+ result = GuiValueBox(bounds, text, value_buf, minValue, maxValue, editMode)
69
+ return value_buf.get(:int, 0), result
70
+ end
71
+
72
+ def RGuiSlider(bounds, textLeft, textRight, value, minValue, maxValue)
73
+ value_buf = FFI::MemoryPointer.new(:float, 1)
74
+ value_buf.put_float(0, value)
75
+ result = GuiSlider(bounds, textLeft, textRight, value_buf, minValue, maxValue)
76
+ return value_buf.read_float, result
77
+ end
78
+
79
+ def RGuiSliderBar(bounds, textLeft, textRight, value, minValue, maxValue)
80
+ value_buf = FFI::MemoryPointer.new(:float, 1)
81
+ value_buf.put_float(0, value)
82
+ result = GuiSliderBar(bounds, textLeft, textRight, value_buf, minValue, maxValue)
83
+ return value_buf.read_float, result
84
+ end
85
+
86
+ def RGuiProgressBar(bounds, textLeft, textRight, value, minValue, maxValue)
87
+ value_buf = FFI::MemoryPointer.new(:float, 1)
88
+ value_buf.put_float(0, value)
89
+ result = GuiProgressBar(bounds, textLeft, textRight, value_buf, minValue, maxValue)
90
+ return value_buf.read_float, result
91
+ end
92
+
93
+ def RGuiListView(bounds, text, scrollIndex, active)
94
+ scrollIndex_buf = FFI::MemoryPointer.new(:int, 1)
95
+ scrollIndex_buf.put(:int, 0, scrollIndex)
96
+ active_buf = FFI::MemoryPointer.new(:int, 1)
97
+ active_buf.put(:int, 0, active)
98
+ result = GuiListView(bounds, text, scrollIndex_buf, active_buf)
99
+ return scrollIndex_buf.get(:int, 0), active_buf.get(:int, 0), result
100
+ end
101
+
102
+ def RGuiListViewEx(bounds, text, count, scrollIndex, active, focus)
103
+ scrollIndex_buf = FFI::MemoryPointer.new(:int, 1)
104
+ scrollIndex_buf.put(:int, 0, scrollIndex)
105
+ active_buf = FFI::MemoryPointer.new(:int, 1)
106
+ active_buf.put(:int, 0, active)
107
+ focus_buf = FFI::MemoryPointer.new(:int, 1)
108
+ focus_buf.put(:int, 0, focus)
109
+ result = GuiListViewEx(bounds, text, count, scrollIndex_buf, active_buf, focus_buf)
110
+ return scrollIndex_buf.get(:int, 0), active_buf.get(:int, 0), focus_buf.get(:int, 0), result
111
+ end
112
+
113
+ def RGuiColorBarAlpha(bounds, text, alpha)
114
+ alpha_buf = FFI::MemoryPointer.new(:float, 1)
115
+ alpha_buf.put_float(0, alpha)
116
+ result = GuiColorBarAlpha(bounds, text, alpha_buf)
117
+ return alpha_buf.read_float, result
118
+ end
119
+
120
+ def RGuiColorBarHue(bounds, text, value)
121
+ value_buf = FFI::MemoryPointer.new(:float, 1)
122
+ value_buf.put_float(0, value)
123
+ result = GuiColorBarHue(bounds, text, value_buf)
124
+ return value_buf.read_float, result
26
125
  end
27
126
 
28
127
  end
data/lib/raygui_main.rb CHANGED
@@ -51,7 +51,7 @@ module Raylib
51
51
  LABEL = 1 # Used also for: LABELBUTTON
52
52
  BUTTON = 2
53
53
  TOGGLE = 3 # Used also for: TOGGLEGROUP
54
- SLIDER = 4 # Used also for: SLIDERBAR
54
+ SLIDER = 4 # Used also for: SLIDERBAR, TOGGLESLIDER
55
55
  PROGRESSBAR = 5
56
56
  CHECKBOX = 6
57
57
  COMBOBOX = 7
data/lib/raylib_helper.rb CHANGED
@@ -19,6 +19,14 @@ module Raylib
19
19
  self[:a] = a
20
20
  self
21
21
  end
22
+
23
+ def copy(other)
24
+ self[:r] = other.r
25
+ self[:g] = other.g
26
+ self[:b] = other.b
27
+ self[:a] = other.a
28
+ self
29
+ end
22
30
  end
23
31
 
24
32
  LIGHTGRAY = Color.from_u8(200, 200, 200, 255)
data/lib/raylib_main.rb CHANGED
@@ -407,7 +407,7 @@ module Raylib
407
407
  typedef :int, :NPatchLayout
408
408
  callback :TraceLogCallback, [:int, :pointer, :int], :void
409
409
  callback :LoadFileDataCallback, [:pointer, :pointer], :pointer
410
- callback :SaveFileDataCallback, [:pointer, :pointer, :uint], :bool
410
+ callback :SaveFileDataCallback, [:pointer, :pointer, :int], :bool
411
411
  callback :LoadFileTextCallback, [:pointer], :pointer
412
412
  callback :SaveFileTextCallback, [:pointer, :pointer], :bool
413
413
  callback :AudioCallback, [:pointer, :uint], :void
@@ -1236,6 +1236,13 @@ module Raylib
1236
1236
  # @return [void]
1237
1237
  [:SetWindowMinSize, :SetWindowMinSize, [:int, :int], :void],
1238
1238
 
1239
+ # @!method SetWindowMaxSize(width, height)
1240
+ # SetWindowMaxSize : Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)
1241
+ # @param width [int]
1242
+ # @param height [int]
1243
+ # @return [void]
1244
+ [:SetWindowMaxSize, :SetWindowMaxSize, [:int, :int], :void],
1245
+
1239
1246
  # @!method SetWindowSize(width, height)
1240
1247
  # SetWindowSize : Set window dimensions
1241
1248
  # @param width [int]
@@ -1864,7 +1871,7 @@ module Raylib
1864
1871
  [:GetWorkingDirectory, :GetWorkingDirectory, [], :pointer],
1865
1872
 
1866
1873
  # @!method GetApplicationDirectory()
1867
- # GetApplicationDirectory : Get the directory if the running application (uses static string)
1874
+ # GetApplicationDirectory : Get the directory of the running application (uses static string)
1868
1875
  # @return [const char *]
1869
1876
  [:GetApplicationDirectory, :GetApplicationDirectory, [], :pointer],
1870
1877
 
@@ -2179,9 +2186,9 @@ module Raylib
2179
2186
 
2180
2187
  # @!method IsGestureDetected(gesture)
2181
2188
  # IsGestureDetected : Check if a gesture have been detected
2182
- # @param gesture [int]
2189
+ # @param gesture [unsigned int]
2183
2190
  # @return [bool]
2184
- [:IsGestureDetected, :IsGestureDetected, [:int], :bool],
2191
+ [:IsGestureDetected, :IsGestureDetected, [:uint], :bool],
2185
2192
 
2186
2193
  # @!method GetGestureDetected()
2187
2194
  # GetGestureDetected : Get latest detected gesture
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.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaiorabbit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-09 00:00:00.000000000 Z
11
+ date: 2023-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.15'
19
+ version: '1.16'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.15'
26
+ version: '1.16'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: opengl-bindings2
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -92,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
- rubygems_version: 3.4.14
95
+ rubygems_version: 3.4.20
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Provides latest raylib API for Ruby