picrate 2.4.1-java → 2.5.2-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/wrapper/maven-wrapper.properties +1 -1
  3. data/CHANGELOG.md +9 -1
  4. data/Gemfile +1 -1
  5. data/README.md +2 -2
  6. data/Rakefile +1 -1
  7. data/docs/.gitignore +1 -0
  8. data/docs/_classes/{app_render → gfx_render}/app_render.md +5 -5
  9. data/docs/_classes/vec2d/vec2d.md +2 -2
  10. data/docs/_methods/{noise_mode.md → noise_modes.md} +9 -21
  11. data/docs/_posts/2018-05-06-install_jruby.md +5 -5
  12. data/docs/_posts/2019-11-11-getting_started_buster.md +2 -2
  13. data/docs/_posts/2020-05-11-getting_started_manjaro.md +13 -4
  14. data/docs/about.md +1 -1
  15. data/lib/picrate/app.rb +2 -8
  16. data/lib/picrate/helper_methods.rb +6 -6
  17. data/lib/picrate/version.rb +1 -1
  18. data/lib/picrate-2.5.2.jar +0 -0
  19. data/picrate.gemspec +1 -1
  20. data/pom.rb +4 -4
  21. data/pom.xml +6 -9
  22. data/src/main/java/monkstone/vecmath/GfxRender.java +10 -11
  23. data/src/main/java/monkstone/vecmath/JRender.java +7 -7
  24. data/src/main/java/monkstone/vecmath/ShapeRender.java +3 -4
  25. data/src/main/java/monkstone/vecmath/vec2/Vec2.java +40 -43
  26. data/src/main/java/monkstone/vecmath/vec3/Vec3.java +30 -45
  27. data/src/main/java/processing/awt/PImageAWT.java +1 -1
  28. data/src/main/java/processing/awt/ShimAWT.java +1 -1
  29. data/src/main/java/processing/core/PApplet.java +1 -1
  30. data/src/main/java/processing/core/PImage.java +14 -14
  31. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -13
  32. data/src/main/java/processing/opengl/PShader.java +0 -6
  33. data/src/main/java/processing/opengl/PSurfaceJOGL.java +4 -4
  34. data/src/main/{java/processing/opengl → resources}/cursors/arrow.png +0 -0
  35. data/src/main/{java/processing/opengl → resources}/cursors/cross.png +0 -0
  36. data/src/main/{java/processing/opengl → resources}/cursors/hand.png +0 -0
  37. data/src/main/{java/processing/opengl → resources}/cursors/license.txt +0 -0
  38. data/src/main/{java/processing/opengl → resources}/cursors/move.png +0 -0
  39. data/src/main/{java/processing/opengl → resources}/cursors/text.png +0 -0
  40. data/src/main/{java/processing/opengl → resources}/cursors/wait.png +0 -0
  41. data/src/main/{java/processing/opengl → resources}/shaders/ColorFrag.glsl +0 -0
  42. data/src/main/{java/processing/opengl → resources}/shaders/ColorVert.glsl +0 -0
  43. data/src/main/{java/processing/opengl → resources}/shaders/LightFrag.glsl +0 -0
  44. data/src/main/{java/processing/opengl → resources}/shaders/LightVert.glsl +0 -0
  45. data/src/main/{java/processing/opengl → resources}/shaders/LineFrag.glsl +0 -0
  46. data/src/main/{java/processing/opengl → resources}/shaders/LineVert.glsl +0 -0
  47. data/src/main/{java/processing/opengl → resources}/shaders/MaskFrag.glsl +0 -0
  48. data/src/main/{java/processing/opengl → resources}/shaders/PointFrag.glsl +0 -0
  49. data/src/main/{java/processing/opengl → resources}/shaders/PointVert.glsl +0 -0
  50. data/src/main/{java/processing/opengl → resources}/shaders/TexFrag.glsl +0 -0
  51. data/src/main/{java/processing/opengl → resources}/shaders/TexLightFrag.glsl +0 -0
  52. data/src/main/{java/processing/opengl → resources}/shaders/TexLightVert.glsl +0 -0
  53. data/src/main/{java/processing/opengl → resources}/shaders/TexVert.glsl +0 -0
  54. data/test/noise_test.rb +17 -0
  55. data/test/test_helper.rb +1 -1
  56. data/test/vecmath_spec_test.rb +3 -3
  57. data/vendors/Rakefile +1 -1
  58. metadata +30 -41
  59. data/lib/picrate-2.4.1.jar +0 -0
  60. data/src/main/java/japplemenubar/JAppleMenuBar.java +0 -96
  61. data/src/main/java/japplemenubar/libjAppleMenuBar.jnilib +0 -0
  62. data/src/main/java/monkstone/complex/JComplex.java +0 -252
  63. data/src/main/java/monkstone/vecmath/AppRender.java +0 -88
  64. data/src/main/java/monkstone/vecmath/package-info.java +0 -20
  65. data/src/main/java/monkstone/vecmath/vec2/package-info.java +0 -6
  66. data/src/main/java/monkstone/vecmath/vec3/package-info.java +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cecab16a0e1abbcc010dc18037cba16121861f942a95aff9a898f9a5af4582ef
