mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
More fixes to the resource backup/(re)allocation/restore mechanism
This commit is contained in:
@@ -154,11 +154,10 @@ public class PFramebuffer implements PConstants {
|
||||
}
|
||||
|
||||
public void backup() {
|
||||
|
||||
}
|
||||
|
||||
public void restore() {
|
||||
setColorBuffers(colorBufferTex.clone(), colorBufferTex.length);
|
||||
setColorBuffers(colorBufferTex.clone(), colorBufferTex.length);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
|
||||
@@ -2212,19 +2212,20 @@ public class PShape3D extends PShape {
|
||||
numTexBuffers = 1;
|
||||
|
||||
firstVertex = 0;
|
||||
lastVertex = numVert - 1;
|
||||
lastVertex = numVert - 1;
|
||||
|
||||
initVertexData();
|
||||
initColorData();
|
||||
initNormalData();
|
||||
initTexCoordData();
|
||||
}
|
||||
|
||||
protected void allocate() {
|
||||
release(); // Just in the case this object is being re-allocated.
|
||||
|
||||
initVertexData();
|
||||
createVertexBuffer();
|
||||
initColorData();
|
||||
createColorBuffer();
|
||||
initNormalData();
|
||||
createNormalBuffer();
|
||||
initTexCoordData();
|
||||
|
||||
createVertexBuffer();
|
||||
createColorBuffer();
|
||||
createNormalBuffer();
|
||||
createTexCoordBuffer();
|
||||
}
|
||||
|
||||
@@ -2385,8 +2386,10 @@ public class PShape3D extends PShape {
|
||||
|
||||
|
||||
protected void deleteTexCoordBuffer() {
|
||||
for (int i = 0; i < glTexCoordBufferID.length; i++) {
|
||||
deleteTexCoordBuffer(i);
|
||||
if (glTexCoordBufferID != null) {
|
||||
for (int i = 0; i < glTexCoordBufferID.length; i++) {
|
||||
deleteTexCoordBuffer(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user