com.sun.opengl.impl

Class GLObjectTracker


public class GLObjectTracker
extends Object

Tracks the creation of server-side OpenGL objects which can be shared between contexts. Ordinarily, when an OpenGL context is deleted and no other contexts are sharing server-side objects with it, all of the server-side objects are automatically deleted by the OpenGL implementation. It is not necessary for the end user to explicitly delete these objects. However, when the Java2D/OpenGL pipeline is active and frame buffer objects are being used for rendering, it is necessary for all OpenGL contexts created by JOGL to share server-side objects with the Java2D OpenGL context. This means that these objects "leak" into the namespace used by Java2D. In order to prevent memory leaks and to present the same programming model to the end user, it is necessary to track the creation and destruction of all of these server-side OpenGL objects and to explicitly release them when all of the JOGL-created contexts which can see them have been released.

The ref and unref methods should be used during the creation and destruction of OpenGL contexts by JOGL in order to update the liveness of the objects being tracked. The various other methods should be called by the OpenGL binding in the various named methods.

Method Summary

void
addBuffers(int n, IntBuffer ids)
void
addBuffers(int n, int[] ids, int ids_offset)
void
addBuffersARB(int n, IntBuffer ids)
void
addBuffersARB(int n, int[] ids, int ids_offset)
void
addFencesAPPLE(int n, IntBuffer ids)
void
addFencesAPPLE(int n, int[] ids, int ids_offset)
void
addFencesNV(int n, IntBuffer ids)
void
addFencesNV(int n, int[] ids, int ids_offset)
void
addFragmentShadersATI(int start, int n)
void
addFramebuffersEXT(int n, IntBuffer ids)
void
addFramebuffersEXT(int n, int[] ids, int ids_offset)
void
addLists(int start, int n)
void
addOcclusionQueriesNV(int n, IntBuffer ids)
void
addOcclusionQueriesNV(int n, int[] ids, int ids_offset)
void
addProgramObject(int obj)
void
addProgramObjectARB(int obj)
void
addProgramsARB(int n, IntBuffer ids)
void
addProgramsARB(int n, int[] ids, int ids_offset)
void
addProgramsNV(int n, IntBuffer ids)
void
addProgramsNV(int n, int[] ids, int ids_offset)
void
addQueries(int n, IntBuffer ids)
void
addQueries(int n, int[] ids, int ids_offset)
void
addQueriesARB(int n, IntBuffer ids)
void
addQueriesARB(int n, int[] ids, int ids_offset)
void
addRenderbuffersEXT(int n, IntBuffer ids)
void
addRenderbuffersEXT(int n, int[] ids, int ids_offset)
void
addShaderObject(int obj)
void
addShaderObjectARB(int obj)
void
addTextures(int n, IntBuffer ids)
void
addTextures(int n, int[] ids, int ids_offset)
void
addVertexArraysAPPLE(int n, IntBuffer ids)
void
addVertexArraysAPPLE(int n, int[] ids, int ids_offset)
void
addVertexShadersEXT(int start, int n)
void
clean(GL gl)
void
ref()
void
removeBuffers(int n, IntBuffer ids)
void
removeBuffers(int n, int[] ids, int ids_offset)
void
removeBuffersARB(int n, IntBuffer ids)
void
removeBuffersARB(int n, int[] ids, int ids_offset)
void
removeFencesAPPLE(int n, IntBuffer ids)
void
removeFencesAPPLE(int n, int[] ids, int ids_offset)
void
removeFencesNV(int n, IntBuffer ids)
void
removeFencesNV(int n, int[] ids, int ids_offset)
void
removeFragmentShaderATI(int obj)
void
removeFramebuffersEXT(int n, IntBuffer ids)
void
removeFramebuffersEXT(int n, int[] ids, int ids_offset)
void
removeLists(int start, int n)
void
removeOcclusionQueriesNV(int n, IntBuffer ids)
void
removeOcclusionQueriesNV(int n, int[] ids, int ids_offset)
void
removeProgramObject(int obj)
void
removeProgramOrShaderObjectARB(int obj)
void
removeProgramsARB(int n, IntBuffer ids)
void
removeProgramsARB(int n, int[] ids, int ids_offset)
void
removeProgramsNV(int n, IntBuffer ids)
void
removeProgramsNV(int n, int[] ids, int ids_offset)
void
removeQueries(int n, IntBuffer ids)
void
removeQueries(int n, int[] ids, int ids_offset)
void
removeQueriesARB(int n, IntBuffer ids)
void
removeQueriesARB(int n, int[] ids, int ids_offset)
void
removeRenderbuffersEXT(int n, IntBuffer ids)
void
removeRenderbuffersEXT(int n, int[] ids, int ids_offset)
void
removeShaderObject(int obj)
void
removeTextures(int n, IntBuffer ids)
void
removeTextures(int n, int[] ids, int ids_offset)
void
removeVertexArraysAPPLE(int n, IntBuffer ids)
void
removeVertexArraysAPPLE(int n, int[] ids, int ids_offset)
void
removeVertexShaderEXT(int obj)
void
transferAll(GLObjectTracker other)
void
unref(GLObjectTracker deletedObjectPool)

Method Details

addBuffers

public void addBuffers(int n,
                       IntBuffer ids)

addBuffers

public void addBuffers(int n,
                       int[] ids,
                       int ids_offset)

addBuffersARB

public void addBuffersARB(int n,
                          IntBuffer ids)

addBuffersARB

public void addBuffersARB(int n,
                          int[] ids,
                          int ids_offset)

addFencesAPPLE

public void addFencesAPPLE(int n,
                           IntBuffer ids)

addFencesAPPLE

public void addFencesAPPLE(int n,
                           int[] ids,
                           int ids_offset)

addFencesNV

