raylib-spinel 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.md +16 -0
- data/README.md +135 -0
- data/lib/physac.h +1987 -0
- data/lib/physac_compat.rb +43 -0
- data/lib/physac_ffi.rb +128 -0
- data/lib/raygui.h +6479 -0
- data/lib/raygui_compat.rb +116 -0
- data/lib/raygui_ffi.rb +714 -0
- data/lib/raylib_audio_fields.rb +115 -0
- data/lib/raylib_camera_fields.rb +16 -0
- data/lib/raylib_compat.rb +72 -0
- data/lib/raylib_ffi.rb +4093 -0
- data/lib/raylib_field_index.rb +593 -0
- data/lib/raylib_handles.rb +427 -0
- data/lib/raylib_handles_ffi.rb +255 -0
- data/lib/raylib_include.rb +2414 -0
- data/lib/raylib_model_ref.rb +99 -0
- data/lib/raylib_pointer_fields.rb +153 -0
- data/lib/raylib_ruby.rb +614 -0
- data/lib/raylib_sizes.rb +128 -0
- data/lib/raylib_struct_fields.rb +102 -0
- data/lib/raylib_structs.rb +174 -0
- data/lib/raymath_ffi.rb +1014 -0
- data/lib/rcamera_ffi.rb +113 -0
- data/lib/rl_handle_views.h +83 -0
- data/lib/rlgl_constants.rb +382 -0
- data/lib/rlgl_ffi.rb +1016 -0
- data/raylib-spinel/physac.rb +13 -0
- data/raylib-spinel/raygui.rb +14 -0
- data/raylib-spinel/raymath.rb +15 -0
- data/raylib-spinel/rcamera.rb +15 -0
- data/raylib-spinel/rlgl.rb +13 -0
- data/raylib-spinel.rb +56 -0
- data/raylib.rb +37 -0
- data/spin.toml +21 -0
- metadata +97 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# raygui_compat.rb — the gem's RGui* helper layer for the Spinel path.
|
|
4
|
+
#
|
|
5
|
+
# raygui_helper.rb defines RGui* wrappers that take a Rectangle and return the
|
|
6
|
+
# updated value(s) plus the control result (the C API's out-params become
|
|
7
|
+
# return values). raygui_ffi.rb ships flat-coordinate RGui* forms for the
|
|
8
|
+
# hello_raylib scenes; this file defines the gem-shaped ones, and because it is
|
|
9
|
+
# loaded after raygui_ffi.rb it wins on the gem-compat path. The value shims
|
|
10
|
+
# (rl_Gui*Value + rl_Gui_Get*) carry the out-params out of C.
|
|
11
|
+
module Raylib
|
|
12
|
+
def self.RGuiTabBar(bounds, text, count, active)
|
|
13
|
+
res = Raylib.rl_GuiTabBarValue(bounds.x, bounds.y, bounds.width, bounds.height,
|
|
14
|
+
text, (count || 0).to_i, (active || 0).to_i)
|
|
15
|
+
[Raylib.rl_Gui_GetInt, res]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def self.RGuiToggle(bounds, text, active)
|
|
19
|
+
res = Raylib.rl_GuiToggleValue(bounds.x, bounds.y, bounds.width, bounds.height,
|
|
20
|
+
text, Raylib.int_flag(active))
|
|
21
|
+
[Raylib.rl_Gui_GetInt, res]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def self.RGuiToggleGroup(bounds, text, active)
|
|
25
|
+
res = Raylib.rl_GuiToggleGroupValue(bounds.x, bounds.y, bounds.width,
|
|
26
|
+
bounds.height, text, (active || 0).to_i)
|
|
27
|
+
[Raylib.rl_Gui_GetInt, res]
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def self.RGuiToggleSlider(bounds, text, active)
|
|
31
|
+
res = Raylib.rl_GuiToggleSliderValue(bounds.x, bounds.y, bounds.width,
|
|
32
|
+
bounds.height, text, (active || 0).to_i)
|
|
33
|
+
[Raylib.rl_Gui_GetInt, res]
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def self.RGuiCheckBox(bounds, text, checked)
|
|
37
|
+
res = Raylib.rl_GuiCheckBoxValue(bounds.x, bounds.y, bounds.width,
|
|
38
|
+
bounds.height, text, Raylib.int_flag(checked))
|
|
39
|
+
[Raylib.rl_Gui_GetInt != 0, res]
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def self.RGuiComboBox(bounds, text, active)
|
|
43
|
+
res = Raylib.rl_GuiComboBoxValue(bounds.x, bounds.y, bounds.width,
|
|
44
|
+
bounds.height, text, (active || 0).to_i)
|
|
45
|
+
[Raylib.rl_Gui_GetInt, res]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def self.RGuiDropdownBox(bounds, text, active, edit_mode)
|
|
49
|
+
res = Raylib.rl_GuiDropdownBoxValue(bounds.x, bounds.y, bounds.width,
|
|
50
|
+
bounds.height, text, (active || 0).to_i,
|
|
51
|
+
Raylib.int_flag(edit_mode))
|
|
52
|
+
[Raylib.rl_Gui_GetInt, res]
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def self.RGuiSpinner(bounds, text, value, min_value, max_value, edit_mode)
|
|
56
|
+
res = Raylib.rl_GuiSpinnerValue(bounds.x, bounds.y, bounds.width,
|
|
57
|
+
bounds.height, text, (value || 0).to_i, (min_value || 0).to_i,
|
|
58
|
+
(max_value || 0).to_i, Raylib.int_flag(edit_mode))
|
|
59
|
+
[Raylib.rl_Gui_GetInt, res]
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def self.RGuiValueBox(bounds, text, value, min_value, max_value, edit_mode)
|
|
63
|
+
res = Raylib.rl_GuiValueBoxValue(bounds.x, bounds.y, bounds.width,
|
|
64
|
+
bounds.height, text, (value || 0).to_i, (min_value || 0).to_i,
|
|
65
|
+
(max_value || 0).to_i, Raylib.int_flag(edit_mode))
|
|
66
|
+
[Raylib.rl_Gui_GetInt, res]
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def self.RGuiSlider(bounds, text_left, text_right, value, min_value, max_value)
|
|
70
|
+
res = Raylib.rl_GuiSliderValue(bounds.x, bounds.y, bounds.width,
|
|
71
|
+
bounds.height, text_left, text_right, (value || 0).to_f,
|
|
72
|
+
(min_value || 0).to_f, (max_value || 0).to_f)
|
|
73
|
+
[Raylib.rl_Gui_GetFloat, res]
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def self.RGuiSliderBar(bounds, text_left, text_right, value, min_value,
|
|
77
|
+
max_value)
|
|
78
|
+
res = Raylib.rl_GuiSliderBarValue(bounds.x, bounds.y, bounds.width,
|
|
79
|
+
bounds.height, text_left, text_right,
|
|
80
|
+
(value || 0).to_f, (min_value || 0).to_f, (max_value || 0).to_f)
|
|
81
|
+
[Raylib.rl_Gui_GetFloat, res]
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
def self.RGuiProgressBar(bounds, text_left, text_right, value, min_value,
|
|
85
|
+
max_value)
|
|
86
|
+
res = Raylib.rl_GuiProgressBarValue(bounds.x, bounds.y, bounds.width,
|
|
87
|
+
bounds.height, text_left, text_right,
|
|
88
|
+
(value || 0).to_f, (min_value || 0).to_f, (max_value || 0).to_f)
|
|
89
|
+
[Raylib.rl_Gui_GetFloat, res]
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def self.RGuiListView(bounds, text, scroll_index, active)
|
|
93
|
+
res = Raylib.rl_GuiListViewValue(bounds.x, bounds.y, bounds.width,
|
|
94
|
+
bounds.height, text, (scroll_index || 0).to_i, (active || 0).to_i)
|
|
95
|
+
[Raylib.rl_Gui_GetInt2, Raylib.rl_Gui_GetInt, res]
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
def self.RGuiListViewEx(bounds, text, count, scroll_index, active, focus)
|
|
99
|
+
res = Raylib.rl_GuiListViewExValue(bounds.x, bounds.y, bounds.width,
|
|
100
|
+
bounds.height, text, (count || 0).to_i, text.bytesize, (scroll_index || 0).to_i,
|
|
101
|
+
(active || 0).to_i, (focus || 0).to_i)
|
|
102
|
+
[Raylib.rl_Gui_GetInt, Raylib.rl_Gui_GetInt2, Raylib.rl_Gui_GetInt3, res]
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def self.RGuiColorBarAlpha(bounds, text, alpha)
|
|
106
|
+
res = Raylib.rl_GuiColorBarAlphaValue(bounds.x, bounds.y, bounds.width,
|
|
107
|
+
bounds.height, text, (alpha || 0).to_f)
|
|
108
|
+
[Raylib.rl_Gui_GetFloat, res]
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
def self.RGuiColorBarHue(bounds, text, value)
|
|
112
|
+
res = Raylib.rl_GuiColorBarHueValue(bounds.x, bounds.y, bounds.width,
|
|
113
|
+
bounds.height, text, (value || 0).to_f)
|
|
114
|
+
[Raylib.rl_Gui_GetFloat, res]
|
|
115
|
+
end
|
|
116
|
+
end
|