mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Moved some more constants to PGL
This commit is contained in:
@@ -91,6 +91,16 @@ public class PGL {
|
||||
/** Maximum lights by default is 8, the minimum defined by OpenGL. */
|
||||
public static final int MAX_LIGHTS = 8;
|
||||
|
||||
/** Initial sizes for arrays of input and tessellated data. */
|
||||
public static final int DEFAULT_IN_VERTICES = 64;
|
||||
public static final int DEFAULT_IN_EDGES = 128;
|
||||
public static final int DEFAULT_IN_TEXTURES = 64;
|
||||
public static final int DEFAULT_TESS_VERTICES = 64;
|
||||
public static final int DEFAULT_TESS_INDICES = 128;
|
||||
|
||||
/** Initial sizes for vertex cache used in PShape3D. */
|
||||
public static final int DEFAULT_VERTEX_CACHE_SIZE = 128;
|
||||
|
||||
/** Maximum number of tessellated vertices. */
|
||||
public static final int MAX_TESS_VERTICES = 100000;
|
||||
|
||||
|
||||
@@ -361,15 +361,8 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
protected boolean breakShape = false;
|
||||
|
||||
public static int flushMode = FLUSH_WHEN_FULL;
|
||||
// public static int flushMode = FLUSH_AFTER_SHAPE;
|
||||
|
||||
public static final int MIN_ARRAYCOPY_SIZE = 2;
|
||||
|
||||
public static final int DEFAULT_IN_VERTICES = 64;
|
||||
public static final int DEFAULT_IN_EDGES = 128;
|
||||
public static final int DEFAULT_IN_TEXTURES = 64;
|
||||
public static final int DEFAULT_TESS_VERTICES = 64;
|
||||
public static final int DEFAULT_TESS_INDICES = 128;
|
||||
|
||||
protected Tessellator tessellator;
|
||||
|
||||
@@ -6082,9 +6075,9 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
}
|
||||
|
||||
public void allocate() {
|
||||
textures = new PImage[DEFAULT_IN_TEXTURES];
|
||||
firstIndex = new int[DEFAULT_IN_TEXTURES];
|
||||
lastIndex = new int[DEFAULT_IN_TEXTURES];
|
||||
textures = new PImage[PGL.DEFAULT_IN_TEXTURES];
|
||||
firstIndex = new int[PGL.DEFAULT_IN_TEXTURES];
|
||||
lastIndex = new int[PGL.DEFAULT_IN_TEXTURES];
|
||||
count = 0;
|
||||
hasTexture = false;
|
||||
}
|
||||
@@ -6186,13 +6179,13 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
}
|
||||
|
||||
public void allocate() {
|
||||
codes = new int[DEFAULT_IN_VERTICES];
|
||||
vertices = new float[3 * DEFAULT_IN_VERTICES];
|
||||
colors = new float[4 * DEFAULT_IN_VERTICES];
|
||||
normals = new float[3 * DEFAULT_IN_VERTICES];
|
||||
texcoords = new float[2 * DEFAULT_IN_VERTICES];
|
||||
strokes = new float[5 * DEFAULT_IN_VERTICES];
|
||||
edges = new int[DEFAULT_IN_EDGES][3];
|
||||
codes = new int[PGL.DEFAULT_IN_VERTICES];
|
||||
vertices = new float[3 * PGL.DEFAULT_IN_VERTICES];
|
||||
colors = new float[4 * PGL.DEFAULT_IN_VERTICES];
|
||||
normals = new float[3 * PGL.DEFAULT_IN_VERTICES];
|
||||
texcoords = new float[2 * PGL.DEFAULT_IN_VERTICES];
|
||||
strokes = new float[5 * PGL.DEFAULT_IN_VERTICES];
|
||||
edges = new int[PGL.DEFAULT_IN_EDGES][3];
|
||||
reset();
|
||||
}
|
||||
|
||||
@@ -6781,23 +6774,23 @@ public class PGraphicsOpenGL extends PGraphics {
|
||||
}
|
||||
|
||||
public void allocate() {
|
||||
fillVertices = new float[3 * DEFAULT_TESS_VERTICES];
|
||||
fillColors = new float[4 * DEFAULT_TESS_VERTICES];
|
||||
fillNormals = new float[3 * DEFAULT_TESS_VERTICES];
|
||||
fillTexcoords = new float[2 * DEFAULT_TESS_VERTICES];
|
||||
fillIndices = new int[DEFAULT_TESS_VERTICES];
|
||||
fillVertices = new float[3 * PGL.DEFAULT_TESS_VERTICES];
|
||||
fillColors = new float[4 * PGL.DEFAULT_TESS_VERTICES];
|
||||
fillNormals = new float[3 * PGL.DEFAULT_TESS_VERTICES];
|
||||
fillTexcoords = new float[2 * PGL.DEFAULT_TESS_VERTICES];
|
||||
fillIndices = new int[PGL.DEFAULT_TESS_VERTICES];
|
||||
|
||||
lineVertices = new float[3 * DEFAULT_TESS_VERTICES];
|
||||
lineColors = new float[4 * DEFAULT_TESS_VERTICES];
|
||||
lineNormals = new float[3 * DEFAULT_TESS_VERTICES];
|
||||
lineAttributes = new float[4 * DEFAULT_TESS_VERTICES];
|
||||
lineIndices = new int[DEFAULT_TESS_VERTICES];
|
||||
lineVertices = new float[3 * PGL.DEFAULT_TESS_VERTICES];
|
||||
lineColors = new float[4 * PGL.DEFAULT_TESS_VERTICES];
|
||||
lineNormals = new float[3 * PGL.DEFAULT_TESS_VERTICES];
|
||||
lineAttributes = new float[4 * PGL.DEFAULT_TESS_VERTICES];
|
||||
lineIndices = new int[PGL.DEFAULT_TESS_VERTICES];
|
||||
|
||||
pointVertices = new float[3 * DEFAULT_TESS_VERTICES];
|
||||
pointColors = new float[4 * DEFAULT_TESS_VERTICES];
|
||||
pointNormals = new float[3 * DEFAULT_TESS_VERTICES];
|
||||
pointAttributes = new float[2 * DEFAULT_TESS_VERTICES];
|
||||
pointIndices = new int[DEFAULT_TESS_VERTICES];
|
||||
pointVertices = new float[3 * PGL.DEFAULT_TESS_VERTICES];
|
||||
pointColors = new float[4 * PGL.DEFAULT_TESS_VERTICES];
|
||||
pointNormals = new float[3 * PGL.DEFAULT_TESS_VERTICES];
|
||||
pointAttributes = new float[2 * PGL.DEFAULT_TESS_VERTICES];
|
||||
pointIndices = new int[PGL.DEFAULT_TESS_VERTICES];
|
||||
|
||||
reset();
|
||||
}
|
||||
|
||||
@@ -163,8 +163,6 @@ public class PShape3D extends PShape {
|
||||
protected VertexCache pointColorsCache;
|
||||
protected VertexCache pointNormalsCache;
|
||||
protected VertexCache pointAttributesCache;
|
||||
|
||||
public static final int DEFAULT_CACHE_SIZE = 128;
|
||||
|
||||
protected boolean isSolid;
|
||||
protected boolean isClosed;
|
||||
@@ -3413,7 +3411,7 @@ public class PShape3D extends PShape {
|
||||
|
||||
VertexCache(int ncoords) {
|
||||
this.ncoords = ncoords;
|
||||
this.data = new float[ncoords * DEFAULT_CACHE_SIZE];
|
||||
this.data = new float[ncoords * PGL.DEFAULT_VERTEX_CACHE_SIZE];
|
||||
this.offset = 0;
|
||||
this.size = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user