@Override public void compile() { int newSize = layers.getSize(); if (newSize <= 0) { BufferObject.release(layers.vbo); layers.vbo = null; isReady = false; return; } if (layers.vbo == null) { layers.vbo = BufferObject.get(newSize); if (layers.vbo == null) return; } if (GLRenderer.uploadLayers(layers, newSize, true)) isReady = true; }
/** cleanup only when layers are not used by tile or layer anymore! */ public void clear() { /* NB: set null calls clear() on each layer! */ setBaseLayers(null); setTextureLayers(null); setExtrusionLayers(null); mCurLayer = null; if (vbo != null) vbo = BufferObject.release(vbo); }