propane 3.7.1-java → 3.11.0-java

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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/.mvn/extensions.xml +1 -1
  3. data/.mvn/wrapper/maven-wrapper.properties +1 -1
  4. data/.travis.yml +1 -1
  5. data/CHANGELOG.md +7 -1
  6. data/README.md +8 -15
  7. data/Rakefile +6 -5
  8. data/lib/propane/app.rb +11 -15
  9. data/lib/propane/helper_methods.rb +6 -6
  10. data/lib/propane/version.rb +1 -1
  11. data/lib/{propane-3.7.1.jar → propane-3.11.0.jar} +0 -0
  12. data/library/pdf/itextpdf-5.5.13.2.jar +0 -0
  13. data/library/pdf/pdf.rb +7 -0
  14. data/library/svg/batik-all-1.14.jar +0 -0
  15. data/library/svg/svg.rb +7 -0
  16. data/mvnw +3 -3
  17. data/mvnw.cmd +2 -2
  18. data/pom.rb +32 -5
  19. data/pom.xml +58 -7
  20. data/propane.gemspec +9 -5
  21. data/src/main/java/monkstone/FastNoiseModuleJava.java +127 -0
  22. data/src/main/java/monkstone/MathToolModule.java +30 -30
  23. data/src/main/java/monkstone/PropaneLibrary.java +2 -0
  24. data/src/main/java/monkstone/SmoothNoiseModuleJava.java +127 -0
  25. data/src/main/java/monkstone/fastmath/DegLutTables.java +111 -0
  26. data/src/main/java/monkstone/fastmath/Deglut.java +6 -56
  27. data/src/main/java/monkstone/filechooser/Chooser.java +1 -1
  28. data/src/main/java/monkstone/noise/OpenSimplex2F.java +914 -0
  29. data/src/main/java/monkstone/noise/OpenSimplex2S.java +1138 -0
  30. data/src/main/java/monkstone/slider/WheelHandler.java +1 -1
  31. data/src/main/java/monkstone/vecmath/JRender.java +6 -6
  32. data/src/main/java/monkstone/vecmath/vec2/Vec2.java +27 -31
  33. data/src/main/java/monkstone/vecmath/vec3/Vec3.java +26 -40
  34. data/src/main/java/processing/awt/PGraphicsJava2D.java +11 -3
  35. data/src/main/java/processing/awt/PImageAWT.java +6 -4
  36. data/src/main/java/processing/core/PApplet.java +13259 -13379
  37. data/src/main/java/processing/core/PConstants.java +155 -163
  38. data/src/main/java/processing/core/PGraphics.java +118 -111
  39. data/src/main/java/processing/core/PImage.java +14 -14
  40. data/src/main/java/processing/opengl/PGraphicsOpenGL.java +13 -13
  41. data/src/main/java/processing/opengl/PJOGL.java +6 -5
  42. data/src/main/java/processing/opengl/PShader.java +1 -6
  43. data/src/main/java/processing/opengl/PSurfaceJOGL.java +6 -6
  44. data/src/main/java/processing/pdf/PGraphicsPDF.java +581 -0
  45. data/src/main/java/processing/svg/PGraphicsSVG.java +378 -0
  46. data/src/main/{java/processing/opengl → resources}/cursors/arrow.png +0 -0
  47. data/src/main/{java/processing/opengl → resources}/cursors/cross.png +0 -0
  48. data/src/main/{java/processing/opengl → resources}/cursors/hand.png +0 -0
  49. data/src/main/{java/processing/opengl → resources}/cursors/license.txt +0 -0
  50. data/src/main/{java/processing/opengl → resources}/cursors/move.png +0 -0
  51. data/src/main/{java/processing/opengl → resources}/cursors/text.png +0 -0
  52. data/src/main/{java/processing/opengl → resources}/cursors/wait.png +0 -0
  53. data/src/main/{java/processing/opengl → resources}/shaders/ColorFrag.glsl +0 -0
  54. data/src/main/{java/processing/opengl → resources}/shaders/ColorVert.glsl +0 -0
  55. data/src/main/{java/processing/opengl → resources}/shaders/LightFrag.glsl +0 -0
  56. data/src/main/{java/processing/opengl → resources}/shaders/LightVert.glsl +0 -0
  57. data/src/main/{java/processing/opengl → resources}/shaders/LineFrag.glsl +0 -0
  58. data/src/main/{java/processing/opengl → resources}/shaders/LineVert.glsl +0 -0
  59. data/src/main/{java/processing/opengl → resources}/shaders/MaskFrag.glsl +0 -0
  60. data/src/main/{java/processing/opengl → resources}/shaders/PointFrag.glsl +0 -0
  61. data/src/main/{java/processing/opengl → resources}/shaders/PointVert.glsl +0 -0
  62. data/src/main/{java/processing/opengl → resources}/shaders/TexFrag.glsl +0 -0
  63. data/src/main/{java/processing/opengl → resources}/shaders/TexLightFrag.glsl +0 -0
  64. data/src/main/{java/processing/opengl → resources}/shaders/TexLightVert.glsl +0 -0
  65. data/src/main/{java/processing/opengl → resources}/shaders/TexVert.glsl +0 -0
  66. data/test/deglut_spec_test.rb +2 -2
  67. data/test/test_helper.rb +1 -0
  68. data/vendors/Rakefile +1 -1
  69. metadata +49 -46
  70. data/library/simplex_noise/simplex_noise.rb +0 -5
  71. data/src/main/java/monkstone/noise/SimplexNoise.java +0 -436
