summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen
Commit message (Collapse)AuthorAgeFilesLines
* Reversed Type relocation ; Minor fixSven Gothel2011-07-2136-60/+28
| | | | | | | Reversed Type relocation (commit 92d6c9dc5fa72b01703456452c60822f36c14fff) from com.jogamp.gluegen.runtime.types back to com.jogamp.gluegen.cgram.types Enabled MemoryLayoutType.setLayouted(), avoiding double layout
* GlueGen proper size / alignment of primitive and compound types usage [2/2] ↵Sven Gothel2011-07-215-250/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | - Fin MachineDesction == MD MD.StaticConfig: - enum for all supported static configs (ID -> MD) - verified at runtime: test runtime queried-MD versus static-MD, hard fail if not compatible (size/alignment) SizeThunk primitive sizes: - Add notion of fixed native size (eg. int64_t) and otherwise (eg. long) java struct 'wrappers' code generation: - single class using size/offset arrays of all MachineDescription configurations - at runtime the array idx is queried in static block - type aligment for not fixed-native-size types (SizeThunk, undef long/int) via StructAccessor junit test: - add float test - fix native code - add java (create, write) -> native (verify) test works (tested) on: linux 32/64 and windows 32/64
* minor refinementSven Gothel2011-07-201-2/+0
|
* FIX StructAccessor / JavaEmitter's struct-emitter: Using byte offsetsSven Gothel2011-07-201-35/+6
| | | | | | | | | | | | | | | | | | | | Problem: typedef struct { int8_t bits1; // +1 - 0 // +3 (p32) int32_t id; // +4 - 4 int8_t bits2; // +1 - 8 // +3 (p32) - int64_t long0; // +8 - 12 "longBuffer.get(<type-sized index>)" is invalid, but "byteBuffer.getLong(<byte index>)" must be done. The actual impl. doesn't matter, hence dropping the other nio type mappings is good. FIXES 32bit unit test, works well (static) on 32/64 bit (unix). TODO: Respect diff alignment for OS/ARCH either by offset tables for all, or runtime computing.
* Cleanup: Platform CPU enum, MachineDescription,Sven Gothel2011-07-203-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Platform: - enum CPUFamily is part of CPUType - DALVIK -> ANDROID - ARM: ARM + ARMv[567] MachineDescription - self contained - static size/alignment Config (enum) for unix32, unix64, win32, win64 and armeabi - add 'long double' - Removed MachineDescription32Bit, MachineDescription64Bit - createStatic(..) uses OS/CPU to fetch best match if not at runtime FIXES: JavaEmitter's struct-emit: Proper 32/64 struct sizes TODO: StructAccessor's mapping to <Type>Buffer w/ index os sizeof(<Type>) doesn't work, since offset may not be multiple of sizeof(<Type>)! i.e. typedef struct { int8_t bits1; // +1 - 0 // +3 (p32) int32_t id; // +4 - 4 int8_t bits2; // +1 - 8 // +3 (p32) - int64_t long0; // +8 - 12 so "longBuffer.get(<type-sized index>)" is invalid, but "byteBuffer.getLong(<byte index>)" must be done. The actual impl. doesn't matter, hence dropping the other nio type mappings is good.
* Fix bad file rename/move: .jav -> .javaSven Gothel2011-07-181-0/+0
|
* - Moved most types and StructLayout to runtime package:Sven Gothel2011-07-1839-208/+344
| | | | | | | | | | | | | | | | | | | | | com.jogamp.gluegen.cgram.types -> com.jogamp.gluegen.runtime.types This is required for desired runtime memory layout. - Split CompoundType to StructType + UnionType - StructLayout: - Utilizing SizeThunk alignment - Alignment 1) Natural type alignment 2) Add Size 3) Trailing padding w/ largest element alignment - Only perform memory layout once for type. Status: - Unit test passes w/ static MachineDescriptor64Bit - FIXME static 32bit is faulty, uses 64bit size/alignment - TODO runtime struct layout to please all platforms w/o worrying
* GlueGen: Alignment Cleanup ..Sven Gothel2011-07-174-53/+104
| | | | | | | | | | - SizeThunk - rename: compute -> computeSize - add: computeAlignment - merge types: char -> int8, short -> int16 - 'int' and 'long' may differ -
* Clarify aligment docSven Gothel2011-07-171-7/+18
|
* Fix alignment query code docSven Gothel2011-07-171-3/+2
|
* GlueGen proper size / alignment of primitive and compound types usage [1/2] ↵Sven Gothel2011-07-1717-223/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Preparation. Currently GlueGen fails for type long (size) and some alignments (see package.html). - The size and alignment values shall be queried at runtime. - Compound alignment needs to follow the described natural alignment (also @runtime). - - Build - add Linux Arm7 (EABI) - junit test - added compound/struct tests, pointing out the shortcomings of current impl. - package.html - Added alignment documentation - remove intptr.cfg - add GluGen types int8_t, int16_t, uint8_t, uint16_t - move MachineDescription* into runtime - Platform - has runtime MachineDescription - moved size, .. to MachineDescription - use enums for OSType, CPUArch and CPUType defined by os.name/os.arch, triggering exception if os/arch is not supported. This avoids Java String comparison and conscious os/arch detection. - MachineDescription: - compile time instances MachineDescription32Bits, MachineDescription64Bits - runtime queried instance MachineDescriptionRuntime - correct size, alignment, page size, ..
* Gluegen AntTask: 'literalInclude' may contain multiple directories, ↵Sven Gothel2011-06-101-10/+19
| | | | separated by comma (enhancement)
* refactoring in common.nio public api - removed Int64BufferMichael Bien2011-04-263-28/+18
| | | | | | - removed Int64Buffer since it is no longer needed for LongBuffer emulation Signed-off-by: Sven Gothel <[email protected]>
* DoubleCheckLocking: Added 'ok' comment - volatile varSven Gothel2011-02-261-1/+1
|
* html fixesSven Gothel2011-02-091-15/+10
|
* Fix doc for type 'long' - added WARNING (ambiguous size Windows/Unix)Sven Gothel2010-12-161-19/+24
|
* GlueGen: Close in/out streams to allow deleteOnExit() to succeed on WindowsSven Gothel2010-11-251-0/+3
|
* API Doc: Complete list of predefined typesSven Gothel2010-11-151-0/+7
|
* Fix size_t, uintptr_t and uint32_t, uint64_t: suppress 'unsigned' in ↵Sven Gothel2010-11-142-5/+5
| | | | | | | 'toString()' ; Added type tests. For size_t and uintptr_t this actually generated invalid C code. Added type tests for those.
* JogampVersion: StringBuffer getInfo(StringBuffer) -> StringBuffer ↵Sven Gothel2010-11-141-1/+1
| | | | toStringBuffer(StringBuffer) ; Add String toString() { ..}
* com.jogamp.common.util.GlueGenVersion -> com.jogamp.common.GlueGenVersionSven Gothel2010-11-121-1/+1
|
* New: JogampVersion, providing generic information for Jogamp JAR archives; ↵Sven Gothel2010-11-121-0/+2
| | | | | | | | | VersionInfo -> GlueGenVersion JogampVersion, providing generic information for Jogamp JAR archives Accessor to the Jogamp specific manifest additions, ie branch and commit. Also provides convenient attribute access and version dump methods.
* Enhance API doc .. package description etcSven Gothel2010-11-092-50/+62
|
* Gluegen: Types (stddef/stdint), Header and Predefined Macro ChangeSven Gothel2010-11-096-15/+89
| | | | | | | | | | | | | Read API doc ad GlueGen.java New predefined types: wchar_t, intptr_t, uintptr_t New reusable headers for gluegen usage: make/stub_includes/gluegen for native usage: make/stub_includes/platform New predefined macro #define __GLUEGEN__ 2
* Reformated license tagSven Gothel2010-11-081-29/+28
|
* Clarified cgram license, ie TNode.javaSven Gothel2010-11-081-0/+38
|
* PCPP: Let '#error token' throw an exception with the message; Note: #warning ↵Sven Gothel2010-11-081-1/+1
| | | | needs to be quoted when having seperators
* Fix PCPP 'define' case; Keep PCPP output file if 'debug' ; GlueGen uses PCPP ↵Sven Gothel2010-11-072-15/+22
| | | | | | | | | | | | | | | | | | | | | | | | in same thread via File. Fix PCPP 'define' case ------------------------ A recursive define like: #define LALA ((int)1) #define LILI LALA was streamed out of PCPP, even though such 'macro defines' like #define LILI ((int)1) are disabled due to the parsers inability to digg those. Added test on macro definition for replaced values. GlueGen uses PCPP in same thread via File ------------------------------------------ To ease debugging we call PCPP from the same thread and use normal temp files as i/o. Keep PCPP output file if 'debug' --------------------------------- Keep temp outfile if debug is enabled
* PCPP: Add '# <line> <file>' pass through ; Fix NB antlr.jar referenceSven Gothel2010-11-071-1/+11
|
* Gluegen/PCPP: Refined PCPP if-elif-else-endif ; Add 'dumpCPP' option to ↵Sven Gothel2010-11-073-77/+125
| | | | direct PCPP to dump the output to stderr as well
* Fix PCPP encapsualted if/if blocksSven Gothel2010-11-071-17/+23
|
* PCPP: Add file and linenumber in exceptionsSven Gothel2010-11-071-3/+4
|
* PCPP: Fix ifdef/ifndef, if, elif and endif correct ; Enhanced PCPP testsSven Gothel2010-11-071-18/+37
|
* Relocation: GlueGen GL Parts to JoglSven Gothel2010-11-063-981/+0
|
* Renamed com.sun.gluegen -> com.jogamp.gluegenSven Gothel2010-11-0666-0/+22684
|
* RELOCATION: GlueGen OpenGL parts back to JoglSven Gothel2010-11-062-255/+0
|
* Updated list of OpenGL extension vendor suffixesSven Gothel2010-11-041-0/+6
|
* LICENSE.txt changes:Sven Gothel2010-09-142-49/+51
| | | | | | | | | | | | | - Added JogAmp Community and common denominator: New BSD 3-clause license - Added note to make/lib binary file (source and license) Added source and license text for external binaries used in build process (make/lib folder). Changed 'Sven Gothel' and 'Michael Bien' New BSD 3-clause license to 'JogAmp Community' Simplified BSD 2-clause license.
* another round of ProcAddressTable refactoring.Michael Bien2010-06-201-30/+147
| | | | | | | - moved getAddressFor() from generated table to ProcAddressTable - added initEntry() to e.g. eagerly initialize one single entry (e.g. clGetExtensionFunctionAddress which must be available first) - several utility methods mostly usefull for debugging - cleanup
* Adding DynamicLibraryBundle utility to bundle Tool and JNI native library ↵Sven Gothel2010-06-101-2/+5
| | | | | | | | | | | | | | loading and lookup Add JNILibLoaderBase.loadLibrary(String libname, boolean ignoreError); DynamicLibraryBundle provides Tool and JNI native library loading and lookup New classes: com.jogamp.common.os.DynamicLibraryBundle com.jogamp.common.os.DynamicLibraryBundleInfo com.jogamp.common.util.MiscUtils.java Change: DEBUG/VERBOSE properties 'gluegen' -> 'jogamp'
* Fix GLProcAddressResolver regression: Loop through all names until found or ↵Sven Gothel2010-04-271-8/+8
| | | | n/a. Return 0 if not found, no Exception
* renamed method.Michael Bien2010-04-241-3/+3
|
* Refactored ProcAddressTable generation.Michael Bien2010-04-245-238/+229
| | | | | - ProcAddressTable is now the common superclass for all tables - Removed ProcAddressHelpers and added FunctionAddressResolver extension mechanism
* introduced com.jogamp.common.{nio,os} packages and moved some classes.Michael Bien2010-03-3118-2707/+2
|
* introduced internal NativeBuffer interface, this can be made public as soon ↵Michael Bien2010-03-303-2/+50
| | | | | | we move to java language level 5. removed accidentally commited verbose javac property in build-junit.xml.
* http://www.jogamp.org/bugzilla/show_bug.cgi?id=392Sven Gothel2010-03-301-0/+52
| | | | | | | | | | | | | | | | | | 32bit/64bit values and arrays are misrepresented - PointerBuffer: Adding methods PointeRBuffer referenceBuffer(int index, Buffer data) PointeRBuffer referenceBuffer(Buffer data) Buffer getReferencedBuffer(int index) Buffer getReferencedBuffer() Adding a reference of a given direct Buffer to this pointer buffer, and retrieving a previously referenced direct Buffer. This allows a more convenient handling of PointerBuffer with the user API's ..
* Merge branch 'master' of github.com:mbien/gluegenSven Gothel2010-03-301-5/+30
|\
| * added sizeOfBufferElem(Buffer buf) to Buffers.Michael Bien2010-03-291-4/+29
| |
| * made conctructor protected.Michael Bien2010-03-291-1/+1
| |
* | http://www.jogamp.org/bugzilla/show_bug.cgi?id=389Sven Gothel2010-03-302-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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