Jump to content

[SOLVED] About remove Node and node image.


photo

Recommended Posts

HI!


 I create a earth model.and add image for it. add image for Node code:


             ObjectMeshDynamic* pTile = new ObjectMeshDynamic();
             Image* image;
             image = getImage(...);
             if(image != NULL)
             {
                      Material* matTex = pTile->getMaterialInherit(0);   
                      matTex->setImageTextureImage(matTex->findTexture("diffuse"),*image,1); 
   
            } 

 
      Now i create next layer,so i want to remove the old node.remove node code:
          
            string meshName = "mesh_"+xyw_replace(tt_tileKey,pattern,dstPattern);  
           if(engine.materials->findMaterial(meshName.c_str()))
           {
                int retv = engine.materials->removeMaterial(meshName.c_str());
           }
  
            _pGlobeRoot->removeChild(tileNode);
           // NodeDummy *_pGlobeRoot = new NodeDummy(); _pGlobeRoot is tree root node.
           if (engine.editor)
          {
                engine.editor->removeNode(tileNode);
   
          }

        But i find my computer's memory that go up,not go down.
        removeMaterial() function ,can it remove it's image?
        i think that the image is not remove???

Link to comment
×
×
  • Create New...