aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/sun/gluegen/JavaMethodBindingEmitter.java
Commit message (Collapse)AuthorAgeFilesLines
* gluegen imports now com.jogamp.common.nio.* and java.nio.* instead of using ↵Michael Bien2010-04-081-38/+41
| | | | FQCN in emitted files.
* http://www.jogamp.org/bugzilla/show_bug.cgi?id=389Sven Gothel2010-03-301-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 32bit/64bit values and arrays are misrepresented - PointerBuffer is used to map 64bit integer values, which is illegal due to the latest PointerBuffer changes, where the underlying ByteBuffer is either 32bit wide or 64bit wide (in respect to the pointer size). The PointerBuffer semantic itself is correct, but no more suitable to represent 64bit values and arrays. A Int64Buffer (LongBuffer does not exist in CDC/CVM patch) should be used instead. - Determine use of Int64Buffer and PointerBuffer Assuming the 1st step being solved, it has to determined for which cases gluegen shall map a type to a PointerBuffer. All pointer pointer types, regardless of a Opaque mapping, ie: +++ typedef struct __MYAPIConfig * MYAPIConfig; Opaque long MYAPIConfig void foo(MYAPIConfig * ptrarray); +++ The argument 'ptrarray' must be represented as a PointerBuffer otherwise data is misrepresented in case: - 32bit machines _and_ - array semantics - more than one value is being used Impl: java/com/sun/gluegen/JavaEmitter.java: - Checks ptr-ptr for Opaque values - Returns PointerBuffer mapping for ptr-ptr types - Allow PointerBuffer being mapped as String[] Very elaborated tests .. :) ++++++++++++ Misc Changes: - Added <Type>.put(<Type>Buffer src) for Int64Buffer/PointerBuffer
* Resolved conflictsSven Gothel2010-03-291-18/+18
|\
| * renamed BufferFactory into Buffers.Michael Bien2010-03-291-18/+18
| |
* | New Int64Buffer type, which is being used for gluegen 'long *'Sven Gothel2010-03-291-1/+1
|/
* http://www.jogamp.org/bugzilla/show_bug.cgi?id=389Sven Gothel2010-03-281-96/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mixed types in generated code are functioning now, even though not all permutations are generated - still. However, this patch merges the indirect object passing, wheather it is a primitive array or an indirect NIO buffer, incl. PointerBuffer. This allows the usage of only one JNI functions for all combinations. Only in case of NIODirectOnly, the simplified direct only '0' variation is created - otherwise the parametrized '1' variant. The junit tests proves the implementation and almost completes the gluegen junit tests coverage for JavaEmitter and ProcAddressEmitter. Impact/Result: - Working mixed array types - JOGL GL2 native library shrunk around 30% - Simplified gluegen code - Almost complete gluegen junit tests TODO: Complete permutations of array/NIO arguments, if desired. ++++ Misc changes: - NativeLibrary implements DynamicLookupHelper: lookupFunction() -> dynamicLookupFunction()
* Drop PointerBuffer.wrapNative2Java(..)Sven Gothel2010-03-191-1/+1
| | | | | | in favor of a simple PointerBuffer.wrap(..), due to the new semantics, ie internal integer/long presentation. Fixed the javame code in this regard.
* fixed emitted code for buffer-array mixing.Michael Bien2010-01-121-3/+17
| | | | | removed workaround in BufferFactory since it is no longer needed. small code cleanup (generator java 5 migration).
* Code cleanup. Ported package com.sun.gluegen to java 5 language level.Michael Bien2009-12-011-31/+26
|
* Cleanup for a better OpenGL 3.2 integration,Sven Gothel2009-08-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for subsuming extensions: - Allow RenameExtensionIntoCore generate duplicate names, ie those will not be generated. - Add proper comment showing the extension of the symbol. - Fail if no 'GLHeader' is specified, but we are processing a GL/ProcAddress config - Fail if a GL function is not part of an extension MethodBinding, ConstantDefinition cleanup: - getName() returns the renamed name - getOrigName() returns the original - getAliasedNames() returns the aliased ones MethodBinding: - Change: equals() operates on renamed name - Add: hashCode() function - same criteria as equals() Impact: - All config options etc shall trigger with the renamed name, but ignore, rename etc. - Generated Java impl. uses the renamed base name as well Change: emitDefine() uses the ConstantDefinition Add: JavaConfiguration: dumpRenames() Change JavaConfiguration.shouldIgnoreInInterface/Impl(): - respect the renamed symbol name as well Change JavaEmitter.emitFunctions(): - only emit a generated MethodBinding once, therefor store emitted method bindings in a HashSet Fix BuildStaticGLInfo: - Allow white space at the end of #ifndef and #define - Trim strings - Allow 'const' qualifier in function pattern Fix GLEmitter: - Fail if no 'GLHeader' is specified, but a RenameIntoCore option .. - Don't emit marker defines, marking an extension (ie not part of an extension) Fix GLJavaMethodBindingEmitter: - Fail if a GL function is not part of an extension Fix PCPP: - Pass constant type qualifiers for hex-constants: 'l' 'L' ... Fix ProcAddressEmitter: - Operate on the aliased/renamed name for querying ProcAddress usage and generating code.
* Add missing changessg2158892009-07-131-2/+4
|
* Copied JOGL_2_SANDBOX r145 on to trunk; JOGL_2_SANDBOX branch is now closedKenneth Russel2009-06-151-0/+873
| | | | git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@147 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Deleted obsolete source code in preparation for copying JOGL_2_SANDBOXKenneth Russel2009-06-151-828/+0
| | | | | | | on to trunk git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@146 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Added support for passing outgoing arrays of compound types, including Kenneth Russel2008-05-261-7/+73
| | | | | | | | | | | non-const arrays of compound types and the associated copies back to Java, in support of constructs like eglChooseConfig. Generated code has been compiled but not yet tested. Refactorings to allow generated glue code using StructAccessors to work on Java ME / CDC / FP + JSR-239 NIO, as well as Java SE. Bug fix to ForceProcAddressGen. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@77 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Fixed Issue 6: unqualified class names in generated java code Kenneth Russel2008-04-191-9/+9
| | | | | | | | | | Applied and expanded patch from user tck to fully qualify all references to New I/O classes in generated code. Tested by removing Import of java.nio.* from JOGL and JOAL; required modification of the custom Java code for those packages, but otherwise working well. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@73 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* More robust code for direct / indirect buffer checkingKenneth Russel2007-06-031-1/+1
| | | | git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@61 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Fixed problem with glue code generation for outgoing void** arguments Kenneth Russel2006-07-081-0/+4
| | | | | | | | pointed out by users Dj3hut1 and kicklee on JOGL forum in the context of glMultiDrawElements calls git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@35 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Fixed and improved handling of Opaque directives for multiple pointer Kenneth Russel2006-05-281-1/+1
| | | | | | | | depths in particular to fix AGLPbuffer case supplied by Justin Couch. Tested with builds on Windows, Linux and Mac OS X and AGL test case. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@33 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Fixed Issue 212: Incorporate patch to add URL links to GL javadoc Kenneth Russel2006-04-171-1/+5
| | | | | | | | | | | | | Incorporated patch from user cylab on javagaming.org forums to generate @native tags in GL javadoc which are postprocessed using a taglet: http://www.javagaming.org/forums/index.php?topic=12629.0 Modified supplied patch to restrict the @native designation to only the function name, and to understand OpenGL data type-related suffixes (i.e., glVertex -> glVertex3f). git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@29 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Did refactoring and made private fields protected in order to allow Kenneth Russel2006-03-061-3/+19
| | | | | | | subclassing git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@21 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Intermediate checkin for FBO support in Java2D/JOGL bridge. Needed to Kenneth Russel2006-02-051-53/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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/gluegen/trunk@13 a78bb65f-1512-4460-ba86-f6dc96a7bf27
* Moved GlueGen out of the JOGL workspace and into its own project. Kenneth Russel2006-01-151-0/+784
Restructured JOGL and JOAL build processes to separately invoke GlueGen's main build.xml before using it to generate their code. Refactored OS/CPU detection code into gluegen-cpptasks.xml build file in GlueGen workspace, which is now imported by both the JOGL and JOAL build processes. Unfortunately it seems to be somewhat difficult to completely factor out the C compiler configuration into the GlueGen workspace so this has been left for a later date. Added missed ALProcAddressLookup file to JOAL workspace. Updated JOGL and JOAL build documentation. More documentation for the GlueGen workspace is forthcoming. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/trunk@3 a78bb65f-1512-4460-ba86-f6dc96a7bf27