Java Code Examples for android.opengl.GLES20#glDeleteBuffers()

The following examples show how to use android.opengl.GLES20#glDeleteBuffers() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GeometrySource.java    From Tanks with MIT License 6 votes vote down vote up
@Override
public void release(Geometry geometry)
{
  switch (mode)
  {
  case Dynamic:
    geometry.updateData(null, 0, null, null);
    break;

  case Static:
    int handle = geometry.getHandle();
    if (GLES20.glIsBuffer(handle))
      GLES20.glDeleteBuffers(1, new int[] { handle }, 0);

    geometry.updateData(0, 0, null, null);
    break;
  }
}
 
Example 2
Source File: GLState.java    From 30-android-libraries-in-30-days with Apache License 2.0 5 votes vote down vote up
public void deleteArrayBuffer(final int pHardwareBufferID) {
	if(this.mCurrentArrayBufferID == pHardwareBufferID) {
		this.mCurrentArrayBufferID = -1;
	}
	this.mHardwareIDContainer[0] = pHardwareBufferID;
	GLES20.glDeleteBuffers(1, this.mHardwareIDContainer, 0);
}
 
Example 3
Source File: GLState.java    From tilt-game-android with MIT License 5 votes vote down vote up
public void deleteIndexBuffer(final int pHardwareBufferID) {
	if (this.mCurrentIndexBufferID == pHardwareBufferID) {
		this.mCurrentIndexBufferID = -1;
	}
	this.mHardwareIDContainer[0] = pHardwareBufferID;
	GLES20.glDeleteBuffers(1, this.mHardwareIDContainer, 0);
}
 
Example 4
Source File: OGLESShaderRenderer.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void deleteBuffer(VertexBuffer vb) {
    int bufId = vb.getId();
    if (bufId != -1) {
        // delete buffer
        intBuf1.put(0, bufId);
        intBuf1.position(0).limit(1);
        if (verboseLogging) {
            logger.info("GLES20.glDeleteBuffers(1, buffer)");
        }

        GLES20.glDeleteBuffers(1, intBuf1);
        vb.resetObject();
    }
}
 
Example 5
Source File: GLState.java    From 30-android-libraries-in-30-days with Apache License 2.0 5 votes vote down vote up
public void deleteIndexBuffer(final int pHardwareBufferID) {
	if(this.mCurrentIndexBufferID == pHardwareBufferID) {
		this.mCurrentIndexBufferID = -1;
	}
	this.mHardwareIDContainer[0] = pHardwareBufferID;
	GLES20.glDeleteBuffers(1, this.mHardwareIDContainer, 0);
}
 
Example 6
Source File: Quad.java    From ShapesInOpenGLES2.0 with MIT License 5 votes vote down vote up
/**
 * deletes buffers from OpenGL's memory.
 */
void release() {
    if (qvbo[0] > 0) {
        GLES20.glDeleteBuffers(qvbo.length, qvbo, 0);
        qvbo[0] = 0;
    }

    if (qibo[0] > 0) {
        GLES20.glDeleteBuffers(qibo.length, qibo, 0);
        qibo[0] = 0;
    }
}
 
Example 7
Source File: GLState.java    From tilt-game-android with MIT License 5 votes vote down vote up
public void deleteArrayBuffer(final int pHardwareBufferID) {
	if (this.mCurrentArrayBufferID == pHardwareBufferID) {
		this.mCurrentArrayBufferID = -1;
	}
	this.mHardwareIDContainer[0] = pHardwareBufferID;
	GLES20.glDeleteBuffers(1, this.mHardwareIDContainer, 0);
}
 
Example 8
Source File: HeightMap.java    From ShapesInOpenGLES2.0 with MIT License 5 votes vote down vote up
void release() {
    if (vbo[0] > 0) {
        GLES20.glDeleteBuffers(vbo.length, vbo, 0);
        vbo[0] = 0;
    }

    if (ibo[0] > 0) {
        GLES20.glDeleteBuffers(ibo.length, ibo, 0);
        ibo[0] = 0;
    }
}
 
