public override void OnClose() { if (objMeshs != null) { foreach (ObjGroup anObjMesh in objMeshs) { anObjMesh.Dispose(); } } // foreach (ObjGameObject aRenderGameObject in theRenderGameObjects) // { // aRenderGameObject.Dispose(); // } if (theTileObjects != null) { foreach (ObjObject aObjObject in theTileObjects) { aObjObject.Dispose(); } } if (materialPoint != null) { materialPoint.Dispose(); } foreach (KeyValuePair <Tile.TileIds, PlainBmpTexture> plainBmpTexture in tileTextures) { plainBmpTexture.Value.Material.Dispose(); } program.DisposeChildren = true; program.Dispose(); }
public void Dispose() { for (int i = 0; i < Objects.Count; i++) { Objects[i].Dispose(); } defaultMaterial.Dispose(); // if (defaultProgram != null) defaultProgram.Dispose(); }