public void RemoveVBO(Stack <VBOStorageInformation> vbos) { //only delete if its not the node farthes in the hierarchy if (leaf == null) { //if leaf not null remove the VBO that is at this level and delete it from GPU memory VBOStorageInformation thisLevelVBO = vbos.Pop(); bool removed = serverBufferIds.Remove(thisLevelVBO); if (removed) { VBOUtils.DeleteFromGPU(thisLevelVBO); } } if (ParentNodeID != null) { ParentNodeID.RemoveVBO(vbos); } }
internal void SetInvisibleAndUnbuffered() { visible = false; if (ClearAllPoints()) { numberOfLoadedPoints = 0; if (serverBufferId != null) { VBOUtils.DeleteFromGPU(serverBufferId); serverBufferId = null; if (parentVBOs.Count > 0) { ParentNode.RemoveVBO(parentVBOs); } } State = LoadedState.UNLOADED; } }