mittsu-opengl 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build-workflow.yml +1 -1
- data/.gitignore +1 -0
- data/Gemfile +0 -4
- data/README.md +3 -3
- data/lib/mittsu/opengl/renderer.rb +10 -0
- data/lib/mittsu/opengl/version.rb +1 -1
- data/mittsu-opengl.gemspec +7 -7
- metadata +29 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9078398c4ed1757e80d98fa2e2cf1bb0302ba27608401471f226e661abfc695
|
4
|
+
data.tar.gz: 1a08c4db9c8c2c62ff89b683e3e783cf2fe4aea5b99fb521562ca5fe95ef8c07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 297c6bd5993180ab7ac144c0187274f3738630274270c9a7ef2dc282fe18bfd672b84cca1d2bc99ffbe026ebeab7b7268e6ab481bc6a6b1fb2108e2fcacec7ae
|
7
|
+
data.tar.gz: 3960e446f83820438c7b3e1dcfc2a1a924687d1237835203d7140ffdcdd0977fed55d4fb99c05c940acf077f397ec813283f25839ffae45dc2e8b1ad3a62b6cd
|
@@ -24,7 +24,7 @@ jobs:
|
|
24
24
|
ruby-version: ${{ matrix.ruby }}
|
25
25
|
bundler-cache: true
|
26
26
|
- name: Test & publish code coverage
|
27
|
-
uses: paambaati/codeclimate-action@
|
27
|
+
uses: paambaati/codeclimate-action@v9.0.0
|
28
28
|
if: github.event_name == 'push'
|
29
29
|
env:
|
30
30
|
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# Mittsu
|
1
|
+
# Mittsu OpenGL Renderer
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/mittsu-opengl.svg)](https://badge.fury.io/rb/mittsu-opengl)
|
4
|
-
[![Test Coverage](https://api.codeclimate.com/v1/badges/
|
5
|
-
[![Maintainability](https://api.codeclimate.com/v1/badges/
|
4
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/dd4137d5afd04077f4ec/test_coverage)](https://codeclimate.com/github/danini-the-panini/mittsu-opengl/test_coverage)
|
5
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/dd4137d5afd04077f4ec/maintainability)](https://codeclimate.com/github/danini-the-panini/mittsu-opengl/maintainability)
|
6
6
|
[![Build Status](https://github.com/danini-the-panini/mittsu-opengl/workflows/Build/badge.svg)](https://github.com/danini-the-panini/mittsu-opengl/actions?query=workflow%3A%22Build%22)
|
7
7
|
|
8
8
|
OpenGL renderer for Mittsu
|
@@ -318,6 +318,16 @@ module Mittsu
|
|
318
318
|
@_opengl_objects.delete(object.id)
|
319
319
|
end
|
320
320
|
|
321
|
+
def take_screenshot(filename, x: 0, y: 0, width: self.width, height: self.height)
|
322
|
+
type_nb_bytes = 1 # for GL_UNSIGNED_BYTE (0 to 255)
|
323
|
+
nb_channels = 3 # for GL_RGB
|
324
|
+
pixels = ' ' * width * height * type_nb_bytes * nb_channels
|
325
|
+
GL.ReadPixels(x, y, width, height, GL::RGB, GL::UNSIGNED_BYTE, pixels)
|
326
|
+
png = ChunkyPNG::Image.from_rgb_stream(width, height, pixels)
|
327
|
+
png.flip_horizontally!
|
328
|
+
png.save(filename)
|
329
|
+
end
|
330
|
+
|
321
331
|
private
|
322
332
|
|
323
333
|
def clear_color(r, g, b, a)
|
data/mittsu-opengl.gemspec
CHANGED
@@ -24,13 +24,13 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.requirements << 'OpenGL 3.3+ capable hardware and drivers'
|
25
25
|
|
26
26
|
spec.add_runtime_dependency 'opengl-bindings2'
|
27
|
-
spec.add_runtime_dependency 'fiddle'
|
28
|
-
spec.add_runtime_dependency 'mittsu'
|
27
|
+
spec.add_runtime_dependency 'fiddle', '~> 1.0'
|
28
|
+
spec.add_runtime_dependency 'mittsu', '~> 0.5.0'
|
29
29
|
|
30
|
-
spec.add_development_dependency
|
31
|
-
spec.add_development_dependency
|
32
|
-
spec.add_development_dependency 'minitest'
|
33
|
-
spec.add_development_dependency 'minitest-reporters'
|
34
|
-
spec.add_development_dependency 'benchmark-ips'
|
30
|
+
spec.add_development_dependency 'bundler', '~> 2.0'
|
31
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
32
|
+
spec.add_development_dependency 'minitest', '~> 5.0'
|
33
|
+
spec.add_development_dependency 'minitest-reporters', '~> 1.7'
|
34
|
+
spec.add_development_dependency 'benchmark-ips', '~> 2.14'
|
35
35
|
spec.add_development_dependency 'simplecov', '0.17.1'
|
36
36
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mittsu-opengl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Danielle Smith
|
@@ -28,100 +28,100 @@ dependencies:
|
|
28
28
|
name: fiddle
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '1.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
40
|
+
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: mittsu
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 0.5.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 0.5.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
61
|
+
version: '2.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
68
|
+
version: '2.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
75
|
+
version: '13.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
82
|
+
version: '13.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: minitest
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0'
|
89
|
+
version: '5.0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0'
|
96
|
+
version: '5.0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: minitest-reporters
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '1.7'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '1.7'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: benchmark-ips
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '2.14'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - "
|
122
|
+
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '2.14'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: simplecov
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|