4
- data.tar.gz: 3990c04c7008c66b54cf1af01d81980b7037ede67f6579bebb1294dd503a0260
3
+ metadata.gz: b4a2f73c549d8ee796280cc60c5f304c50adc474375e56a7f1c27517f4e04f90
4
+ data.tar.gz: f326bd382abcdf8bb8b6ae76124ccddbfff932a4aac2f0c22c176928575bdbeb
5
5
  SHA512:
6
- metadata.gz: e365629d95d9077838b5a65300144fb817022dbfb21eda3754903f41aa29d39345986bc90d24021b9b1776f4f6b28206cab68ebda35f199502dcfe8a8ea1d8c0
7
- data.tar.gz: 214a0c654b63653da787cf5afbd762420e3d6ae5d2e8ac9563b3b927ead5b7f3d10d7b63061cc1dea364511d3f39527296e2653e54dcd177cb87813666332210
6
+ metadata.gz: '088cbf53dfa5f0b149d5312a7c5a2e52d81cebb54f05370feb813fb9aaa59bfc56dc6659dc0090c6b6451fb730a269e1e536e88c7cd2ce22a25c263a547ebf17'
7
+ data.tar.gz: 82ad21a6e136b0206018dc8b8906884303e1daf36995568e774a8ce5a4894733df1d5c0486b4ad4c910cb4c29df938c613cdf621d85ae4c5af87d0d0cb31e605
@@ -1,2 +1,2 @@
1
- distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
1
+ distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.3/apache-maven-3.8.3-bin.zip
2
2
  wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ v2.5.2 Update to JRuby-9.3.2.0.
2
+
3
+ v2.5.1 Update to JRuby-9.3.1.0, under the hood changes in how we access java fields, no using `field` in place of `declared_field`, possible since JRuby-9.3.0.0 required since JRuby-9.3.2.0.
4
+
5
+ v2.5.0 Update to JRuby-9.3.0.0.
6
+
7
+ v2.4.2 Update to JRuby-9.2.19, getting ready for JRuby-9.3+.
8
+
1
9
  v2.4.1 patch library loader, add PGS library examples.
2
10
 
3
11
  v2.4.0 Refactor noise to two modules, FastNoise (default) & SmoothNoise, with terrain noise `:tnoise` option.
@@ -38,7 +46,7 @@ v0.8.0 Refactor processing code to jdk8 syntax, include lambda, switch on string
38
46
 
39
47
  v0.7.1 Oops fix `GfxRender` had not been merged
40
48
 
41
- v0.7.0 Refactor sketch_writer to load params from ~/.picrate/sketch.yml. `AppRender => GfxRender` because we only need `PGraphics` in renderer.
49
+ v0.7.0 Refactor sketch_writer to load params from ~/.picrate/sketch.yml. `GfxRender => GfxRender` because we only need `PGraphics` in renderer.
42
50
 
43
51
  v0.6.0 Re-branding with new 'pick'/'eight' svg for PiCrate
44
52
 
