Пример #1
0
  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);
 }