Memory leakage using beginShape / endShape
in
Core Library Questions
•
1 year ago
Hi,
I've got a probelm with the shape functions. I have a cube which is constructed of some vertices and the textures are changed over the time. But every time the draw function is called with a newly texture-picture the used memory increases also I just change the texturevar to point to another already loaded image. Is there a need / possibily to destroy the previous texture/shape when I change it?
Here's the code
I've got a probelm with the shape functions. I have a cube which is constructed of some vertices and the textures are changed over the time. But every time the draw function is called with a newly texture-picture the used memory increases also I just change the texturevar to point to another already loaded image. Is there a need / possibily to destroy the previous texture/shape when I change it?
Here's the code
void draw(){
...
if(frameCount%30==0){
backimg = images[imgCounter];
imgCounter++;
}
...- textureMode(NORMALIZED);
stroke(0);
strokeWeight(0.0);
beginShape();
texture(backimg);
// -Z "back" face
vertex( w+5, -h-5, boxdepth*times*offs, 1, 0);
vertex(-w-5, -h-5, boxdepth*times*offs, 0, 0);
vertex(-w-5, h+5, boxdepth*times*offs, 0,1);
vertex( w+5, h+5, boxdepth*times*offs, 1, 1);
endShape(); -
//at that point the memory use increases, but only if the backimg var points to another new picture
-
1