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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4e7dcdd16e617a5dba81651c8659900a50658a4afe821fd1c1a61becc1dbd16c
4
- data.tar.gz: 76f40de34ce32ba54723c9dc01bae1c78069699e6382cd4f66201208e55df50e
3
+ metadata.gz: a9078398c4ed1757e80d98fa2e2cf1bb0302ba27608401471f226e661abfc695
4
+ data.tar.gz: 1a08c4db9c8c2c62ff89b683e3e783cf2fe4aea5b99fb521562ca5fe95ef8c07
5
5
  SHA512:
6
- metadata.gz: 066d35853b5318962f280a29cdf4b6b84799372e474ed4adbbaf3f8debaa9212e151cec32c14ad7e63d03a467a5e6674e01504b721eabe71562c46e8cf8f6745
7
- data.tar.gz: b7e4970b8cde00849fd17bfd6d35df48b3e8f60be789d631e60d05b8e85dd939e9b3973fe06b4fe326f9f3e2e261cc3e86f4e26222ac6d120df7803a64df58b1
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@v2.2.1
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
@@ -10,3 +10,4 @@
10
10
  /test/reports
11
11
  *.gem
12
12
  .tool-versions
13
+ **/*screenshot*.png
data/Gemfile CHANGED
@@ -3,7 +3,3 @@ source 'https://rubygems.org'
3
3
  gemspec
4
4
 
5
5
  gem 'mittsu', path: '../mittsu'
6
-
7
- if /darwin/ === RUBY_PLATFORM
8
- gem 'ffi', '~> 1.9', '!= 1.11.1'
9
- end
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/XXX/test_coverage)](https://codeclimate.com/github/danini-the-panini/mittsu-opengl/test_coverage)
5
- [![Maintainability](https://api.codeclimate.com/v1/badges/XXX/maintainability)](https://codeclimate.com/github/danini-the-panini/mittsu-opengl/maintainability)
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)
@@ -1,5 +1,5 @@
1
1
  module Mittsu
2
2
  module OpenGL
3
- VERSION = '0.5.0'
3
+ VERSION = '0.5.1'
4
4
  end
5
5
  end
@@ -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 "bundler"
31
- spec.add_development_dependency "rake"
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.0
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: '0'
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: '0'
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: '0'
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: '0'
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: '0'
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: '0'
124
+ version: '2.14'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: simplecov
127
127
  requirement: !ruby/object:Gem::Requirement