metaco 0.1.0 → 0.3.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 +4 -4
- data/CHANGELOG.md +17 -1
- data/README.md +69 -12
- data/Rakefile +16 -1
- data/docs/index.html +38 -0
- data/ext/metaco/metaco.m +927 -288
- data/lib/metaco/version.rb +1 -1
- data/lib/metaco.rb +63 -4
- metadata +10 -7
- data/metaco.gemspec +0 -28
data/lib/metaco/version.rb
CHANGED
data/lib/metaco.rb
CHANGED
|
@@ -2,16 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
require_relative "metaco/version"
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
if RUBY_PLATFORM.include?("darwin")
|
|
6
6
|
require "metaco/metaco"
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
module Metaco
|
|
8
|
+
def self.texture_create(handle, width, height, bytes, filter: :linear, wrap: :clamp)
|
|
9
|
+
raise ArgumentError, "filter must be :linear" unless filter == :linear
|
|
10
|
+
raise ArgumentError, "wrap must be :clamp" unless wrap == :clamp
|
|
11
|
+
|
|
12
|
+
texture_create_native(handle, width, height, bytes)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def self.read_pixels(handle, source: :compute)
|
|
16
|
+
read_pixels_native(handle, source)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
else
|
|
9
20
|
module Metaco
|
|
10
21
|
def self.init
|
|
11
22
|
raise LoadError, "Metaco is only available on macOS"
|
|
12
23
|
end
|
|
13
24
|
|
|
14
|
-
def self.window_create(_w, _h, _t)
|
|
25
|
+
def self.window_create(_w, _h, _t, resizable: false, high_dpi: false)
|
|
15
26
|
raise LoadError, "Metaco is only available on macOS"
|
|
16
27
|
end
|
|
17
28
|
|
|
@@ -34,5 +45,53 @@ rescue LoadError
|
|
|
34
45
|
def self.should_close?(_handle)
|
|
35
46
|
raise LoadError, "Metaco is only available on macOS"
|
|
36
47
|
end
|
|
48
|
+
|
|
49
|
+
def self.metal_compute_available?(_handle)
|
|
50
|
+
false
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def self.has_compute_shader?(_handle)
|
|
54
|
+
false
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def self.compile_compute_shader(_handle, _source)
|
|
58
|
+
raise LoadError, "Metaco is only available on macOS"
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def self.dispatch_compute(_handle, _uniforms)
|
|
62
|
+
raise LoadError, "Metaco is only available on macOS"
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
def self.present_compute(_handle)
|
|
66
|
+
raise LoadError, "Metaco is only available on macOS"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def self.texture_create(_handle, _width, _height, _bytes, filter: :linear, wrap: :clamp)
|
|
70
|
+
raise LoadError, "Metaco is only available on macOS"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def self.texture_update(_texture, _bytes)
|
|
74
|
+
raise LoadError, "Metaco is only available on macOS"
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def self.texture_destroy(_texture)
|
|
78
|
+
raise LoadError, "Metaco is only available on macOS"
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def self.bind_compute_texture(_handle, _index, _texture)
|
|
82
|
+
raise LoadError, "Metaco is only available on macOS"
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def self.read_pixels(_handle, source: :compute)
|
|
86
|
+
raise LoadError, "Metaco is only available on macOS"
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def self.window_size(_handle)
|
|
90
|
+
raise LoadError, "Metaco is only available on macOS"
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def self.framebuffer_size(_handle)
|
|
94
|
+
raise LoadError, "Metaco is only available on macOS"
|
|
95
|
+
end
|
|
37
96
|
end
|
|
38
97
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metaco
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yudai Takada
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: bin
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-09-25 00:00:00.000000000 Z
|
|
11
12
|
dependencies: []
|
|
12
13
|
description: A Ruby C extension providing native macOS window management and Metal
|
|
13
14
|
GPU acceleration for graphics applications.
|
|
@@ -22,17 +23,18 @@ files:
|
|
|
22
23
|
- LICENSE
|
|
23
24
|
- README.md
|
|
24
25
|
- Rakefile
|
|
26
|
+
- docs/index.html
|
|
25
27
|
- ext/metaco/extconf.rb
|
|
26
28
|
- ext/metaco/metaco.m
|
|
27
29
|
- lib/metaco.rb
|
|
28
30
|
- lib/metaco/version.rb
|
|
29
|
-
|
|
30
|
-
homepage: https://github.com/ydah/metaco
|
|
31
|
+
homepage: https://github.com/rbgfx/metaco
|
|
31
32
|
licenses:
|
|
32
33
|
- MIT
|
|
33
34
|
metadata:
|
|
34
|
-
source_code_uri: https://github.com/
|
|
35
|
-
changelog_uri: https://github.com/
|
|
35
|
+
source_code_uri: https://github.com/rbgfx/metaco
|
|
36
|
+
changelog_uri: https://github.com/rbgfx/metaco/blob/main/CHANGELOG.md
|
|
37
|
+
post_install_message:
|
|
36
38
|
rdoc_options: []
|
|
37
39
|
require_paths:
|
|
38
40
|
- lib
|
|
@@ -47,7 +49,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
47
49
|
- !ruby/object:Gem::Version
|
|
48
50
|
version: '0'
|
|
49
51
|
requirements: []
|
|
50
|
-
rubygems_version: 4.
|
|
52
|
+
rubygems_version: 3.4.19
|
|
53
|
+
signing_key:
|
|
51
54
|
specification_version: 4
|
|
52
55
|
summary: Native macOS Cocoa/Metal bridge for Ruby graphics applications
|
|
53
56
|
test_files: []
|
data/metaco.gemspec
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "lib/metaco/version"
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |spec|
|
|
6
|
-
spec.name = "metaco"
|
|
7
|
-
spec.version = Metaco::VERSION
|
|
8
|
-
spec.authors = ["Yudai Takada"]
|
|
9
|
-
spec.email = ["t.yudai92@gmail.com"]
|
|
10
|
-
|
|
11
|
-
spec.summary = "Native macOS Cocoa/Metal bridge for Ruby graphics applications"
|
|
12
|
-
spec.description = "A Ruby C extension providing native macOS window management and Metal GPU acceleration for graphics applications."
|
|
13
|
-
spec.homepage = "https://github.com/ydah/metaco"
|
|
14
|
-
spec.license = "MIT"
|
|
15
|
-
spec.required_ruby_version = ">= 3.0.0"
|
|
16
|
-
|
|
17
|
-
spec.metadata["source_code_uri"] = spec.homepage
|
|
18
|
-
spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
|
|
19
|
-
|
|
20
|
-
spec.files = Dir.chdir(__dir__) do
|
|
21
|
-
`git ls-files -z`.split("\x0").reject do |f|
|
|
22
|
-
(File.expand_path(f) == __FILE__) ||
|
|
23
|
-
f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
spec.require_paths = ["lib"]
|
|
27
|
-
spec.extensions = ["ext/metaco/extconf.rb"]
|
|
28
|
-
end
|