public void addFencesNV(int n,
                        IntBuffer ids)

addFencesNV

public void addFencesNV(int n,
                        int[] ids,
                        int ids_offset)

addFragmentShadersATI

public void addFragmentShadersATI(int start,
                                  int n)

addFramebuffersEXT

public void addFramebuffersEXT(int n,
                               IntBuffer ids)

addFramebuffersEXT

public void addFramebuffersEXT(int n,
                               int[] ids,
                               int ids_offset)

addLists

public void addLists(int start,
                     int n)

addOcclusionQueriesNV

public void addOcclusionQueriesNV(int n,
                                  IntBuffer ids)

addOcclusionQueriesNV

public void addOcclusionQueriesNV(int n,
                                  int[] ids,
                                  int ids_offset)

addProgramObject

public void addProgramObject(int obj)

addProgramObjectARB

public void addProgramObjectARB(int obj)

addProgramsARB

public void addProgramsARB(int n,
                           IntBuffer ids)

addProgramsARB

public void addProgramsARB(int n,
                           int[] ids,
                           int ids_offset)

addProgramsNV

public void addProgramsNV(int n,
                          IntBuffer ids)

addProgramsNV

public void addProgramsNV(int n,
                          int[] ids,
                          int ids_offset)

addQueries

public void addQueries(int n,
                       IntBuffer ids)

addQueries

public void addQueries(int n,
                       int[] ids,
                       int ids_offset)

addQueriesARB

public void addQueriesARB(int n,
                          IntBuffer ids)

addQueriesARB

public void addQueriesARB(int n,
                          int[] ids,
                          int ids_offset)

addRenderbuffersEXT

public void addRenderbuffersEXT(int n,
                                IntBuffer ids)

addRenderbuffersEXT

public void addRenderbuffersEXT(int n,
                                int[] ids,
                                int ids_offset)

addShaderObject

public void addShaderObject(int obj)

addShaderObjectARB

public void addShaderObjectARB(int obj)

addTextures

public void addTextures(int n,
                        IntBuffer ids)

addTextures

public void addTextures(int n,
                        int[] ids,
                        int ids_offset)

addVertexArraysAPPLE

public void addVertexArraysAPPLE(int n,
                                 IntBuffer ids)

addVertexArraysAPPLE

public void addVertexArraysAPPLE(int n,
                                 int[] ids,
                                 int ids_offset)

addVertexShadersEXT

public void addVertexShadersEXT(int start,
                                int n)

clean

public void clean(GL gl)

ref

public void ref()

removeBuffers

public void removeBuffers(int n,
                          IntBuffer ids)

removeBuffers

public void removeBuffers(int n,
                          int[] ids,
                          int ids_offset)

removeBuffersARB

public void removeBuffersARB(int n,
                             IntBuffer ids)

removeBuffersARB

public void removeBuffersARB(int n,
                             int[] ids,
                             int ids_offset)

removeFencesAPPLE

public void removeFencesAPPLE(int n,
                              IntBuffer ids)

removeFencesAPPLE

public void removeFencesAPPLE(int n,
                              int[] ids,
                              int ids_offset)

removeFencesNV

public void removeFencesNV(int n,
                           IntBuffer ids)

removeFencesNV

public void removeFencesNV(int n,
                           int[] ids,
                           int ids_offset)

removeFragmentShaderATI

public void removeFragmentShaderATI(int obj)

removeFramebuffersEXT

public void removeFramebuffersEXT(int n,
                                  IntBuffer ids)

removeFramebuffersEXT

public void removeFramebuffersEXT(int n,
                                  int[] ids,
                                  int ids_offset)

removeLists

public void removeLists(int start,
                        int n)

removeOcclusionQueriesNV

public void removeOcclusionQueriesNV(int n,
                                     IntBuffer ids)

removeOcclusionQueriesNV

public void removeOcclusionQueriesNV(int n,
                                     int[] ids,
                                     int ids_offset)

removeProgramObject

public void removeProgramObject(int obj)

removeProgramOrShaderObjectARB

public void removeProgramOrShaderObjectARB(int obj)

removeProgramsARB

public void removeProgramsARB(int n,
                              IntBuffer ids)

removeProgramsARB

public void removeProgramsARB(int n,
                              int[] ids,
                              int ids_offset)

removeProgramsNV

public void removeProgramsNV(int n,
                             IntBuffer ids)

removeProgramsNV

public void removeProgramsNV(int n,
                             int[] ids,
                             int ids_offset)

removeQueries

public void removeQueries(int n,
                          IntBuffer ids)

removeQueries

public void removeQueries(int n,
                          int[] ids,
                          int ids_offset)

removeQueriesARB

public void removeQueriesARB(int n,
                             IntBuffer ids)

removeQueriesARB

public void removeQueriesARB(int n,
                             int[] ids,
                             int ids_offset)

removeRenderbuffersEXT

public void removeRenderbuffersEXT(int n,
                                   IntBuffer ids)

removeRenderbuffersEXT

public void removeRenderbuffersEXT(int n,
                                   int[] ids,
                                   int ids_offset)

removeShaderObject

public void removeShaderObject(int obj)

removeTextures

public void removeTextures(int n,
                           IntBuffer ids)

removeTextures

public void removeTextures(int n,
                           int[] ids,
                           int ids_offset)

removeVertexArraysAPPLE

public void removeVertexArraysAPPLE(int n,
                                    IntBuffer ids)

removeVertexArraysAPPLE

public void removeVertexArraysAPPLE(int n,
                                    int[] ids,
                                    int ids_offset)

removeVertexShaderEXT

public void removeVertexShaderEXT(int obj)

transferAll

public void transferAll(GLObjectTracker other)

unref

public void unref(GLObjectTracker deletedObjectPool)

Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.