Example 9
Source File: Spheres.java    From ShapesInOpenGLES2.0 with MIT License 4 votes vote down vote up
public void release() {
    // Delete buffers from OpenGL's memory
    final int[] buffersToDelete = new int[] { aSpheresVerticesBufferIdx, aSpheresColorsBufferIdx};
    GLES20.glDeleteBuffers(buffersToDelete.length, buffersToDelete, 0);
}
 
Example 10
Source File: GLES20IdImpl.java    From Trebuchet with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void glDeleteBuffers(GL11 gl, int n, int[] buffers, int offset) {
    GLES20.glDeleteBuffers(n, buffers, offset);
    GLES20Canvas.checkError();
}
 
Example 11
Source File: CubicBezier.java    From Muzesto with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void release() {
    // delete the buffer from OpenGL's memory
    final int[] buffersToDelete = new int[]{mBufferId};
    GLES20.glDeleteBuffers(buffersToDelete.length, buffersToDelete, 0);
}
 
Example 12
Source File: GLES20IdImpl.java    From android-openGL-canvas with Apache License 2.0 4 votes vote down vote up
@Override
public void glDeleteBuffers(int n, int[] buffers, int offset) {
    GLES20.glDeleteBuffers(n, buffers, offset);
    GLES20Canvas.checkError();
}
 
Example 13
Source File: ParticleSystem.java    From StarWars.Android with MIT License 4 votes vote down vote up
@Override
public void release() {
    final int[] buffersToDelete = new int[] { mBufferId };
    GLES20.glDeleteBuffers(buffersToDelete.length, buffersToDelete, 0);
}
 
Example 14
Source File: Points.java    From ShapesInOpenGLES2.0 with MIT License 4 votes vote down vote up
/**
 * Delete buffers from OpenGL's memory
 */
public void release() {
    // Delete buffers from OpenGL's memory
    final int[] buffersToDelete = new int[] { aPointPositionsBufferIdx, aPointColorsBufferIdx };
    GLES20.glDeleteBuffers(buffersToDelete.length, buffersToDelete, 0);
}
 
Example 15
Source File: AndroidGL.java    From trekarta with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void deleteBuffers(int n, IntBuffer buffers) {
    GLES20.glDeleteBuffers(n, buffers);
}
 
Example 16
Source File: GLES20IdImpl.java    From LB-Launcher with Apache License 2.0 4 votes vote down vote up
@Override
public void glDeleteBuffers(GL11 gl, int n, int[] buffers, int offset) {
    GLES20.glDeleteBuffers(n, buffers, offset);
    GLES20Canvas.checkError();
}
 
Example 17
Source File: DebugMeshShaderRenderer.java    From justaline-android with Apache License 2.0 4 votes vote down vote up
public void clearGL() {
    GLES20.glDeleteShader(mProgramName);
    GLES20.glDeleteBuffers(1, new int[]{mVbo}, 0);
}
 
Example 18
Source File: LineShaderRenderer.java    From justaline-android with Apache License 2.0 4 votes vote down vote up
public void clearGL() {
    GLES20.glDeleteShader(mProgramName);
    GLES20.glDeleteBuffers(1, new int[]{mVbo}, 0);
}
 
Example 19
Source File: ColorFade.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
private void destroyGLBuffers() {
    GLES20.glDeleteBuffers(2, mGLBuffers, 0);
    checkGlErrors("glDeleteBuffers");
}
 
Example 20
Source File: GLHelper.java    From libcommon with Apache License 2.0 2 votes vote down vote up
/**
 * バッファーオブジェクトを破棄する
 * @param bufIds
 */
public static void deleteBuffer(@NonNull final int[] bufIds) {
	GLES20.glDeleteBuffers(bufIds.length, bufIds, 0);
}