mittsu 0.1.4 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 904b39d95b5ddd686b51b4b34d62c47e38747eda
4
- data.tar.gz: 8d39e2085e02c706fcf05fc51d5ebf46d35135cf
3
+ metadata.gz: 14853ca4b6cc897edcdba73d196cc99ad2d80c9d
4
+ data.tar.gz: 857d141324a406aa0e420bbc0a0685348b373c5f
5
5
  SHA512:
6
- metadata.gz: 83638f36f9019a0dfd6f03516fa7dde89233553fea9a8267401e67f6bb19855382aeea27be2df6c0afe21b42a8319f0e42f48ef4b532dee12a0602b634b69d9a
7
- data.tar.gz: ab8740820fd6569365f52e4270c96a005df010f03dc64532ba08124954fce0d8aa376cb22b2b5d28b83f85ba34091204a772bdcc9058150ce5e7395779e7d599
6
+ metadata.gz: 4a85835765393ad611593a0cfb1980518edf6a1bb4e38d331fe5d6033323d6b4fada55f1daefab7f39badad07150446f51db732b4f12beff8acca56e53fbc59d
7
+ data.tar.gz: 45463c3e8276ca92a07965d117d3749a53202c16d99e8d810c13441d53e509325d08147ada69fe93904a7cde5b6d2f3b326e58be5f7d342f2766adfc40e2a4b7
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Mittsu
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/mittsu.svg)](https://badge.fury.io/rb/mittsu) [![Dependency Status](https://gemnasium.com/jellymann/mittsu.svg)](https://gemnasium.com/jellymann/mittsu) [![Circle CI](https://circleci.com/gh/jellymann/mittsu/tree/master.svg?style=shield)](https://circleci.com/gh/jellymann/mittsu/tree/master) [![Test Coverage](https://codeclimate.com/github/jellymann/mittsu/badges/coverage.svg)](https://codeclimate.com/github/jellymann/mittsu/coverage) [![Code Climate](https://codeclimate.com/github/jellymann/mittsu/badges/gpa.svg)](https://codeclimate.com/github/jellymann/mittsu)
3
+ [![Gem Version](https://badge.fury.io/rb/mittsu.svg)](https://badge.fury.io/rb/mittsu) [![Dependency Status](https://gemnasium.com/jellymann/mittsu.svg)](https://gemnasium.com/jellymann/mittsu) [![Circle CI](https://circleci.com/gh/jellymann/mittsu/tree/master.svg?style=shield)](https://circleci.com/gh/jellymann/mittsu/tree/master) [![Build status](https://ci.appveyor.com/api/projects/status/x7k8r95m5f5fg9cu/branch/master?svg=true)](https://ci.appveyor.com/project/jellymann/mittsu/branch/master) [![Test Coverage](https://codeclimate.com/github/jellymann/mittsu/badges/coverage.svg)](https://codeclimate.com/github/jellymann/mittsu/coverage) [![Code Climate](https://codeclimate.com/github/jellymann/mittsu/badges/gpa.svg)](https://codeclimate.com/github/jellymann/mittsu)
4
4
 
5
5
  3D Graphics Library for Ruby
6
6
 
@@ -16,17 +16,22 @@ Mittsu makes 3D graphics easier by providing an abstraction over OpenGL, and is
16
16
 
17
17
  Install the prerequisites:
18
18
 
19
- Mittsu depends on Ruby 2.x, OpenGL 3.3+, GLFW 3.1.x and ImageMagick 6.4.9+
19
+ Mittsu depends on Ruby 2.x, OpenGL 3.3+, and GLFW 3.1.x
20
20
 
21
21
  ```bash
22
22
  # OSX
23
- $ brew install glfw3 imagemagick
23
+ $ brew install glfw3
24
24
 
25
25
  # Ubuntu
26
- $ sudo apt-get install libglfw3-dev libmagickwand-dev
26
+ $ sudo apt-get install libglfw3-dev
27
27
  ```
28
28
 
29
- **NOTE**: On Ubuntu, you may need to install `libgl1-mesa-dev` for the OpenGL dependency.
29
+ **NOTE:** On Windows, you will have to manually specify the glfw3.dll path in an environment variable
30
+ (you can download it [here](http://www.glfw.org/download.html))
31
+ ```bash
32
+ > set MITTSU_LIBGLFW_PATH=C:\path\to\glfw3.dll
33
+ > ruby your_awesome_mittsu_app.rb
34
+ ```
30
35
 
31
36
  Add this line to your application's Gemfile:
32
37
 
data/appveyor.yml ADDED
@@ -0,0 +1,23 @@
1
+ version: '{build}'
2
+
3
+ clone_folder: c:\projects\mittsu
4
+
5
+ environment:
6
+ MITTSU_LIBGLFW_FILE: c:\projects\mittsu\glfw-3.2.1.bin.WIN32\lib-mingw\glfw3.dll
7
+
8
+ install:
9
+ - ps: c:\projects\mittsu\install_glfw.ps1
10
+ - set PATH=C:\Ruby22\bin;%PATH%
11
+ - bundle install
12
+
13
+ build: off
14
+
15
+
16
+ before_test:
17
+ - dir c:\projects\mittsu\glfw-3.2.1.bin.WIN32
18
+ - ruby -v
19
+ - gem -v
20
+ - bundle -v
21
+
22
+ test_script:
23
+ - bundle exec rake test
data/install_glfw.ps1 ADDED
@@ -0,0 +1,11 @@
1
+ Invoke-WebRequest https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.bin.WIN32.zip -OutFile "$pwd\glfw-3.2.1.bin.WIN32.zip"
2
+
3
+ Add-Type -AssemblyName System.IO.Compression.FileSystem
4
+ function Unzip
5
+ {
6
+ param([string]$zipfile, [string]$outpath)
7
+
8
+ [System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
9
+ }
10
+
11
+ Unzip "$pwd\glfw-3.2.1.bin.WIN32.zip" "$pwd"
@@ -1,4 +1,4 @@
1
- require 'rmagick'
1
+ require 'chunky_png'
2
2
  require 'mittsu/extras/image'
3
3
 
4
4
  module Mittsu
@@ -11,18 +11,15 @@ module Mittsu
11
11
 
12
12
  def load(url, flip: false, flop: false)
13
13
  chache_url = "#{url}?flip=#{flip}&flop=#{flop}"
14
- cached = Cache.get(url)
14
+ cached = Cache.get(chache_url )
15
15
  return cached unless cached.nil?
16
16
 
17
- rm_image = Magick::Image.read(url).first
18
- rm_image = rm_image.flip if flip
19
- rm_image = rm_image.flop if flop
20
- rgba_data = rm_image.to_blob { |i|
21
- i.format = "RGBA"
22
- i.depth = 8
23
- }
17
+ png_image = ChunkyPNG::Image.from_file(url)
18
+ png_image = png_image.flip_vertically if flip
19
+ png_image = png_image.flip_horizontally if flop
20
+ rgba_data = png_image.to_rgba_stream
24
21
 
25
- image = Image.new(rm_image.columns, rm_image.rows, rgba_data)
22
+ image = Image.new(png_image.width, png_image.height, rgba_data)
26
23
 
27
24
  Cache.add(url, image)
28
25
  @manager.item_start(url)
@@ -33,9 +33,10 @@ require 'mittsu/materials/material'
33
33
  # fog: <bool>
34
34
  # }
35
35
  module Mittsu
36
- attr_accessor :color, :map, :light_map, :specular_map, :alpha_map, :env_map, :combine, :reflectivity, :refraction_ratio, :shading, :wireframe, :wireframe_linewidth, :wireframe_linecap, :wireframe_linejoin, :vertex_colors, :skinning, :morph_targets, :fog
37
-
38
36
  class MeshBasicMaterial < Material
37
+
38
+ attr_accessor :color, :map, :light_map, :specular_map, :alpha_map, :env_map, :combine, :reflectivity, :refraction_ratio, :shading, :wireframe, :wireframe_linewidth, :wireframe_linecap, :wireframe_linejoin, :vertex_colors, :skinning, :morph_targets, :fog
39
+
39
40
  def initialize(parameters = {})
40
41
  super()
41
42
 
@@ -7,7 +7,7 @@ module Mittsu
7
7
 
8
8
  # wireframe
9
9
  if material.wireframe
10
- @renderer.state.set_line_width(material.wireframe_linewidth * @pixel_ratio)
10
+ @renderer.state.set_line_width(material.wireframe_linewidth * @renderer.pixel_ratio)
11
11
 
12
12
  glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, geometry_group.line_buffer) if update_buffers
13
13
  glDrawElements(GL_LINES, geometry_group.line_count, type, 0)
@@ -1,4 +1,4 @@
1
1
  module Mittsu
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  REVISION = "71"
4
4
  end
data/mittsu.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_runtime_dependency 'opengl-bindings', "~> 1.5"
28
28
  spec.add_runtime_dependency 'ffi', "~> 1.9"
29
- spec.add_runtime_dependency 'rmagick', "~> 2.15"
29
+ spec.add_runtime_dependency 'chunky_png', "~> 1.3"
30
30
 
31
31
  spec.add_development_dependency "bundler", "~> 1.9"
32
32
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mittsu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Smith
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-21 00:00:00.000000000 Z
11
+ date: 2017-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opengl-bindings
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.9'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rmagick
42
+ name: chunky_png
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '2.15'
47
+ version: '1.3'
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: '2.15'
54
+ version: '1.3'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -154,9 +154,11 @@ files:
154
154
  - LICENSE.txt
155
155
  - README.md
156
156
  - Rakefile
157
+ - appveyor.yml
157
158
  - bin/console
158
159
  - bin/setup
159
160
  - circle.yml
161
+ - install_glfw.ps1
160
162
  - lib/mittsu.rb
161
163
  - lib/mittsu/cameras.rb
162
164
  - lib/mittsu/cameras/camera.rb
@@ -381,7 +383,7 @@ requirements:
381
383
  - ImageMagick 6.4.9 or later
382
384
  - OpenGL 3.3+ capable hardware and drivers
383
385
  rubyforge_project:
384
- rubygems_version: 2.5.1
386
+ rubygems_version: 2.5.2
385
387
  signing_key:
386
388
  specification_version: 4
387
389
  summary: 3D Graphics Library for Ruby