picrate 0.7.0-java → 0.8.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.
- checksums.yaml +4 -4
- data/.gitignore +1 -1
- data/.mvn/wrapper/MavenWrapperDownloader.java +117 -0
- data/.mvn/wrapper/maven-wrapper.properties +2 -1
- data/.travis.yml +2 -5
- data/CHANGELOG.md +4 -0
- data/README.md +3 -3
- data/Rakefile +15 -27
- data/docs/_config.yml +1 -1
- data/docs/_posts/2018-05-11-arch-linux-arm.md +1 -1
- data/docs/_posts/2018-11-18-building-gem.md +1 -1
- data/lib/picrate/app.rb +1 -1
- data/lib/picrate/native_folder.rb +1 -1
- data/lib/picrate/version.rb +1 -1
- data/mvnw +127 -51
- data/mvnw.cmd +182 -0
- data/pom.rb +39 -30
- data/pom.xml +50 -37
- data/src/main/java/monkstone/ColorUtil.java +1 -1
- data/src/main/java/monkstone/core/LibraryProxy.java +0 -1
- data/src/main/java/monkstone/noise/SimplexNoise.java +1 -1
- data/src/main/java/monkstone/vecmath/GfxRender.java +87 -0
- data/src/main/java/monkstone/vecmath/ShapeRender.java +1 -1
- data/src/main/java/monkstone/vecmath/vec2/Vec2.java +1 -1
- data/src/main/java/processing/awt/PGraphicsJava2D.java +48 -50
- data/src/main/java/processing/awt/PShapeJava2D.java +10 -0
- data/src/main/java/processing/awt/PSurfaceAWT.java +315 -371
- data/src/main/java/processing/core/PApplet.java +15424 -15495
- data/src/main/java/processing/core/PConstants.java +4 -4
- data/src/main/java/processing/core/PFont.java +394 -369
- data/src/main/java/processing/core/PGraphics.java +11 -10
- data/src/main/java/processing/core/PImage.java +1389 -1435
- data/src/main/java/processing/core/PMatrix2D.java +297 -294
- data/src/main/java/processing/core/PMatrix3D.java +641 -594
- data/src/main/java/processing/core/PShape.java +1755 -1784
- data/src/main/java/processing/core/PShapeOBJ.java +145 -133
- data/src/main/java/processing/core/PShapeSVG.java +808 -801
- data/src/main/java/processing/core/PStyle.java +141 -149
- data/src/main/java/processing/core/PSurface.java +111 -117
- data/src/main/java/processing/core/PSurfaceNone.java +178 -187
- data/src/main/java/processing/javafx/PGraphicsFX2D.java +349 -346
- data/src/main/java/processing/opengl/FontTexture.java +40 -59
- data/src/main/java/processing/opengl/FrameBuffer.java +28 -18
- data/src/main/java/processing/opengl/LinePath.java +7 -7
- data/src/main/java/processing/opengl/LineStroker.java +6 -10
- data/src/main/java/processing/opengl/PGL.java +56 -44
- data/src/main/java/processing/opengl/PGraphicsOpenGL.java +909 -2338
- data/src/main/java/processing/opengl/PJOGL.java +1722 -1763
- data/src/main/java/processing/opengl/PShader.java +1308 -1192
- data/src/main/java/processing/opengl/PShapeOpenGL.java +487 -1811
- data/src/main/java/processing/opengl/PSurfaceJOGL.java +482 -497
- data/src/main/java/processing/opengl/Texture.java +99 -76
- data/src/main/java/processing/opengl/VertexBuffer.java +41 -43
- data/vendors/Rakefile +1 -1
- metadata +7 -4
@@ -24,6 +24,7 @@
|
|
24
24
|
|
25
25
|
package processing.opengl;
|
26
26
|
|
27
|
+
import java.lang.reflect.InvocationTargetException;
|
27
28
|
import processing.core.PApplet;
|
28
29
|
import processing.core.PConstants;
|
29
30
|
import processing.core.PGraphics;
|
@@ -367,7 +368,7 @@ public class Texture implements PConstants {
|
|
367
368
|
* @param height int
|
368
369
|
* @param params GLTextureParameters
|
369
370
|
*/
|
370
|
-
public void init(int width, int height, Parameters params) {
|
371
|
+
public final void init(int width, int height, Parameters params) {
|
371
372
|
setParameters(params);
|
372
373
|
setSize(width, height);
|
373
374
|
allocate();
|
@@ -798,41 +799,51 @@ public class Texture implements PConstants {
|
|
798
799
|
int glMagFilter0 = glMagFilter;
|
799
800
|
int glMinFilter0 = glMinFilter;
|
800
801
|
if (mipmaps) {
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
802
|
+
switch (sampling) {
|
803
|
+
case POINT:
|
804
|
+
glMagFilter = PGL.NEAREST;
|
805
|
+
glMinFilter = PGL.NEAREST;
|
806
|
+
usingMipmaps = false;
|
807
|
+
break;
|
808
|
+
case LINEAR:
|
809
|
+
glMagFilter = PGL.NEAREST;
|
810
|
+
glMinFilter =
|
811
|
+
PGL.MIPMAPS_ENABLED ? PGL.LINEAR_MIPMAP_NEAREST : PGL.LINEAR;
|
812
|
+
usingMipmaps = true;
|
813
|
+
break;
|
814
|
+
case BILINEAR:
|
815
|
+
glMagFilter = PGL.LINEAR;
|
816
|
+
glMinFilter =
|
817
|
+
PGL.MIPMAPS_ENABLED ? PGL.LINEAR_MIPMAP_NEAREST : PGL.LINEAR;
|
818
|
+
usingMipmaps = true;
|
819
|
+
break;
|
820
|
+
case TRILINEAR:
|
821
|
+
glMagFilter = PGL.LINEAR;
|
822
|
+
glMinFilter =
|
823
|
+
PGL.MIPMAPS_ENABLED ? PGL.LINEAR_MIPMAP_LINEAR : PGL.LINEAR;
|
824
|
+
usingMipmaps = true;
|
825
|
+
break;
|
826
|
+
default:
|
827
|
+
throw new RuntimeException("Unknown texture filtering mode");
|
822
828
|
}
|
823
829
|
} else {
|
824
830
|
usingMipmaps = false;
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
831
|
+
switch (sampling) {
|
832
|
+
case POINT:
|
833
|
+
glMagFilter = PGL.NEAREST;
|
834
|
+
glMinFilter = PGL.NEAREST;
|
835
|
+
break;
|
836
|
+
case LINEAR:
|
837
|
+
glMagFilter = PGL.NEAREST;
|
838
|
+
glMinFilter = PGL.LINEAR;
|
839
|
+
break;
|
840
|
+
case BILINEAR:
|
841
|
+
case TRILINEAR:
|
842
|
+
glMagFilter = PGL.LINEAR;
|
843
|
+
glMinFilter = PGL.LINEAR;
|
844
|
+
break;
|
845
|
+
default:
|
846
|
+
throw new RuntimeException("Unknown texture filtering mode");
|
836
847
|
}
|
837
848
|
}
|
838
849
|
|
@@ -1168,7 +1179,7 @@ public class Texture implements PConstants {
|
|
1168
1179
|
public void copyBufferFromSource(Object natRef, ByteBuffer byteBuf,
|
1169
1180
|
int w, int h) {
|
1170
1181
|
if (bufferCache == null) {
|
1171
|
-
bufferCache = new LinkedList
|
1182
|
+
bufferCache = new LinkedList<>();
|
1172
1183
|
}
|
1173
1184
|
|
1174
1185
|
if (bufferCache.size() + 1 <= MAX_BUFFER_CACHE_SIZE) {
|
@@ -1179,7 +1190,6 @@ public class Texture implements PConstants {
|
|
1179
1190
|
try {
|
1180
1191
|
usedBuffers.add(new BufferData(natRef, byteBuf.asIntBuffer(), w, h));
|
1181
1192
|
} catch (Exception e) {
|
1182
|
-
e.printStackTrace();
|
1183
1193
|
}
|
1184
1194
|
}
|
1185
1195
|
}
|
@@ -1231,7 +1241,7 @@ public class Texture implements PConstants {
|
|
1231
1241
|
// renderer draws the texture, and hence put the pixels put of sync, we
|
1232
1242
|
// simply empty the cache.
|
1233
1243
|
if (usedBuffers == null) {
|
1234
|
-
usedBuffers = new LinkedList
|
1244
|
+
usedBuffers = new LinkedList<>();
|
1235
1245
|
}
|
1236
1246
|
while (0 < bufferCache.size()) {
|
1237
1247
|
data = bufferCache.remove(0);
|
@@ -1279,7 +1289,7 @@ public class Texture implements PConstants {
|
|
1279
1289
|
// Putting the buffer in the used buffers list to dispose at the end of
|
1280
1290
|
// draw.
|
1281
1291
|
if (usedBuffers == null) {
|
1282
|
-
usedBuffers = new LinkedList
|
1292
|
+
usedBuffers = new LinkedList<>();
|
1283
1293
|
}
|
1284
1294
|
usedBuffers.add(data);
|
1285
1295
|
|
@@ -1296,7 +1306,7 @@ public class Texture implements PConstants {
|
|
1296
1306
|
try {
|
1297
1307
|
disposeBufferMethod = bufferSource.getClass().
|
1298
1308
|
getMethod("disposeBuffer", new Class[] { Object.class });
|
1299
|
-
} catch (
|
1309
|
+
} catch (NoSuchMethodException | SecurityException e) {
|
1300
1310
|
throw new RuntimeException("Provided source object doesn't have a " +
|
1301
1311
|
"disposeBuffer method.");
|
1302
1312
|
}
|
@@ -1828,7 +1838,6 @@ public class Texture implements PConstants {
|
|
1828
1838
|
/**
|
1829
1839
|
* Sets texture target and internal format according to the target and
|
1830
1840
|
* type specified.
|
1831
|
-
* @param target int
|
1832
1841
|
* @param params GLTextureParameters
|
1833
1842
|
*/
|
1834
1843
|
protected void setParameters(Parameters params) {
|
@@ -1838,14 +1847,18 @@ public class Texture implements PConstants {
|
|
1838
1847
|
throw new RuntimeException("Unknown texture target");
|
1839
1848
|
}
|
1840
1849
|
|
1841
|
-
|
1842
|
-
|
1843
|
-
|
1844
|
-
|
1845
|
-
|
1846
|
-
|
1847
|
-
|
1848
|
-
|
1850
|
+
switch (params.format) {
|
1851
|
+
case RGB:
|
1852
|
+
glFormat = PGL.RGB;
|
1853
|
+
break;
|
1854
|
+
case ARGB:
|
1855
|
+
glFormat = PGL.RGBA;
|
1856
|
+
break;
|
1857
|
+
case ALPHA:
|
1858
|
+
glFormat = PGL.ALPHA;
|
1859
|
+
break;
|
1860
|
+
default:
|
1861
|
+
throw new RuntimeException("Unknown texture format");
|
1849
1862
|
}
|
1850
1863
|
|
1851
1864
|
boolean mipmaps = params.mipmaps && PGL.MIPMAPS_ENABLED;
|
@@ -1857,36 +1870,47 @@ public class Texture implements PConstants {
|
|
1857
1870
|
mipmaps = false;
|
1858
1871
|
}
|
1859
1872
|
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1864
|
-
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1873
|
-
|
1873
|
+
switch (params.sampling) {
|
1874
|
+
case POINT:
|
1875
|
+
glMagFilter = PGL.NEAREST;
|
1876
|
+
glMinFilter = PGL.NEAREST;
|
1877
|
+
break;
|
1878
|
+
case LINEAR:
|
1879
|
+
glMagFilter = PGL.NEAREST;
|
1880
|
+
glMinFilter = mipmaps ? PGL.LINEAR_MIPMAP_NEAREST : PGL.LINEAR;
|
1881
|
+
break;
|
1882
|
+
case BILINEAR:
|
1883
|
+
glMagFilter = PGL.LINEAR;
|
1884
|
+
glMinFilter = mipmaps ? PGL.LINEAR_MIPMAP_NEAREST : PGL.LINEAR;
|
1885
|
+
break;
|
1886
|
+
case TRILINEAR:
|
1887
|
+
glMagFilter = PGL.LINEAR;
|
1888
|
+
glMinFilter = mipmaps ? PGL.LINEAR_MIPMAP_LINEAR : PGL.LINEAR;
|
1889
|
+
break;
|
1890
|
+
default:
|
1891
|
+
throw new RuntimeException("Unknown texture filtering mode");
|
1874
1892
|
}
|
1875
1893
|
|
1876
|
-
|
1877
|
-
|
1878
|
-
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
1894
|
+
switch (params.wrapU) {
|
1895
|
+
case CLAMP:
|
1896
|
+
glWrapS = PGL.CLAMP_TO_EDGE;
|
1897
|
+
break;
|
1898
|
+
case REPEAT:
|
1899
|
+
glWrapS = PGL.REPEAT;
|
1900
|
+
break;
|
1901
|
+
default:
|
1902
|
+
throw new RuntimeException("Unknown wrapping mode");
|
1882
1903
|
}
|
1883
1904
|
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1889
|
-
|
1905
|
+
switch (params.wrapV) {
|
1906
|
+
case CLAMP:
|
1907
|
+
glWrapT = PGL.CLAMP_TO_EDGE;
|
1908
|
+
break;
|
1909
|
+
case REPEAT:
|
1910
|
+
glWrapT = PGL.REPEAT;
|
1911
|
+
break;
|
1912
|
+
default:
|
1913
|
+
throw new RuntimeException("Unknown wrapping mode");
|
1890
1914
|
}
|
1891
1915
|
|
1892
1916
|
usingMipmaps = glMinFilter == PGL.LINEAR_MIPMAP_NEAREST ||
|
@@ -2103,7 +2127,7 @@ public class Texture implements PConstants {
|
|
2103
2127
|
*
|
2104
2128
|
* @param src
|
2105
2129
|
*/
|
2106
|
-
public void set(Parameters src) {
|
2130
|
+
public final void set(Parameters src) {
|
2107
2131
|
this.target = src.target;
|
2108
2132
|
this.format = src.format;
|
2109
2133
|
this.sampling = src.sampling;
|
@@ -2137,8 +2161,7 @@ public class Texture implements PConstants {
|
|
2137
2161
|
disposeBufferMethod.invoke(bufferSource, new Object[] { natBuf });
|
2138
2162
|
natBuf = null;
|
2139
2163
|
rgbBuf = null;
|
2140
|
-
} catch (
|
2141
|
-
e.printStackTrace();
|
2164
|
+
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
|
2142
2165
|
}
|
2143
2166
|
}
|
2144
2167
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
|
2
2
|
|
3
|
-
/*
|
3
|
+
/*
|
4
4
|
Part of the Processing project - http://processing.org
|
5
5
|
|
6
6
|
Copyright (c) 2012-15 The Processing Foundation
|
@@ -20,48 +20,46 @@
|
|
20
20
|
Public License along with this library; if not, write to the
|
21
21
|
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
22
22
|
Boston, MA 02111-1307 USA
|
23
|
-
*/
|
24
|
-
|
23
|
+
*/
|
25
24
|
package processing.opengl;
|
26
25
|
|
27
26
|
import processing.opengl.PGraphicsOpenGL.GLResourceVertexBuffer;
|
28
27
|
|
29
28
|
// TODO: need to combine with PGraphicsOpenGL.VertexAttribute
|
30
|
-
|
31
29
|
/**
|
32
30
|
*
|
33
31
|
* @author Martin Prout
|
34
32
|
*/
|
35
33
|
public class VertexBuffer {
|
36
34
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
35
|
+
/**
|
36
|
+
*
|
37
|
+
*/
|
38
|
+
static protected final int INIT_VERTEX_BUFFER_SIZE = 256;
|
41
39
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
40
|
+
/**
|
41
|
+
*
|
42
|
+
*/
|
43
|
+
static protected final int INIT_INDEX_BUFFER_SIZE = 512;
|
46
44
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
45
|
+
/**
|
46
|
+
*
|
47
|
+
*/
|
48
|
+
public int glId;
|
51
49
|
int target;
|
52
50
|
int elementSize;
|
53
51
|
int ncoords;
|
54
52
|
boolean index;
|
55
53
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
54
|
+
/**
|
55
|
+
*
|
56
|
+
*/
|
57
|
+
protected PGL pgl; // The interface between Processing and OpenGL.
|
60
58
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
59
|
+
/**
|
60
|
+
*
|
61
|
+
*/
|
62
|
+
protected int context; // The context that created this texture.
|
65
63
|
private GLResourceVertexBuffer glres;
|
66
64
|
|
67
65
|
VertexBuffer(PGraphicsOpenGL pg, int target, int ncoords, int esize) {
|
@@ -80,28 +78,28 @@ public class VertexBuffer {
|
|
80
78
|
init();
|
81
79
|
}
|
82
80
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
81
|
+
/**
|
82
|
+
*
|
83
|
+
*/
|
84
|
+
protected final void create() {
|
87
85
|
context = pgl.getCurrentContext();
|
88
86
|
glres = new GLResourceVertexBuffer(this);
|
89
87
|
}
|
90
88
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
int size = index ? ncoords * INIT_INDEX_BUFFER_SIZE * elementSize
|
96
|
-
|
89
|
+
/**
|
90
|
+
*
|
91
|
+
*/
|
92
|
+
protected final void init() {
|
93
|
+
int size = index ? ncoords * INIT_INDEX_BUFFER_SIZE * elementSize
|
94
|
+
: ncoords * INIT_VERTEX_BUFFER_SIZE * elementSize;
|
97
95
|
pgl.bindBuffer(target, glId);
|
98
96
|
pgl.bufferData(target, size, null, PGL.STATIC_DRAW);
|
99
97
|
}
|
100
98
|
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
99
|
+
/**
|
100
|
+
*
|
101
|
+
*/
|
102
|
+
protected void dispose() {
|
105
103
|
if (glres != null) {
|
106
104
|
glres.dispose();
|
107
105
|
glId = 0;
|
@@ -109,11 +107,11 @@ public class VertexBuffer {
|
|
109
107
|
}
|
110
108
|
}
|
111
109
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
110
|
+
/**
|
111
|
+
*
|
112
|
+
* @return
|
113
|
+
*/
|
114
|
+
protected boolean contextIsOutdated() {
|
117
115
|
boolean outdated = !pgl.contextIsCurrent(context);
|
118
116
|
if (outdated) {
|
119
117
|
dispose();
|
data/vendors/Rakefile
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: picrate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- monkstone
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -70,6 +70,7 @@ extra_rdoc_files: []
|
|
70
70
|
files:
|
71
71
|
- ".gitignore"
|
72
72
|
- ".mvn/extensions.xml"
|
73
|
+
- ".mvn/wrapper/MavenWrapperDownloader.java"
|
73
74
|
- ".mvn/wrapper/maven-wrapper.properties"
|
74
75
|
- ".travis.yml"
|
75
76
|
- CHANGELOG.md
|
@@ -179,7 +180,7 @@ files:
|
|
179
180
|
- lib/jogl-all-natives-linux-amd64.jar
|
180
181
|
- lib/jogl-all-natives-linux-armv6hf.jar
|
181
182
|
- lib/jogl-all.jar
|
182
|
-
- lib/picrate-0.
|
183
|
+
- lib/picrate-0.8.0.jar
|
183
184
|
- lib/picrate.rb
|
184
185
|
- lib/picrate/app.rb
|
185
186
|
- lib/picrate/creators/parameters.rb
|
@@ -204,6 +205,7 @@ files:
|
|
204
205
|
- library/video_event/video_event.rb
|
205
206
|
- license.txt
|
206
207
|
- mvnw
|
208
|
+
- mvnw.cmd
|
207
209
|
- picrate.gemspec
|
208
210
|
- pom.rb
|
209
211
|
- pom.xml
|
@@ -227,6 +229,7 @@ files:
|
|
227
229
|
- src/main/java/monkstone/slider/SliderGroup.java
|
228
230
|
- src/main/java/monkstone/slider/WheelHandler.java
|
229
231
|
- src/main/java/monkstone/vecmath/AppRender.java
|
232
|
+
- src/main/java/monkstone/vecmath/GfxRender.java
|
230
233
|
- src/main/java/monkstone/vecmath/JRender.java
|
231
234
|
- src/main/java/monkstone/vecmath/ShapeRender.java
|
232
235
|
- src/main/java/monkstone/vecmath/package-info.java
|
@@ -352,7 +355,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
352
355
|
version: '0'
|
353
356
|
requirements:
|
354
357
|
- java runtime >= 1.8.0_161+
|
355
|
-
rubygems_version: 3.0.
|
358
|
+
rubygems_version: 3.0.3
|
356
359
|
signing_key:
|
357
360
|
specification_version: 4
|
358
361
|
summary: ruby wrapper for processing-3.5.3 on raspberrypi and linux64
|