From ced30725fdaa23c108605104d0d364055e629a63 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sun, 5 Feb 2006 18:09:25 +0000 Subject: Intermediate checkin for FBO support in Java2D/JOGL bridge. Needed to keep track of server-side OpenGL objects, like textures and display lists, created by the end user to preserve the illusion of independent contexts even though they will all share textures and display lists with the Java2D OpenGL context in order to access its FBO. Added GLObjectTracker class to track creation and destruction of these objects and to support cleanup when the last referring context has been destroyed. Modified GLContextShareSet to create and install GLObjectTrackers when necessary and GLContext to ref and unref tracker appropriately. Changed GlueGen's JavaPrologue and JavaEpilogue directives (and their documentation) to perform argument name substitution. Wrote documentation section on argument name substitution and specified behavior for primitive arrays (converts to string "array_name, array_name_offset" in substitution). Rephrased GlueGen's RangeCheck directives in terms of JavaPrologue directives and deleted old specialized code. Fixed bug in handling of VBO support in GLConfiguration when JavaPrologue was present for affected functions. Added JavaPrologue and JavaEpilogue directives to all existing OpenGL routines creating server-side objects (though it's possible some were missed) to call GLObjectTracker when necessary. Added RangeCheck directives for these routines as well. Worked around bug in JOGL demos where shutdownDemo() was being called more than once. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@584 232f8b59-042b-4e1e-8c03-345bb8c30851 --- make/gl-common.cfg | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) (limited to 'make/gl-common.cfg') diff --git a/make/gl-common.cfg b/make/gl-common.cfg index dfe01cc05..29fe943f4 100644 --- a/make/gl-common.cfg +++ b/make/gl-common.cfg @@ -374,6 +374,75 @@ RangeCheckBytes glTexSubImage3D 10 imageSizeInBytes({8}, {9}, {5} # fetching it # RangeCheckBytes glGetTexImage +# Range checks for server-side object creation and deletion methods +RangeCheck glGenBuffers 1 {0} +RangeCheck glDeleteBuffers 1 {0} +RangeCheck glGenBuffersARB 1 {0} +RangeCheck glDeleteBuffersARB 1 {0} +RangeCheck glGenFencesAPPLE 1 {0} +RangeCheck glDeleteFencesAPPLE 1 {0} +RangeCheck glGenFencesNV 1 {0} +RangeCheck glDeleteFencesNV 1 {0} +RangeCheck glGenFramebuffersEXT 1 {0} +RangeCheck glDeleteFramebuffersEXT 1 {0} +RangeCheck glGenOcclusionQueriesNV 1 {0} +RangeCheck glDeleteOcclusionQueriesNV 1 {0} +RangeCheck glGenProgramsARB 1 {0} +RangeCheck glDeleteProgramsARB 1 {0} +RangeCheck glGenProgramsNV 1 {0} +RangeCheck glDeleteProgramsNV 1 {0} +RangeCheck glGenQueries 1 {0} +RangeCheck glDeleteQueries 1 {0} +RangeCheck glGenQueriesARB 1 {0} +RangeCheck glDeleteQueriesARB 1 {0} +RangeCheck glGenRenderbuffersEXT 1 {0} +RangeCheck glDeleteRenderbuffersEXT 1 {0} +RangeCheck glGenTextures 1 {0} +RangeCheck glDeleteTextures 1 {0} +RangeCheck glGenVertexArraysAPPLE 1 {0} +RangeCheck glDeleteVertexArraysAPPLE 1 {0} + +# Track server-side object creation and deletion when necessary +JavaEpilogue glGenBuffers if (tracker != null) tracker.addBuffers({0}, {1}); +JavaEpilogue glGenBuffersARB if (tracker != null) tracker.addBuffersARB({0}, {1}); +JavaEpilogue glGenFencesAPPLE if (tracker != null) tracker.addFencesAPPLE({0}, {1}); +JavaEpilogue glGenFencesNV if (tracker != null) tracker.addFencesNV({0}, {1}); +JavaEpilogue glGenFragmentShadersATI if (tracker != null) tracker.addFragmentShadersATI(_res, {0}); +JavaEpilogue glGenFramebuffersEXT if (tracker != null) tracker.addFramebuffersEXT({0}, {1}); +JavaEpilogue glGenLists if (tracker != null) tracker.addLists(_res, {0}); +JavaEpilogue glGenOcclusionQueriesNV if (tracker != null) tracker.addOcclusionQueriesNV({0}, {1}); +JavaEpilogue glCreateProgram if (tracker != null) tracker.addProgramObject(_res); +JavaEpilogue glCreateProgramObjectARB if (tracker != null) tracker.addProgramObjectARB(_res); +JavaEpilogue glGenProgramsARB if (tracker != null) tracker.addProgramsARB({0}, {1}); +JavaEpilogue glGenProgramsNV if (tracker != null) tracker.addProgramsNV({0}, {1}); +JavaEpilogue glGenQueries if (tracker != null) tracker.addQueries({0}, {1}); +JavaEpilogue glGenQueriesARB if (tracker != null) tracker.addQueriesARB({0}, {1}); +JavaEpilogue glGenRenderbuffersEXT if (tracker != null) tracker.addRenderbuffersEXT({0}, {1}); +JavaEpilogue glCreateShader if (tracker != null) tracker.addShaderObject(_res); +JavaEpilogue glCreateShaderObjectARB if (tracker != null) tracker.addShaderObjectARB(_res); +JavaEpilogue glGenTextures if (tracker != null) tracker.addTextures({0}, {1}); +JavaEpilogue glGenVertexArraysAPPLE if (tracker != null) tracker.addVertexArraysAPPLE({0}, {1}); +JavaEpilogue glGenVertexShadersEXT if (tracker != null) tracker.addVertexShadersEXT(_res, {0}); + +JavaEpilogue glDeleteBuffers if (tracker != null) tracker.removeBuffers({0}, {1}); +JavaEpilogue glDeleteBuffersARB if (tracker != null) tracker.removeBuffersARB({0}, {1}); +JavaEpilogue glDeleteFencesAPPLE if (tracker != null) tracker.removeFencesAPPLE({0}, {1}); +JavaEpilogue glDeleteFencesNV if (tracker != null) tracker.removeFencesNV({0}, {1}); +JavaEpilogue glDeleteFragmentShaderATI if (tracker != null) tracker.removeFragmentShaderATI({0}); +JavaEpilogue glDeleteFramebuffersEXT if (tracker != null) tracker.removeFramebuffersEXT({0}, {1}); +JavaEpilogue glDeleteLists if (tracker != null) tracker.removeLists({0}, {1}); +JavaEpilogue glDeleteOcclusionQueriesNV if (tracker != null) tracker.removeOcclusionQueriesNV({0}, {1}); +JavaEpilogue glDeleteProgram if (tracker != null) tracker.removeProgramObject({0}); +JavaEpilogue glDeleteObjectARB if (tracker != null) tracker.removeProgramOrShaderObjectARB({0}); +JavaEpilogue glDeleteProgramsARB if (tracker != null) tracker.removeProgramsARB({0}, {1}); +JavaEpilogue glDeleteProgramsNV if (tracker != null) tracker.removeProgramsNV({0}, {1}); +JavaEpilogue glDeleteQueries if (tracker != null) tracker.removeQueries({0}, {1}); +JavaEpilogue glDeleteQueriesARB if (tracker != null) tracker.removeQueriesARB({0}, {1}); +JavaEpilogue glDeleteRenderbuffersEXT if (tracker != null) tracker.removeRenderbuffersEXT({0}, {1}); +JavaEpilogue glDeleteShader if (tracker != null) tracker.removeShaderObject({0}); +JavaEpilogue glDeleteTextures if (tracker != null) tracker.removeTextures({0}, {1}); +JavaEpilogue glDeleteVertexArraysAPPLE if (tracker != null) tracker.removeVertexArraysAPPLE({0}, {1}); +JavaEpilogue glDeleteVertexShaderEXT if (tracker != null) tracker.removeVertexShaderEXT({0}); # Javadoc for the GL class -- cgit v1.2.3