@@ -30,9 +30,11 @@ import java.awt.Color;
30
30
 
31
31
  // Used for the 'image' object that's been here forever
32
32
  import java.awt.Font;
33
+ import java.awt.FontFormatException;
33
34
  import java.awt.Image;
34
35
 
35
36
  import java.io.File;
37
+ import java.io.IOException;
36
38
  import java.io.InputStream;
37
39
  import java.util.Map;
38
40
  import java.util.HashMap;
@@ -626,8 +628,8 @@ public class PGraphics extends PImage implements PConstants {
626
628
  sinLUT = new float[SINCOS_LENGTH];
627
629
  cosLUT = new float[SINCOS_LENGTH];
628
630
  for (int i = 0; i < SINCOS_LENGTH; i++) {
629
- sinLUT[i] = (float) Math.sin(i * DEG_TO_RAD * SINCOS_PRECISION);
630
- cosLUT[i] = (float) Math.cos(i * DEG_TO_RAD * SINCOS_PRECISION);
631
+ sinLUT[i] = (float) Math.sin(Math.toRadians(i * SINCOS_PRECISION));
632
+ cosLUT[i] = (float) Math.cos(Math.toRadians(i * SINCOS_PRECISION));
631
633
  }
632
634
  }
633
635
 
@@ -1984,35 +1986,32 @@ public class PGraphics extends PImage implements PConstants {
1984
1986
  * @param d height of the rectangle, by default
1985
1987
  */
1986
1988
  public void clip(float a, float b, float c, float d) {
1987
- if (imageMode == CORNER) {
1988
- if (c < 0) { // reset a negative width
1989
- a += c; c = -c;
1989
+ switch (imageMode) {
1990
+ case CORNER:
1991
+ if (c < 0) { // reset a negative width
1992
+ a += c; c = -c;
1993
+ } if (d < 0) { // reset a negative height
1994
+ b += d; d = -d;
1995
+ } clipImpl(a, b, a + c, b + d);
1996
+ break;
1997
+ case CORNERS:
1998
+ if (c < a) { // reverse because x2 < x1
1999
+ float temp = a; a = c; c = temp;
2000
+ } if (d < b) { // reverse because y2 < y1
2001
+ float temp = b; b = d; d = temp;
2002
+ } clipImpl(a, b, c, d);
2003
+ break;
2004
+ case CENTER:
2005
+ // c and d are width/height
2006
+ if (c < 0) c = -c;
2007
+ if (d < 0) d = -d;
2008
+ float x1 = a - c/2;
2009
+ float y1 = b - d/2;
2010
+ clipImpl(x1, y1, x1 + c, y1 + d);
2011
+ break;
2012
+ default:
2013
+ break;
1990
2014
  }
1991
- if (d < 0) { // reset a negative height
1992
- b += d; d = -d;
1993
- }
1994
-
1995
- clipImpl(a, b, a + c, b + d);
1996
-
1997
- } else if (imageMode == CORNERS) {
1998
- if (c < a) { // reverse because x2 < x1
1999
- float temp = a; a = c; c = temp;
2000
- }
2001
- if (d < b) { // reverse because y2 < y1
2002
- float temp = b; b = d; d = temp;
2003
- }
2004
-
2005
- clipImpl(a, b, c, d);
2006
-
2007
- } else if (imageMode == CENTER) {
2008
- // c and d are width/height
2009
- if (c < 0) c = -c;
2010
- if (d < 0) d = -d;
2011
- float x1 = a - c/2;
2012
- float y1 = b - d/2;
2013
-
2014
- clipImpl(x1, y1, x1 + c, y1 + d);
2015
- }
2016
2015
  }
2017
2016
 
2018
2017
 
@@ -2811,20 +2810,24 @@ public class PGraphics extends PImage implements PConstants {
2811
2810
  float w = c;
2812
2811
  float h = d;
2813
2812
 
2814
- if (ellipseMode == CORNERS) {
2815
- w = c - a;
2816
- h = d - b;
2817
-
2818
- } else if (ellipseMode == RADIUS) {
2819
- x = a - c;
2820
- y = b - d;
2821
- w = c * 2;
2822
- h = d * 2;
2823
-
2824
- } else if (ellipseMode == DIAMETER) {
2825
- x = a - c/2f;
2826
- y = b - d/2f;
2827
- }
2813
+ switch (ellipseMode) {
2814
+ case CORNERS:
2815
+ w = c - a;
2816
+ h = d - b;
2817
+ break;
2818
+ case RADIUS:
2819
+ x = a - c;
2820
+ y = b - d;
2821
+ w = c * 2;
2822
+ h = d * 2;
2823
+ break;
2824
+ case DIAMETER:
2825
+ x = a - c/2f;
2826
+ y = b - d/2f;
2827
+ break;
2828
+ default:
2829
+ break;
2830
+ }
2828
2831
 
2829
2832
  if (w < 0) { // undo negative width
2830
2833
  x += w;
@@ -2881,20 +2884,24 @@ public class PGraphics extends PImage implements PConstants {
2881
2884
  float w = c;
2882
2885
  float h = d;
2883
2886
 
2884
- if (ellipseMode == CORNERS) {
2885
- w = c - a;
2886
- h = d - b;
2887
-
2888
- } else if (ellipseMode == RADIUS) {
2889
- x = a - c;
2890
- y = b - d;
2891
- w = c * 2;
2892
- h = d * 2;
2893
-
2894
- } else if (ellipseMode == CENTER) {
2895
- x = a - c/2f;
2896
- y = b - d/2f;
2897
- }
2887
+ switch (ellipseMode) {
2888
+ case CORNERS:
2889
+ w = c - a;
2890
+ h = d - b;
2891
+ break;
2892
+ case RADIUS:
2893
+ x = a - c;
2894
+ y = b - d;
2895
+ w = c * 2;
2896
+ h = d * 2;
2897
+ break;
2898
+ case CENTER:
2899
+ x = a - c/2f;
2900
+ y = b - d/2f;
2901
+ break;
2902
+ default:
2903
+ break;
2904
+ }
2898
2905
 
2899
2906
  // make sure the loop will exit before starting while
2900
2907
  if (!Float.isInfinite(start) && !Float.isInfinite(stop)) {
@@ -3854,41 +3861,38 @@ public class PGraphics extends PImage implements PConstants {
3854
3861
  // loadImageAsync() sets width and height to -1 when loading fails.
3855
3862
  if (img.width == -1 || img.height == -1) return;
3856
3863
 
3857
- if (imageMode == CORNER) {
3858
- if (c < 0) { // reset a negative width
3859
- a += c; c = -c;
3860
- }
3861
- if (d < 0) { // reset a negative height
3862
- b += d; d = -d;
3864
+ switch (imageMode) {
3865
+ case CORNER:
3866
+ if (c < 0) { // reset a negative width
3867
+ a += c; c = -c;
3868
+ } if (d < 0) { // reset a negative height
3869
+ b += d; d = -d;
3870
+ } imageImpl(img,
3871
+ a, b, a + c, b + d,
3872
+ u1, v1, u2, v2);
3873
+ break;
3874
+ case CORNERS:
3875
+ if (c < a) { // reverse because x2 < x1
3876
+ float temp = a; a = c; c = temp;
3877
+ } if (d < b) { // reverse because y2 < y1
3878
+ float temp = b; b = d; d = temp;
3879
+ } imageImpl(img,
3880
+ a, b, c, d,
3881
+ u1, v1, u2, v2);
3882
+ break;
3883
+ case CENTER:
3884
+ // c and d are width/height
3885
+ if (c < 0) c = -c;
3886
+ if (d < 0) d = -d;
3887
+ float x1 = a - c/2;
3888
+ float y1 = b - d/2;
3889
+ imageImpl(img,
3890
+ x1, y1, x1 + c, y1 + d,
3891
+ u1, v1, u2, v2);
3892
+ break;
3893
+ default:
3894
+ break;
3863
3895
  }
3864
-
3865
- imageImpl(img,
3866
- a, b, a + c, b + d,
3867
- u1, v1, u2, v2);
3868
-
3869
- } else if (imageMode == CORNERS) {
3870
- if (c < a) { // reverse because x2 < x1
3871
- float temp = a; a = c; c = temp;
3872
- }
3873
- if (d < b) { // reverse because y2 < y1
3874
- float temp = b; b = d; d = temp;
3875
- }
3876
-
3877
- imageImpl(img,
3878
- a, b, c, d,
3879
- u1, v1, u2, v2);
3880
-
3881
- } else if (imageMode == CENTER) {
3882
- // c and d are width/height
3883
- if (c < 0) c = -c;
3884
- if (d < 0) d = -d;
3885
- float x1 = a - c/2;
3886
- float y1 = b - d/2;
3887
-
3888
- imageImpl(img,
3889
- x1, y1, x1 + c, y1 + d,
3890
- u1, v1, u2, v2);
3891
- }
3892
3896
  }
3893
3897
 
3894
3898
 
@@ -4062,6 +4066,7 @@ public class PGraphics extends PImage implements PConstants {
4062
4066
 
4063
4067
 
4064
4068
  /**
4069
+ * @param shape
4065
4070
  * @param a x-coordinate of the shape
4066
4071
  * @param b y-coordinate of the shape
4067
4072
  * @param c width to display the shape
@@ -4073,23 +4078,26 @@ public class PGraphics extends PImage implements PConstants {
4073
4078
 
4074
4079
  pushMatrix();
4075
4080
 
4076
- if (shapeMode == CENTER) {
4077
- // x and y are center, c and d refer to a diameter
4078
- translate(a - c/2f, b - d/2f);
4079
- scale(c / shape.getWidth(), d / shape.getHeight());
4080
-
4081
- } else if (shapeMode == CORNER) {
4082
- translate(a, b);
4083
- scale(c / shape.getWidth(), d / shape.getHeight());
4084
-
4085
- } else if (shapeMode == CORNERS) {
4086
- // c and d are x2/y2, make them into width/height
4087
- c -= a;
4088
- d -= b;
4089
- // then same as above
4090
- translate(a, b);
4091
- scale(c / shape.getWidth(), d / shape.getHeight());
4092
- }
4081
+ switch (shapeMode) {
4082
+ case CENTER:
4083
+ // x and y are center, c and d refer to a diameter
4084
+ translate(a - c/2f, b - d/2f);
4085
+ scale(c / shape.getWidth(), d / shape.getHeight());
4086
+ break;
4087
+ case CORNER:
4088
+ translate(a, b);
4089
+ scale(c / shape.getWidth(), d / shape.getHeight());
4090
+ break;
4091
+ case CORNERS:
4092
+ // c and d are x2/y2, make them into width/height
4093
+ c -= a; d -= b;
4094
+ // then same as above
4095
+ translate(a, b);
4096
+ scale(c / shape.getWidth(), d / shape.getHeight());
4097
+ break;
4098
+ default:
4099
+ break;
4100
+ }
4093
4101
  shape.draw(this);
4094
4102
 
4095
4103
  popMatrix();
@@ -4141,9 +4149,8 @@ public class PGraphics extends PImage implements PConstants {
4141
4149
  }
4142
4150
  return createFont(baseFont, size, smooth, charset, stream != null);
4143
4151
 
4144
- } catch (Exception e) {
4152
+ } catch (FontFormatException | IOException e) {
4145
4153
  System.err.println("Problem with createFont(\"" + name + "\")");
4146
- e.printStackTrace();
4147
4154
  return null;
4148
4155
  }
4149
4156
  }
@@ -1567,24 +1567,24 @@ public class PImage implements PConstants, Cloneable {
1567
1567
  * Sometimes called "Normal" or "Copy" in other software.
1568
1568
  *
1569
1569
  * <LI>BLEND - linear interpolation of colours:
1570
- * <TT>C = A*factor + B</TT>
1570
+ * <code>C = A*factor + B</code>
1571
1571
  *
1572
1572
  * <LI>ADD - additive blending with white clip:
1573
- * <TT>C = min(A*factor + B, 255)</TT>.
1573
+ * <code>C = min(A*factor + B, 255)</code>.
1574
1574
  * Clipped to 0..255, Photoshop calls this "Linear Burn",
1575
1575
  * and Director calls it "Add Pin".
1576
1576
  *
1577
1577
  * <LI>SUBTRACT - substractive blend with black clip:
1578
- * <TT>C = max(B - A*factor, 0)</TT>.
1578
+ * <code>C = max(B - A*factor, 0)</code>.
1579
1579
  * Clipped to 0..255, Photoshop calls this "Linear Dodge",
1580
1580
  * and Director calls it "Subtract Pin".
1581
1581
  *
1582
1582
  * <LI>DARKEST - only the darkest colour succeeds:
1583
- * <TT>C = min(A*factor, B)</TT>.
1583
+ * <code>C = min(A*factor, B)</code>.
1584
1584
  * Illustrator calls this "Darken".
1585
1585
  *
1586
1586
  * <LI>LIGHTEST - only the lightest colour succeeds:
1587
- * <TT>C = max(A*factor, B)</TT>.
1587
+ * <code>C = max(A*factor, B)</code>.
1588
1588
  * Illustrator calls this "Lighten".
1589
1589
  *
1590
1590
  * <LI>DIFFERENCE - subtract colors from underlying image.
@@ -1615,12 +1615,12 @@ public class PImage implements PConstants, Cloneable {
1615
1615
  * <P>It is important to note that Processing uses "fast" code, not
1616
1616
  * necessarily "correct" code. No biggie, most software does. A nitpicker
1617
1617
  * can find numerous "off by 1 division" problems in the blend code where
1618
- * <TT>&gt;&gt;8</TT> or <TT>&gt;&gt;7</TT> is used when strictly speaking
1619
- * <TT>/255.0</TT> or <TT>/127.0</TT> should have been used.</P>
1618
+ * <code>&gt;&gt;8</code> or <code>&gt;&gt;7</code> is used when strictly speaking
1619
+ * <code>/255.0</code> or <code>/127.0</code> should have been used.</P>
1620
1620
  * <P>For instance, exclusion (not intended for real-time use) reads
1621
- * <TT>r1 + r2 - ((2 * r1 * r2) / 255)</TT> because <TT>255 == 1.0</TT>
1622
- * not <TT>256 == 1.0</TT>. In other words, <TT>(255*255)>>8</TT> is not
1623
- * the same as <TT>(255*255)/255</TT>. But for real-time use the shifts
1621
+ * <code>r1 + r2 - ((2 * r1 * r2) / 255)</code> because <code>255 == 1.0</code>
1622
+ * not <code>256 == 1.0</code>. In other words, <code>(255*255)>>8</code> is not
1623
+ * the same as <code>(255*255)/255</code>. But for real-time use the shifts
1624
1624
  * are preferrable, and the difference is insignificant for applications
1625
1625
  * built with Processing.</P>
1626
1626
  *
@@ -3130,9 +3130,9 @@ int testFunction(int dst, int src) {
3130
3130
  * </p>
3131
3131
  * Starting with revision 0092, the format setting is taken into account:
3132
3132
  * <UL>
3133
- * <LI><TT>ALPHA</TT> images written as 8bit grayscale (uses lowest byte)
3134
- * <LI><TT>RGB</TT> &rarr; 24 bits
3135
- * <LI><TT>ARGB</TT> &rarr; 32 bits
3133
+ * <LI><code>ALPHA</code> images written as 8bit grayscale (uses lowest byte)
3134
+ * <LI><code>RGB</code> &rarr; 24 bits
3135
+ * <LI><code>ARGB</code> &rarr; 32 bits
3136
3136
  * </UL>
3137
3137
  * All versions are RLE compressed.
3138
3138
  *
@@ -3307,7 +3307,7 @@ int testFunction(int dst, int src) {
3307
3307
  * and the extension used is supported (usually png, jpg, jpeg, bmp,
3308
3308
  * and tiff), then those methods will be used to write the image.
3309
3309
  * To get a list of the supported formats for writing, use: <BR>
3310
- * <TT>println(javax.imageio.ImageIO.getReaderFormatNames())</TT>
3310
+ * <code>println(javax.imageio.ImageIO.getReaderFormatNames())</code>
3311
3311
  * <p>
3312
3312
  * To use the original built-in image writers, use .tga or .tif as the
3313
3313
  * extension, or don't include an extension. When no extension is used,
@@ -181,32 +181,32 @@ public class PGraphicsOpenGL extends PGraphics {
181
181
  // Shaders
182
182
 
183
183
  static protected URL defColorShaderVertURL =
184
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/ColorVert.glsl");
184
+ PGraphicsOpenGL.class.getResource("/shaders/ColorVert.glsl");
185
185
  static protected URL defTextureShaderVertURL =
186
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/TexVert.glsl");
186
+ PGraphicsOpenGL.class.getResource("/shaders/TexVert.glsl");
187
187
  static protected URL defLightShaderVertURL =
188
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/LightVert.glsl");
188
+ PGraphicsOpenGL.class.getResource("/shaders/LightVert.glsl");
189
189
  static protected URL defTexlightShaderVertURL =
190
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/TexLightVert.glsl");
190
+ PGraphicsOpenGL.class.getResource("/shaders/TexLightVert.glsl");
191
191
  static protected URL defColorShaderFragURL =
192
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/ColorFrag.glsl");
192
+ PGraphicsOpenGL.class.getResource("/shaders/ColorFrag.glsl");
193
193
  static protected URL defTextureShaderFragURL =
194
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/TexFrag.glsl");
194
+ PGraphicsOpenGL.class.getResource("/shaders/TexFrag.glsl");
195
195
  static protected URL defLightShaderFragURL =
196
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/LightFrag.glsl");
196
+ PGraphicsOpenGL.class.getResource("/shaders/LightFrag.glsl");
197
197
  static protected URL defTexlightShaderFragURL =
198
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/TexLightFrag.glsl");
198
+ PGraphicsOpenGL.class.getResource("/shaders/TexLightFrag.glsl");
199
199
 
200
200
  static protected URL defLineShaderVertURL =
201
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/LineVert.glsl");
201
+ PGraphicsOpenGL.class.getResource("/shaders/LineVert.glsl");
202
202
  static protected URL defLineShaderFragURL =
203
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/LineFrag.glsl");
203
+ PGraphicsOpenGL.class.getResource("/shaders/LineFrag.glsl");
204
204
  static protected URL defPointShaderVertURL =
205
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/PointVert.glsl");
205
+ PGraphicsOpenGL.class.getResource("/shaders/PointVert.glsl");
206
206
  static protected URL defPointShaderFragURL =
207
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/PointFrag.glsl");
207
+ PGraphicsOpenGL.class.getResource("/shaders/PointFrag.glsl");
208
208
  static protected URL maskShaderFragURL =
209
- PGraphicsOpenGL.class.getResource("/processing/opengl/shaders/MaskFrag.glsl");
209
+ PGraphicsOpenGL.class.getResource("/shaders/MaskFrag.glsl");
210
210
 
211
211
  protected PShader defColorShader;
212
212
  protected PShader defTextureShader;
@@ -182,7 +182,7 @@ public class PJOGL extends PGL {
182
182
  @Override
183
183
  protected PImage screenshot() {
184
184
  AWTGLReadBufferUtil util = new AWTGLReadBufferUtil(capabilities.getGLProfile(), false);
185
- return new PImageAWT(util.readPixelsToBufferedImage(gl, true));
185
+ return new PImageAWT(util.readPixelsToBufferedImage(gl, true));
186
186
  }
187
187
 
188
188
 
@@ -637,6 +637,7 @@ public class PJOGL extends PGL {
637
637
  setProperty(GLU.GLU_TESS_WINDING_RULE, rule);
638
638
  }
639
639
 
640
+ @Override
640
641
  public void setProperty(int property, int value) {
641
642
  GLU.gluTessProperty(tess, property, value);
642
643
  }
@@ -1997,10 +1998,10 @@ public class PJOGL extends PGL {
1997
1998
  } else if (gl3 != null) {
1998
1999
  gl3.glDrawBuffer(buf);
1999
2000
  } else if (gl3es3 != null) {
2000
- IntBuffer intBuffer = IntBuffer.allocate(1);
2001
- intBuffer.put(buf);
2002
- intBuffer.rewind();
2003
- gl3es3.glDrawBuffers(1, intBuffer);
2001
+ IntBuffer localIntBuf = IntBuffer.allocate(1);
2002
+ localIntBuf.put(buf);
2003
+ localIntBuf.rewind();
2004
+ gl3es3.glDrawBuffers(1, localIntBuf);
2004
2005
  } else {
2005
2006
  throw new RuntimeException(String.format(MISSING_GLFUNC_ERROR, "glDrawBuffer()"));
2006
2007
  }
@@ -988,7 +988,7 @@ public class PShader implements PConstants {
988
988
 
989
989
 
990
990
  /**
991
- * @return
991
+ * @return
992
992
  */
993
993
  protected boolean compileFragmentShader() {
994
994
  pgl.shaderSource(glFragment, PApplet.join(fragmentShaderSource, "\n"));
@@ -1137,11 +1137,6 @@ public class PShader implements PConstants {
1137
1137
  specularLoc = getAttributeLoc("specular");
1138
1138
  emissiveLoc = getAttributeLoc("emissive");
1139
1139
  shininessLoc = getAttributeLoc("shininess");
1140
-
1141
- directionLoc = getAttributeLoc("direction");
1142
-
1143
- offsetLoc = getAttributeLoc("offset");
1144
-
1145
1140
  directionLoc = getAttributeLoc("direction");
1146
1141
  offsetLoc = getAttributeLoc("offset");
1147
1142
 
@@ -184,10 +184,10 @@ public class PSurfaceJOGL implements PSurface {
184
184
  boolean hide = (sketch != null) &&
185
185
  (PApplet.platform == PConstants.WINDOWS);
186
186
  if (hide) setVisible(false);
187
-
187
+
188
188
  ShimAWT.selectFolderImpl(prompt, callbackMethod, file,
189
189
  callbackObject, null);
190
-
190
+
191
191
  if (hide) setVisible(true);
192
192
  });
193
193
  }
@@ -273,7 +273,7 @@ public class PSurfaceJOGL implements PSurface {
273
273
  case 2:
274
274
  try {
275
275
  profile = GLProfile.getGL2ES2();
276
-
276
+
277
277
  // workaround for https://jogamp.org/bugzilla/show_bug.cgi?id=1347
278
278
  if (!profile.isHardwareRasterizer()) {
279
279
  GLProfile hardware = GLProfile.getMaxProgrammable(true);
@@ -281,7 +281,7 @@ public class PSurfaceJOGL implements PSurface {
281
281
  profile = hardware;
282
282
  }
283
283
  }
284
-
284
+
285
285
  } catch (GLException ex) {
286
286
  profile = GLProfile.getMaxProgrammable(true);
287
287
  } break;
@@ -657,7 +657,7 @@ public class PSurfaceJOGL implements PSurface {
657
657
  stream = new FileInputStream(filename);
658
658
  stream.close();
659
659
  return filename;
660
-
660
+
661
661
  } catch (IOException e1) { }
662
662
 
663
663
  } catch (SecurityException se) { } // online, whups
@@ -1309,7 +1309,7 @@ public class PSurfaceJOGL implements PSurface {
1309
1309
  String name = cursorNames.get(kind);
1310
1310
  if (name != null) {
1311
1311
  ImageIcon icon =
1312
- new ImageIcon(getClass().getResource("cursors/" + name + ".png"));
1312
+ new ImageIcon(getClass().getResource("/cursors/" + name + ".png"));
1313
1313
  PImage img = new PImageAWT(icon.getImage());
1314
1314
  // Most cursors just use the center as the hotspot...
1315
1315
  int x = img.width / 2;