コード例 #1
0
ファイル: Mandelbrot.java プロジェクト: SilverTiger/lwjgl3
  private void cleanup() {
    CLCleaner memObjCleaner =
        new CLCleaner() {
          @Override
          public int release(long object) {
            return clReleaseMemObject(object);
          }
        };

    release(clTexture, memObjCleaner);
    release(clColorMap, memObjCleaner);

    release(
        clKernel,
        new CLCleaner() {
          @Override
          public int release(long object) {
            return clReleaseKernel(object);
          }
        });

    release(
        clProgram,
        new CLCleaner() {
          @Override
          public int release(long object) {
            return clReleaseProgram(object);
          }
        });

    release(
        clQueue,
        new CLCleaner() {
          @Override
          public int release(long object) {
            return clReleaseCommandQueue(object);
          }
        });

    release(
        clContext,
        new CLCleaner() {
          @Override
          public int release(long object) {
            return clReleaseContext(object);
          }
        });
    clContextCB.free();

    glDeleteProgram(glProgram);
    glDeleteShader(fsh);
    glDeleteShader(vsh);
    glDeleteBuffers(vbo);
    glDeleteVertexArrays(vao);

    if (debugProc != null) debugProc.free();
  }
コード例 #2
0
 /** Deletes this vertex array, any externally attached buffers are not deleted */
 public void delete() {
   glBindVertexArray(0);
   glDeleteVertexArrays(vaoId);
 }