data/Gemfile CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  source 'https://rubygems.org'
4
- ruby '2.5.7', engine: 'jruby', engine_version: '9.2.11.0'
4
+ ruby '2.6.8', engine: 'jruby', engine_version: '9.3.0.0'
5
5
  gemspec
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  __C6H3N3O7__ [![Gem Version](https://badge.fury.io/rb/picrate.svg)](https://badge.fury.io/rb/picrate)![Travis CI](https://travis-ci.org/ruby-processing/PiCrate.svg)
2
2
 
3
3
  # PiCrate
4
- New version for `Buster` on raspberryPI 3B+ works with jdk11 (reflective access warnings fixed for jdk11). Since version 2.0.1 also works on 64 bit Manjaro distro on RaspberryPI4. Create processing sketches in ruby on raspberry-pi and linux (this project is a parallel development of [propane][propane] targetting the raspberry-pi, but will initially be developed on a regular linux box). The aim is to produce a gem installable app that can be run with jruby, with minimal dependencies. Drop the `C` and you get pirate, or and an `e` and get `PiCreate`, a happy coincidence?
4
+ Version for `Raspberry Pi OS` on raspberryPI 3B+ works with jdk11 (reflective access warnings fixed for jdk11). That also works on 64 bit `ManjaroArm` distro on RaspberryPI4. Create processing sketches in ruby on raspberry-pi and linux (this project is a parallel development of [propane][propane] targetting the raspberry-pi, but will initially be developed on a regular linux box). The aim is to produce a gem installable app that can be run with jruby, with minimal dependencies. Drop the `C` and you get pirate, or and an `e` and get `PiCreate`, a happy coincidence?
5
5
 
6
6
 
7
7
  ### To install from rubygems ###
@@ -19,7 +19,7 @@ Requires java to build (and [jogl-2.4.0-rc jars][jogl_jars]), but uses a maven w
19
19
  ```bash
20
20
  cd PiCrate # or whatever you call it
21
21
  rake # assumes an installed version of vanilla processing
22
- jgem install picrate-2.4.1-java.gem
22
+ jgem install picrate-2.5.2-java.gem
23
23
 
24
24
  ```
25
25
  To create a template sketch:-
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ task default: %i[init compile install test gem]
9
9
  # Currently depends on local jogl-2.4.0 jars on path ~/jogl24
10
10
  desc 'Copy Jars'
11
11
  task :init do
12
- jogl24 = File.join(HOME_DIR, 'jogl-2.4-rc2021011')
12
+ jogl24 = File.join(HOME_DIR, 'jogl24')
13
13
  opengl = Dir.entries(jogl24).grep(/amd64|armv6hf|aarch64/).select { |jar| jar =~ /linux/ }
14
14
  opengl.concat %w[jogl-all.jar gluegen-rt.jar]
15
15
  opengl.each do |gl|
data/docs/.gitignore CHANGED
@@ -3,4 +3,5 @@
3
3
  _site
4
4
  .sass-cache
5
5
  .jekyll-metadata
6
+ .jekyll-cache
6
7
  Gemfile.lock
@@ -1,17 +1,17 @@
1
1
  ---
2
2
  layout: post
3
- title: "AppRender and ShapeRender"
4
- keywords: to_vertex, Vec3D, Vec2D, AppRender, ShapeRender
3
+ title: "GfxRender and ShapeRender"
4
+ keywords: to_vertex, Vec3D, Vec2D, GfxRender, ShapeRender
5
5
  ---
6
- Vec2D and Vec3D classes can be efficiently rendered as both PApplet vertices, and PShape vertices using AppRender and ShapeRender utility classes. To use the AppRender renderer you should create a single instance in the processing setup see below example:-
6
+ Vec2D and Vec3D classes can be efficiently rendered as both PApplet vertices, and PShape vertices using GfxRender and ShapeRender utility classes. To use the GfxRender renderer you should create a single instance in the processing setup see below example:-
7
7
 
8
- ### AppRender
8
+ ### GfxRender
9
9
 
10
10
  ```ruby
11
11
  attr_reader :renderer
12
12
  ...
13
13
  def setup
14
- @renderer = AppRender.new(self)
14
+ @renderer = GfxRender.new(self)
15
15
  end
16
16
  ...
17
17
  ```
@@ -4,7 +4,7 @@ title: "Vec2D"
4
4
  permalink: /classes/vec2d/
5
5
  ---
6
6
 
7
- The Vec2D class is a direct replacement for processings PVector class (when used for 2D work, see Vec3D for 3D version).
7
+ The Vec2D class is a direct replacement for processings PVector class (when used for 2D work, see Vec3D for 3D version). Recently cross product is deprecated in favor of the more correct wedge `^` product
8
8
 
9
9
  ### Methods:-
10
10
  ```ruby
@@ -15,7 +15,7 @@ a / b # where a is instance of Vec2D and b is a scalar
15
15
  a == b # where both a and b are both instances of Vec2D
16
16
  a.angle_between(b) # where both a and b are both instances of Vec2D
17
17
  a.copy # where a is instance of Vec2D returns a deep copy
18
- a.cross(b) # where both a and b are both instances of Vec2D
18
+ a ^ b # wedge product where both a and b are both instances of Vec2D
19
19
  a.dist(b) # where both a and b are both instances of Vec2D
20
20
  a.dot(b) # where both a and b are both instances of Vec2D
21
21
  a.heading # where a is instance of Vec2D
@@ -1,11 +1,12 @@
1
1
  ---
2
2
  layout: post
3
- title: "noise_mode"
3
+ title: "Noise Modes"
4
4
  ---
5
5
 
6
6
  ### Name ###
7
7
 
8
- `noise_mode` _NB: not currently available in vanilla processing_.
8
+ There are two noise modes available in PiCrate, both base on KdotJPG java noise.
9
+ The default noise uses the FastNoise module, the SmoothNoise module can be used using the module name as a prefix see example below.
9
10
 
10
11
  ### Examples ###
11
12
 
@@ -25,24 +26,12 @@ class TestNoise < Processing::App
25
26
  noise_scale = 0.01
26
27
  background(0)
27
28
  grid(width, height, 10, 10) do |x, y|
28
- arrow(x, y, noise(x * noise_scale, y * noise_scale, z * noise_scale) * TWO_PI * 2)
29
+ arrow(x, y, SmoothNoise.noise(x * noise_scale, y * noise_scale, z * noise_scale) * TWO_PI * 2)
30
+ # arrow(x, y, noise(x * noise_scale, y * noise_scale, z * noise_scale) * TWO_PI * 2)
29
31
  end
30
32
  @z += 1
31
33
  end
32
34
 
33
- def mouse_pressed
34
- mode = NoiseMode::OPEN_SMOOTH # Smooth classic OpenSimplex2
35
- noise_mode mode
36
- sketch_title mode.description
37
- end
38
-
39
- def mouse_released
40
- mode = NoiseMode::DEFAULT # Fast classic OpenSimplex2
41
- noise_mode(mode)
42
- sketch_title mode.description
43
- end
44
-
45
-
46
35
  def arrow(x, y, ang)
47
36
  push_matrix()
48
37
  translate(x, y)
@@ -68,15 +57,14 @@ TestNoise.new
68
57
  ### Description ###
69
58
 
70
59
  Currently supports four implementations of noise:-
71
- 1. DEFAULT # fast classic OpenSimplex2
72
- 2. OPEN_SMOOTH # smoother class OpenSimplex2F
73
- 3. FAST_TERRAIN # more suited to terrain
74
- 4. SMOOTH_TERRAIN # as above but smoother
60
+ 1. Default is classic OpenSimplex2
61
+ 2. SmoothNoise use smoother class OpenSimplex2F
62
+ 3. Use tnoise instead of noise for a noise mode more suited to terrain
75
63
 
76
64
  ### Syntax ###
77
65
 
78
66
  ```ruby
79
- noise_mode(mode) # default is NoiseMode::DEFAULT, a fast classic OpenSimplex2
67
+ SmoothNoise.noise(...) # no prefix for fast classic OpenSimplex2
80
68
  ```
81
69
 
82
70
  ### Related ###
@@ -14,7 +14,7 @@ Get the latest version from [http://jruby.org/download][download]
14
14
 
15
15
  ```bash
16
16
  cd /opt
17
- sudo tar xzvf /pathToDownload/jruby-bin-9.2.14.0.tar.gz
17
+ sudo tar xzvf /pathToDownload/jruby-bin-9.3.2.0.tar.gz
18
18
  ```
19
19
 
20
20
  Then use the excellent `update-alternatives` tool to provide symbolic links to `jruby`, `jgem`, `jirb` and `rake` especially if you haven't installed `mri` ruby.
@@ -31,16 +31,16 @@ You should prefer to install gems locally (no need for sudo). To do that it is c
31
31
  ```bash
32
32
  alias jpry="jruby -e \"require 'pry'; binding.pry\""
33
33
  # export JAVA_HOME="/opt/jdk1.8.0_151" # if using oracle java openjdk-8 is fine though
34
- export GEM_HOME="$HOME/.gem/ruby/2.5.0"
35
- export GEM_PATH="$HOME/tux/.gem/ruby/2.5.0"
34
+ export GEM_HOME="$HOME/.gem/ruby/2.6.0"
35
+ export GEM_PATH="$HOME/tux/.gem/ruby/2.6.0"
36
36
  export PATH="${PATH}:${GEM_PATH}/bin"
37
37
  ```
38
38
 
39
39
  ### Automated install using bash ###
40
40
 
41
- The [picrate2_install.sh][bash] script currently installs jruby-9.2.14.0 and picrate-2.2.0.
41
+ The [picrate2_install.sh][bash] script currently installs jruby-9.3.0.0 and picrate-2.5.0.
42
42
 
43
43
  If you know better please post on wiki
44
44
 
45
- [download]:"https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.2.14.0/jruby-dist-9.2.14.0-bin.tar.gz"
45
+ [download]:"https://repo1.maven.org/maven2/org/jruby/jruby-dist/9.3.2.0/jruby-dist-9.3.2.0-bin.tar.gz"
46
46
  [bash]:https://gist.github.com/monkstone/6ae9840d7b7008c177b4a9f589d14ec6
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  layout: post
3
- title: "Getting Started Buster"
3
+ title: "Getting Started RaspbianOS"
4
4
  date: 2019-11-11 07:34:13
5
5
  categories: PiCrate update
6
6
  permalink: /getting_buster/
7
7
  ---
8
- Raspbian Buster usually comes with a pre-installed jdk11. Before installing JRuby it is worth setting the `JAVA_HOME` environmental variable (needed to supress reflection warnings).
8
+ RaspberryPI OS usually comes with a pre-installed jdk11. Before installing JRuby it might be worth setting the `JAVA_HOME` environmental variable (_to supress reflection warnings_).
9
9
 
10
10
  __Otherwise follow these instructions in order as needed:-__
11
11
 
@@ -5,19 +5,28 @@ date: 2020-05-11 07:34:13
5
5
  categories: PiCrate update
6
6
  permalink: /getting_manjaro/
7
7
  ---
8
- If Manjaro does not come with a pre-installed java, then the first step is to install a `jdk` the distro version (jdk14) should work.
8
+ If Manjaro does not come with a pre-installed java, then the first step is to install a `jdk` the distro version (jdk16) should work.
9
9
 
10
10
  ```bash
11
- sudo pacman -S jdk-openjdk # current distro version jdk14
11
+ sudo pacman -S jre-openjdk # current distro version jdk17
12
12
  ```
13
13
  You can also use pacman to install jruby
14
14
  ```bash
15
- sudo pacman -S jruby # current version jruby-9.2.14.0
15
+ sudo pacman -S jruby # current version jruby-9.3.0.0
16
16
  ```
17
17
  It is probably a good idea to create a local gem store (rather needing to use sudo to install gems)
18
+ ```bash
19
+ sudo pacman -S vim # all you need if your happy with vim
20
+ ```
21
+ Vim is not installed by default
22
+ ```bash
23
+ sudo pacman -S geany # if you prefer a GUI
24
+ ```
25
+ Geany is not installed by default
26
+
18
27
 
19
28
  ```bash
20
- mkdir -p ~/.gem/ruby/2.5.0 # current MRI version supported by jruby
29
+ mkdir -p ~/.gem/ruby/2.6.0 # current MRI version supported by jruby
21
30
  ```
22
31
  Now set your `GEM_HOME`, `GEM_PATH` and amend your `PATH` as follows:-
23
32
 
data/docs/about.md CHANGED
@@ -4,7 +4,7 @@ title: About
4
4
  permalink: /about/
5
5
  ---
6
6
  ![picrate.png]({{ site.github.url }}/assets/android-chrome-192x192.png)
7
- PiCrate is both a `library` and an `app` that allows you to create [processing][processing] sketches in ruby on the [RaspberryPI][PI] (or 64 bit linux). PiCrate is available as a gem (from [rubygems][rubygems]), it requires [JRuby][jruby] to both install and run. It does not depend on a vanilla processing install ( _cf_ JRubyArt).Tested on raspbian Buster on RaspberryPI3B+ and RaspberryPI4, also works on Manajaro distro (64bit) on RapsberryPI4.
7
+ PiCrate is both a `library` and an `app` that allows you to create [processing][processing] sketches in ruby on the [RaspberryPI][PI] (or 64 bit linux). PiCrate is available as a gem (from [rubygems][rubygems]), it requires [JRuby][jruby] to both install and run. It does not depend on a vanilla processing install.Tested on RaspbianOS on RaspberryPI3B+ and RaspberryPI4, also works on Manajaro distro (64bit) on RaspberryPI4.
8
8
 
9
9
  #### Executable ####
10
10
 
data/lib/picrate/app.rb CHANGED
@@ -84,7 +84,7 @@ module Processing
84
84
  class << self
85
85
  # Handy getters and setters on the class go here:
86
86
  attr_accessor :sketch_class, :library_loader, :arguments, :options
87
- attr_reader :surface
87
+ attr_reader :surface, :width, :height, :mode
88
88
  def load_libraries(*args)
89
89
  library_loader ||= LibraryLoader.new
90
90
  library_loader.load_library(*args)
@@ -135,7 +135,7 @@ module Processing
135
135
  w, h, mode = *args
136
136
  @width ||= w
137
137
  @height ||= h
138
- @render_mode ||= mode
138
+ @mode ||= mode
139
139
  import_opengl if /opengl/ =~ mode
140
140
  super(*args)
141
141
  end
@@ -159,12 +159,6 @@ module Processing
159
159
  end
160
160
  end
161
161
 
162
- def proxy_java_fields
163
- fields = %w[sketchPath key frameRate mousePressed keyPressed]
164
- methods = fields.map { |field| java_class.declared_field(field) }
165
- @declared_fields = Hash[fields.zip(methods)]
166
- end
167
-
168
162
  # When certain special methods get added to the sketch, we need to let
169
163
  # Processing call them by their expected Java names.
170
164
  def method_added(method_name) #:nodoc:
@@ -117,14 +117,14 @@ module Processing
117
117
  # some methods. Add to this list as needed.
118
118
  def proxy_java_fields
119
119
  fields = %w[key frameRate mousePressed keyPressed]
120
- methods = fields.map { |field| java_class.declared_field(field) }
121
- @declared_fields = Hash[fields.zip(methods)]
120
+ methods = fields.map { |field| java_class.field(field) }
121
+ @jfields = Hash[fields.zip(methods)]
122
122
  end
123
123
 
124
124
  # Fix java conversion problems getting the last key
125
125
  # If it's ASCII, return the character, otherwise the integer
126
126
  def key
127
- int = @declared_fields['key'].value(java_self)
127
+ int = @jfields['key'].value(java_self)
128
128
  int < 256 ? int.chr : int
129
129
  end
130
130
 
@@ -161,19 +161,19 @@ module Processing
161
161
 
162
162
  # frame_rate needs to support reading and writing
163
163
  def frame_rate(fps = nil)
164
- return @declared_fields['frameRate'].value(java_self) unless fps
164
+ return @jfields['frameRate'].value(java_self) unless fps
165
165
 
166
166
  super(fps)
167
167
  end
168
168
 
169
169
  # Is the mouse pressed for this frame?
170
170
  def mouse_pressed?
171
- @declared_fields['mousePressed'].value(java_self)
171
+ @jfields['mousePressed'].value(java_self)
172
172
  end
173
173
 
174
174
  # Is a key pressed for this frame?
175
175
  def key_pressed?
176
- @declared_fields['keyPressed'].value(java_self)
176
+ @jfields['keyPressed'].value(java_self)
177
177
  end
178
178
 
179
179
  private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PiCrate
4
- VERSION = '2.4.1'
4
+ VERSION = '2.5.2'
5
5
  end
Binary file
data/picrate.gemspec CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |gem|
33
33
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
34
34
  gem.add_development_dependency 'minitest', '~> 5.14'
35
35
  gem.add_runtime_dependency 'rake', '~> 13.0'
36
- gem.add_runtime_dependency 'arcball', '~> 1.0', '>= 1.0.1'
36
+ gem.add_runtime_dependency 'arcball', '~> 1.2'
37
37
  gem.require_paths = ['lib']
38
38
  gem.platform = 'java'
39
39
  gem.requirements << 'java runtime == 11+'
data/pom.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  project 'picrate', 'http://maven.apache.org' do
4
4
  model_version '4.0.0'
5
- id 'ruby-processing:picrate:2.4.1'
5
+ id 'ruby-processing:picrate:2.5.2'
6
6
  packaging 'jar'
7
7
 
8
8
  description 'An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.'
@@ -24,6 +24,7 @@ project 'picrate', 'http://maven.apache.org' do
24
24
  issue_management 'https://github.com/ruby-processing/PiCrate/issues', 'Github'
25
25
  # Need to update to jogl 2.4.1 as soon as available, then make a dependency
26
26
  properties('jogl.version' => '2.3.2',
27
+ 'jruby.version' => '9.3.2.0',
27
28
  'batik.version' => '1.14',
28
29
  'itextpdf.version' => '5.5.13.2',
29
30
  'jruby.api' => 'http://jruby.org/apidocs/',
@@ -33,7 +34,7 @@ project 'picrate', 'http://maven.apache.org' do
33
34
  'project.build.sourceEncoding' => 'UTF-8',
34
35
  'polyglot.dump.pom' => 'pom.xml')
35
36
 
36
- pom 'org.jruby:jruby:9.2.17.0'
37
+ jar 'org.jruby:jruby-base:${jruby.version}'
37
38
  jar 'org.jogamp.jogl:jogl-all:${jogl.version}'
38
39
  jar 'org.jogamp.gluegen:gluegen-rt-main:${jogl.version}'
39
40
  jar 'org.processing:video:3.0.2'
@@ -82,11 +83,10 @@ end
82
83
  build do
83
84
  resource do
84
85
  directory '${source.directory}/main/java'
85
- includes '**/**/*.glsl', '**/*.jnilib'
86
86
  excludes '**/**/*.java'
87
87
  end
88
88
  resource do
89
89
  directory '${source.directory}/main/resources'
90
- includes '**/*.png', '*.txt'
90
+ includes '**/*.png', '**/*.txt', '**/*.glsl'
91
91
  end
92
92
  end
data/pom.xml CHANGED
@@ -11,7 +11,7 @@ DO NOT MODIFY - GENERATED CODE
11
11
  <modelVersion>4.0.0</modelVersion>
12
12
  <groupId>ruby-processing</groupId>
13
13
  <artifactId>picrate</artifactId>
14
- <version>2.4.1</version>
14
+ <version>2.5.2</version>
15
15
  <name>picrate</name>
16
16
  <description>An integrated processing-core (somewhat hacked), with additional java code for a jruby version of processing.</description>
17
17
  <url>http://maven.apache.org</url>
@@ -68,6 +68,7 @@ DO NOT MODIFY - GENERATED CODE
68
68
  <itextpdf.version>5.5.13.2</itextpdf.version>
69
69
  <jogl.version>2.3.2</jogl.version>
70
70
  <jruby.api>http://jruby.org/apidocs/</jruby.api>
71
+ <jruby.version>9.3.2.0</jruby.version>
71
72
  <picrate.basedir>${project.basedir}</picrate.basedir>
72
73
  <polyglot.dump.pom>pom.xml</polyglot.dump.pom>
73
74
  <processing.api>http://processing.github.io/processing-javadocs/core/</processing.api>
@@ -77,9 +78,8 @@ DO NOT MODIFY - GENERATED CODE
77
78
  <dependencies>
78
79
  <dependency>
79
80
  <groupId>org.jruby</groupId>
80
- <artifactId>jruby</artifactId>
81
- <version>9.2.17.0</version>
82
- <type>pom</type>
81
+ <artifactId>jruby-base</artifactId>
82
+ <version>${jruby.version}</version>
83
83
  </dependency>
84
84
  <dependency>
85
85
  <groupId>org.jogamp.jogl</groupId>
@@ -111,10 +111,6 @@ DO NOT MODIFY - GENERATED CODE
111
111
  <resources>
112
112
  <resource>
113
113
  <directory>${source.directory}/main/java</directory>
114
- <includes>
115
- <include>**/**/*.glsl</include>
116
- <include>**/*.jnilib</include>
117
- </includes>
118
114
  <excludes>
119
115
  <exclude>**/**/*.java</exclude>
120
116
  </excludes>
@@ -123,7 +119,8 @@ DO NOT MODIFY - GENERATED CODE
123
119
  <directory>${source.directory}/main/resources</directory>
124
120
  <includes>
125
121
  <include>**/*.png</include>
126
- <include>*.txt</include>
122
+ <include>**/*.txt</include>
123
+ <include>**/*.glsl</include>
127
124
  </includes>
128
125
  </resource>
129
126
  </resources>
@@ -3,20 +3,19 @@ package monkstone.vecmath;
3
3
  import processing.core.PGraphics;
4
4
 
5
5
  /**
6
- *
7
6
  *
8
7
  * @author Martin Prout
9
8
  */
10
9
  public class GfxRender implements JRender {
11
10
 
12
- final PGraphics g;
11
+ final PGraphics graphics;
13
12
 
14
13
  /**
15
14
  *
16
- * @param gfx PGraphics
15
+ * @param graphics PGraphics
17
16
  */
18
- public GfxRender(final PGraphics gfx) {
19
- this.g = gfx;
17
+ public GfxRender(final PGraphics graphics) {
18
+ this.graphics = graphics;
20
19
  }
21
20
 
22
21
  /**
@@ -26,7 +25,7 @@ public class GfxRender implements JRender {
26
25
  */
27
26
  @Override
28
27
  public void vertex(double x, double y) {
29
- g.vertex((float) x, (float) y);
28
+ graphics.vertex((float) x, (float) y);
30
29
  }
31
30
 
32
31
  /**
@@ -36,7 +35,7 @@ public class GfxRender implements JRender {
36
35
  */
37
36
  @Override
38
37
  public void curveVertex(double x, double y) {
39
- g.curveVertex((float) x, (float) y);
38
+ graphics.curveVertex((float) x, (float) y);
40
39
  }
41
40
 
42
41
  /**
@@ -47,7 +46,7 @@ public class GfxRender implements JRender {
47
46
  */
48
47
  @Override
49
48
  public void vertex(double x, double y, double z) {
50
- g.vertex((float) x, (float) y, (float) z);
49
+ graphics.vertex((float) x, (float) y, (float) z);
51
50
  }
52
51
 
53
52
  /**
@@ -58,7 +57,7 @@ public class GfxRender implements JRender {
58
57
  */
59
58
  @Override
60
59
  public void normal(double x, double y, double z) {
61
- g.normal((float) x, (float) y, (float) z);
60
+ graphics.normal((float) x, (float) y, (float) z);
62
61
  }
63
62
 
64
63
  /**
@@ -71,7 +70,7 @@ public class GfxRender implements JRender {
71
70
  */
72
71
  @Override
73
72
  public void vertex(double x, double y, double z, double u, double v) {
74
- g.vertex((float) x, (float) y, (float) z, (float) u, (float) v);
73
+ graphics.vertex((float) x, (float) y, (float) z, (float) u, (float) v);
75
74
  }
76
75
 
77
76
  /**
@@ -82,6 +81,6 @@ public class GfxRender implements JRender {
82
81
  */
83
82
  @Override
84
83
  public void curveVertex(double x, double y, double z) {
85
- g.curveVertex((float) x, (float) y, (float) z);
84
+ graphics.curveVertex((float) x, (float) y, (float) z);
86
85
  }
87
86
  }
@@ -1,7 +1,6 @@
1
1
  package monkstone.vecmath;
2
2
 
3
3
  /**
4
- *
5
4
  *
6
5
  * @author Martin Prout
7
6
  */
@@ -12,14 +11,14 @@ public interface JRender {
12
11
  * @param x double
13
12
  * @param y double
14
13
  */
15
- public void vertex(double x, double y);
14
+ void vertex(double x, double y);
16
15
 
17
16
  /**
18
17
  *
19
18
  * @param x double
20
19
  * @param y double
21
20
  */
22
- public void curveVertex(double x, double y);
21
+ void curveVertex(double x, double y);
23
22
 
24
23
  /**
25
24
  *
@@ -27,7 +26,7 @@ public interface JRender {
27
26
  * @param y double
28
27
  * @param z double
29
28
  */
30
- public void vertex(double x, double y, double z);
29
+ void vertex(double x, double y, double z);
31
30
 
32
31
  /**
33
32
  *
@@ -37,7 +36,7 @@ public interface JRender {
37
36
  * @param u double
38
37
  * @param v double
39
38
  */
40
- public void vertex(double x, double y, double z, double u, double v);
39
+ void vertex(double x, double y, double z, double u, double v);
41
40
 
42
41
  /**
43
42
  *
@@ -45,7 +44,7 @@ public interface JRender {
45
44
  * @param y double
46
45
  * @param z double
47
46
  */
48
- public void curveVertex(double x, double y, double z);
47
+ void curveVertex(double x, double y, double z);
49
48
 
50
49
  /**
51
50
  *
@@ -53,5 +52,6 @@ public interface JRender {
53
52
  * @param y double
54
53
  * @param z double
55
54
  */
56
- public void normal(double x, double y, double z);
55
+ void normal(double x, double y, double z);
57
56
  }
57
+
@@ -3,7 +3,6 @@ package monkstone.vecmath;
3
3
  import processing.core.PShape;
4
4
 
5
5
  /**
6
- *
7
6
  *
8
7
  * @author Martin Prout
9
8
  */
@@ -29,7 +28,7 @@ public class ShapeRender implements JRender {
29
28
  public void vertex(double x, double y) {
30
29
  shape.vertex((float) x, (float) y);
31
30
  }
32
-
31
+
33
32
  /**
34
33
  *
35
34
  * @param x double
@@ -37,7 +36,7 @@ public class ShapeRender implements JRender {
37
36
  */
38
37
  @Override
39
38
  public void curveVertex(double x, double y) {
40
- shape.curveVertex((float) x, (float) y);
39
+ throw new UnsupportedOperationException("Not implemented for this renderer");
41
40
  }
42
41
 
43
42
  /**
@@ -74,7 +73,7 @@ public class ShapeRender implements JRender {
74
73
  public void vertex(double x, double y, double z, double u, double v) {
75
74
  shape.vertex((float) x, (float) y, (float) z, (float) u, (float) v);
76
75
  }
77
-
76
+
78
77
  /**
79
78
  *
80
79
  * @param x double