raylib-bindings 0.7.8-arm64-darwin → 0.7.10-arm64-darwin
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 +4 -4
- data/ChangeLog +539 -527
- data/LICENSE.txt +1 -1
- data/README.md +217 -209
- data/examples/template.rb +144 -144
- data/lib/config.rb +117 -111
- data/lib/libraylib.arm64.dylib +0 -0
- data/lib/physac.arm64.dylib +0 -0
- data/lib/physac.rb +331 -331
- data/lib/raygui.arm64.dylib +0 -0
- data/lib/raygui_helper.rb +127 -127
- data/lib/raygui_main.rb +912 -912
- data/lib/raylib.rb +62 -62
- data/lib/raylib_helper.rb +431 -415
- data/lib/raylib_main.rb +5341 -5304
- data/lib/raymath.rb +1067 -1060
- data/lib/rcamera.rb +126 -126
- data/lib/rlgl.rb +1375 -1374
- metadata +3 -6
data/lib/raylib.rb
CHANGED
@@ -1,62 +1,62 @@
|
|
1
|
-
# Yet another raylib wrapper for Ruby
|
2
|
-
#
|
3
|
-
# * https://github.com/vaiorabbit/raylib-bindings
|
4
|
-
|
5
|
-
require 'ffi'
|
6
|
-
require 'fileutils'
|
7
|
-
require_relative 'raylib_main'
|
8
|
-
require_relative 'config'
|
9
|
-
require_relative 'raymath'
|
10
|
-
require_relative 'rcamera'
|
11
|
-
require_relative 'rlgl'
|
12
|
-
require_relative 'raygui_main'
|
13
|
-
require_relative 'physac'
|
14
|
-
require_relative 'raylib_helper'
|
15
|
-
require_relative 'raygui_helper'
|
16
|
-
|
17
|
-
module Raylib
|
18
|
-
extend FFI::Library
|
19
|
-
|
20
|
-
def self.load_lib(libpath, raygui_libpath: nil, physac_libpath: nil, method_naming: :original)
|
21
|
-
lib_paths = [libpath, raygui_libpath, physac_libpath].compact
|
22
|
-
|
23
|
-
ffi_lib_flags :now, :global
|
24
|
-
ffi_lib(*lib_paths)
|
25
|
-
setup_symbols(method_naming: method_naming)
|
26
|
-
|
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
|
-
rescue LoadError => e
|
30
|
-
warn e
|
31
|
-
end
|
32
|
-
|
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
|
-
end
|
39
|
-
|
40
|
-
#
|
41
|
-
# Generate sample code
|
42
|
-
#
|
43
|
-
def self.template
|
44
|
-
# Copy template code to user's current directory
|
45
|
-
example_path = "#{Gem::Specification.find_by_name('raylib-bindings').full_gem_path}/examples"
|
46
|
-
template_code_src = "#{example_path}/template.rb"
|
47
|
-
unless File.exist? template_code_src
|
48
|
-
warn "[Error] Raylib.template : Template source #{template_code_src} not found"
|
49
|
-
return false
|
50
|
-
end
|
51
|
-
|
52
|
-
template_code_dst = "#{Dir.getwd}/template.rb"
|
53
|
-
if File.exist? template_code_dst
|
54
|
-
warn "[Error] Raylib.template : Template destination #{template_code_dst} already exists"
|
55
|
-
return false
|
56
|
-
end
|
57
|
-
|
58
|
-
warn "[Info] Raylib.template : #{template_code_src} => #{template_code_dst}"
|
59
|
-
FileUtils.copy template_code_src, template_code_dst
|
60
|
-
warn '[Info] Raylib.template : Done'
|
61
|
-
end
|
62
|
-
end
|
1
|
+
# Yet another raylib wrapper for Ruby
|
2
|
+
#
|
3
|
+
# * https://github.com/vaiorabbit/raylib-bindings
|
4
|
+
|
5
|
+
require 'ffi'
|
6
|
+
require 'fileutils'
|
7
|
+
require_relative 'raylib_main'
|
8
|
+
require_relative 'config'
|
9
|
+
require_relative 'raymath'
|
10
|
+
require_relative 'rcamera'
|
11
|
+
require_relative 'rlgl'
|
12
|
+
require_relative 'raygui_main'
|
13
|
+
require_relative 'physac'
|
14
|
+
require_relative 'raylib_helper'
|
15
|
+
require_relative 'raygui_helper'
|
16
|
+
|
17
|
+
module Raylib
|
18
|
+
extend FFI::Library
|
19
|
+
|
20
|
+
def self.load_lib(libpath, raygui_libpath: nil, physac_libpath: nil, method_naming: :original)
|
21
|
+
lib_paths = [libpath, raygui_libpath, physac_libpath].compact
|
22
|
+
|
23
|
+
ffi_lib_flags :now, :global
|
24
|
+
ffi_lib(*lib_paths)
|
25
|
+
setup_symbols(method_naming: method_naming)
|
26
|
+
|
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
|
+
rescue LoadError => e
|
30
|
+
warn e
|
31
|
+
end
|
32
|
+
|
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
|
+
end
|
39
|
+
|
40
|
+
#
|
41
|
+
# Generate sample code
|
42
|
+
#
|
43
|
+
def self.template
|
44
|
+
# Copy template code to user's current directory
|
45
|
+
example_path = "#{Gem::Specification.find_by_name('raylib-bindings').full_gem_path}/examples"
|
46
|
+
template_code_src = "#{example_path}/template.rb"
|
47
|
+
unless File.exist? template_code_src
|
48
|
+
warn "[Error] Raylib.template : Template source #{template_code_src} not found"
|
49
|
+
return false
|
50
|
+
end
|
51
|
+
|
52
|
+
template_code_dst = "#{Dir.getwd}/template.rb"
|
53
|
+
if File.exist? template_code_dst
|
54
|
+
warn "[Error] Raylib.template : Template destination #{template_code_dst} already exists"
|
55
|
+
return false
|
56
|
+
end
|
57
|
+
|
58
|
+
warn "[Info] Raylib.template : #{template_code_src} => #{template_code_dst}"
|
59
|
+
FileUtils.copy template_code_src, template_code_dst
|
60
|
+
warn '[Info] Raylib.template : Done'
|
61
|
+
end
|
62
|
+
end
|