summaryrefslogtreecommitdiffstats
path: root/make/scripts
Commit message (Collapse)AuthorAgeFilesLines
* Bug 641 NEWT: X11 Deliver keyCode layout independent, keySym layout ↵Sven Gothel2013-04-081-3/+3
| | | | | | | | | | dependent and UTF-16 keyChar value On X11, the layout dependent keySym was not delivered [1], as well as the UTF-8 to UTF-16 translation was missing [2]. [1] is solved using XLookupString w/o ShiftMask [2] is solved using JNI's NewStringUTF, which takes UTF-8.
* Bug 709: Testing texured demo w/ FBO, comparing w/ onscreen - No corruption.Sven Gothel2013-04-061-4/+5
|
* Bug 678: Differentiate ALT (left) and ALT_GRAPH (right) on X11, EventDev, ↵Sven Gothel2013-04-063-5/+7
| | | | | | | Windows and OSX - X11: Memorize pressed Alt_R to decide which 'alt' has to be used for non key modifier fetching - Windows: Only use GetKeyState(..) and compare the US vkey, since int. kbd layout use reduced scancode
* SWT unit tests: Sort w/ AWT and Headless - Fix threading w/ AWT.Sven Gothel2013-04-041-6/+8
| | | | This especially impacts (fixes) Mac OSX.
* OSX CALayer/NewtCanvasAWT: Force relayout of component (size +1, size -1) ↵Sven Gothel2013-04-041-24/+6
| | | | when attaching NEWT Child to avoid false CALayer position.
* Fix Bug 671: Add JPEG Decoder w/o AWT DependenciesSven Gothel2013-04-011-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original JavaScript code from <https://github.com/notmasteryet/jpgjs/blob/master/jpg.js>, author 'notmasteryet' <async.processingjs at yahoo.com>. Ported to Java. Enhancements: * InputStream instead of memory buffer * User provided memory handler * Fixed JPEG Component ID/Index mapping * Color space conversion (YCCK, CMYK -> RGB) * More error tolerant +++ Features: JOGL AWT RGB ok ok YCCK ok Exception CMYK ok Exception YUV Store ok n/a Need Y-Flip no yes +++ Benchmark: TestJPEGJoglAWTBenchmarkNewtAWT JOGL.RGB Loops 100, dt 1199 ms, 11.99 ms/l JOGL.YUV Loops 100, dt 351 ms, 3.51 ms/l AWT..... Loops 100, dt 2144 ms, 21.44 ms/l File: jogl/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/j1-baseline.jpg Machine: GNU/Linux PC (AMD 8 core), JavaSE 6 (1.6.0_38) .++++ UITestCase.setUp: com.jogamp.opengl.test.junit.jogl.util.texture.TestJPEGJoglAWTBenchmarkNewtAWT - benchmark libEGL warning: DRI2: failed to authenticate 0: JPEGImage[261x202, bytesPerPixel 3, reversedChannels false, JPEGPixels[261x202, sourceComp 3, sourceCS YCbCr, storageCS RGB, storageComp 3], java.nio.DirectByteBuffer[pos=0 lim=158166 cap=158166]] 0: TextureData[261x202, y-flip false, internFormat 0x1907, pixelFormat 0x1907, pixelType 0x1401, border 0, estSize 158166, alignment 1, rowlen 0, buffer java.nio.DirectByteBuffer[pos=0 lim=158166 cap=158166] JOGL.RGB Loops 100, dt 1199 ms, 11.99 ms/l 0: JPEGImage[261x202, bytesPerPixel 3, reversedChannels false, JPEGPixels[261x202, sourceComp 3, sourceCS YCbCr, storageCS YCbCr, storageComp 3], java.nio.DirectByteBuffer[pos=0 lim=158166 cap=158166]] 0: TextureData[261x202, y-flip false, internFormat 0x1907, pixelFormat 0x1907, pixelType 0x1401, border 0, estSize 158166, alignment 1, rowlen 0, buffer java.nio.DirectByteBuffer[pos=0 lim=158166 cap=158166] JOGL.YUV Loops 100, dt 351 ms, 3.51 ms/l 0: TextureData[261x202, y-flip true, internFormat 0x1907, pixelFormat 0x80e0, pixelType 0x1401, border 0, estSize 158166, alignment 1, rowlen 261, buffer java.nio.HeapByteBuffer[pos=0 lim=158166 cap=158166] AWT..... Loops 100, dt 2144 ms, 21.44 ms/l ++++ UITestCase.tearDown: com.jogamp.opengl.test.junit.jogl.util.texture.TestJPEGJoglAWTBenchmarkNewtAWT - benchmark
* Adapt to new version scheme, see GlueGen ↵Sven Gothel2013-03-281-7/+5
| | | | | | | a3f2ef50ad33c58a240a17fcf03e415d772207c3, etc; Fix NewtVersion, NativeWindowVersion and NewtVersionActivityLauncher NewtVersion, NativeWindowVersion: Also search for extension javax.media.opengl (all packaging) NewtVersionActivityLauncher: Use new launcher URI
* Unit Tests: Unify 'AWT Robot Key Press/Release', waitForIdle, action, delay, ↵Sven Gothel2013-03-273-9/+6
| | | | waitForIdle ; TestFocus0*: Wait until closed after win.destroy().
* OSX/NEWT: Fix visible -> false when closing and reparenting window. This ↵Sven Gothel2013-03-201-2/+0
| | | | | | | | | | | lead to non functional recreational reparenting. OSX recreational reparenting moves the saved GLEventListenerState at destroy to the new dawable/surface, which must be valid. The flaky visible state caused seemingly random reparenting failures. - WindowImpl.ReparentActionRecreate.run() set 'visible:=true', which circumvented OSX to wait for actual realization. - OSX WindowDriver.closeNative(): Issue visibleChanged(true, false); ASAP
* TestGearsES2NEWT/TestGearsES2NewtCanvasAWT: Add -noanim option to manually ↵Sven Gothel2013-03-201-3/+6
| | | | validate Bug 649
* TestPNGTextureFromFileNEWT: Use new PNG test file locations, add RGBA tests ↵Sven Gothel2013-03-201-3/+5
| | | | and use alpha in drawable
* OSX/NEWT: Following CALayer streaming design, i.e. issue NSWindow/NSView Ops ↵Sven Gothel2013-03-191-3/+3
| | | | | | | | | | | | | | | | | | | | | on main-thread w/o blocking; NEWT/WindowImpl: Volatile multithreaded mutable values Similar to commits: 28c6472335b924080d638b33a28f8f4eedb459b1 f354fb204d8973453c538dda78a2c82c87be61dc main-thread operations cannot block main-thread. Luckily we are able to create the NSWindow and NSView instance uninitialized (deferred) on the current thread, while issuing their initialization on the main-thread w/o blocking. Further more a size glitch is fixed, which didn't take the title bar into account. +++ NEWT/WindowImpl: Volatile multithreaded mutable values Since position, size and other attributes might get changes off-thread, these fields needs to be volatile.
* Bug 665: Allow re-association of GLContext/GLEventListener to a GLDrawable ↵Sven Gothel2013-03-131-17/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Part 4) Note: - GLEventListenerState preservs the GLAutoDrawable state, i.e. GLContext, all GLEventListener and the GLAnimatorControl association. - GLEventListenerState may be utilized to move the state from a dying GLAutoDrawable, to be moved to a new created GLAutoDrawable at a later time. - GLEventListenerState will be made public soon. +++ Exessive unit tests cover the new feature, tested manually on GNU/Linux/X11 and OSX(Java6/Java7). +++ - GLAutoDrawable - Change 'setContext(..)' to allow the destruction of the unbound old context: 'setContext(GLContext newCtx)' -> 'setContext(GLContext newCtx, boolean destroyPrevCtx)' - Implementations: Properly implement 'setRealized(..)' incl. obeying threading constraints if exists. Method is being utilized at least for GLEventListenerState.moveTo(..) to unrealize and realize the drawable resources. +++ Fix propagation of GLContext/GLDrawable association change (Bottom -> Top): GLDrawableImpl.associateContext GLContextImpl.associateDrawable GLContextImpl.makeCurrent GLContextImpl.destroy GLContext.setGLDrawable ... GLDrawableHelper.switchContext GLAutoDrawble.setContext associateDrawable(..)/associateContext(..) unifies and hence: - GLContextImpl.contextRealized() (removed) - GLDrawableImpl.contextRealized() (removed) - GLDrawableImpl.associateContext(..) (merged) - MacOSXCGLContext.drawableChangedNotify(..) (removed) +++ - EGLUpstreamSurfaceHook.evalUpstreamSurface() validates the surface's device for reusage, which is valid in case of GLEventListenerState.moveTo(..) - MacOSXCGLContext.NSOpenGLImpl: pixelFormat replaces NSOpenGLLayerPfmt and has simplified lifecycle [create..destroy], while native NSOpenGLLayer code only holds the reference until released.
* Fix Mix2TexturesES2 unit tests: Use synchronized texID access and add ↵Sven Gothel2013-03-091-3/+23
| | | | | | glFinish() after demo -> FBO rendering on or off thread. Fixes shared GLContext OSX rendering.
* TestBug572AWT: Add test case w/ setting GLCanvas's size and frame.pack() on ↵Sven Gothel2013-02-281-2/+2
| | | | AWT-EDT and current thread.
* Fix NEWT/AWT WindowClosing Unit Tests ; Review/Cleanup NEWT WindowClosing ↵Sven Gothel2013-02-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mechanism Due to a NEWT WindowClosing event regression cause by NewtCanvasAWT changes a review of our WindowClosing event mechanism was required. Important cleanups are marked w/ '(*)' below. I would have preferred to change the 'WindowListener.windowDestroyNotify(WindowEvent)' method to pass a WindowCloseEvent object exposing more information like toolkit or programmatic destruction and passing whether a 'closing' or 'nop' action will be performed based on the WindowClosingMode. For now I postponed this idea .. since it would change the API again, but may reconsider it after merging the Android 'closing' patch. - InputEvent.consumedTag -> NEWTEvent.consumedTag - Window - (*) Promote setWindowDestroyNotifyAction(Runnable) to public, former WindowImpl.setHandleDestroyNotify(boolean). Using a Runnable action for WindowImpl.windowDestroyNotify(boolean) allows a setting defined alternative for destroy() and gets rid of [ab]using WindowListener.windowDestroyNotify(WindowEvent) for lifecycle actions. Used in: - GLWindow - GLAutoDrawableDelegate impl. - WindowImpl - Respect NEWTEvent.consumedTag for WindowEvents as well - (*) Impl. setHandleDestroyNotify(boolean) (see above) - (*) destroy() simply sends out pre- and post- destruction Window events, where windowDestroyNotify(boolean) sends out the pre-destruction event if NOP. - (*) windowDestroyNotify(boolean) is public now, allowing other impl. details to follow proper destruction using handleDestroyNotify Runnable (-> NewtCanvasAWT). - AWTWindowClosingProtocol: - addClosingListenerOneShot() -> addClosingListener() - calling addClosingListener() at addNotify() - calling removeClosingListener() at removeNotify() - AWTWindowClosingProtocol ctor taking NOP runnable, allowing to send WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY at WindowClosingMode.DO_NOTHING_ON_CLOSE - add/remove listener on AWT-EDT - AWTWindowAdapter - Add 'removeWindowClosingFrom(..)', allowing to remove window closing event fwd. - Also fwd windowClosed in window closing fwd'ing. - NewtCanvasAWT - (*) Utilize AWTWindowClosingProtocol NOP runnable (see above) to fwd closing-NOP event to NEWT - (*) Unify remove/destroy code in destroyImpl(..) - !removeNotify -> destroy NEWT child programatic or as toolkit event - removeNotify || windowClosing -> destroy jawtWindow - (*) Remove AWTWindowAdapter/AWTParentWindowAdapter's windowClosingListener, since we utilize AWTWindowClosingProtocol - DisplayImpl - Adding 'final void dispatchMessage(final NEWTEvent event)' allowing to remove the NEWTEventTask wrapping for no reason in enqueueEvent(..) if on EDT and waiting.
* Fix CALayer pos/size and animation.b01Sven Gothel2013-02-221-10/+11
| | | | | | | | | | | | | | | - Fix CALayer animation: - All CALayer animations are set to nil via overriding 'actionForKey' - Fix CALayer pos/size bug: - Fix root and sub CALayer position to 0/0 and size on the main-thread w/o blocking. - If the sub CALayer implements the Objective-C NativeWindow protocol NWDedicatedSize (e.g. JOGL's MyNSOpenGLLayer), the dedicated size is passed to the layer, which propagates it appropriately. - On OSX/Java7 our root CALayer's frame position and size gets corrupted by its NSView, hence we have created the NWDedicatedSize protocol.
* OSX/Java7/CALayer + JAWT: Partially Fix AWT/NEWT CALayer 'out of sight' bug, ↵Sven Gothel2013-02-201-33/+40
| | | | | | | | | | | | | | | | | | | | | | | | | where our CALayer is moved out of the visible area - same erroneous behavior for GLCanvas and NewtCanvasAWT - sized-frame: Set framesize and validate() it - sized-component: Set component preferred size and call frame.pack() - added workaround 'OffscreenLayerSurface.layoutSurfaceLayer()' to fix CALayer size, which snaps for: - OK initial size before setVisible: sized-frame and sized-component - OK resize w/ sized-frame - OK manual frame resize - Invisible: w/ sized-component after setVisible() ++ - CALayer-Sublayer (GL) has additional retain/release when added/removed to be on safe side.
* Bug 678 (fix), Bug 641 (API + Windows Impl.), Bug 688 (prep): Update NEWT's ↵Sven Gothel2013-02-194-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KeyEvent handling while distinguish keyCode (kbd layout independent) and keySym (kbd layout dependent) API Changes: - Virtual key codes and symbols are of type short. - KeyEvent.keySymbol() shall return a layout dependent value (Bug 641) - Method returns former keyCode() value, which was layout dependent. - Returns 'short' value - KeyEvent.keyCode() returns a short value, instead of int - KeyEvent.keyCode() shall return a layout independent value (Bug 641) - To ease implementation, we only 'require' the scan code to be mapped to a 'US Keyboard layout', which allows reusing layout dependent code while preserving the goal to have a fixed physical key association - Implementation status: - Windows OK - X11 TODO - OSX: 50/50 TODO - Using layout independent 'action keys' - Using layout dependent 'printable keys' - returning above semantics for both, keyCode and keySym - Android 50/50 TODO - Returning the layout independent keyCode - Mapping probably incomplete - KeyEvent.EVENT_KEY_TYPED and KeyListener.keyTyped(KeyEvent) (Bug 688) - Marked DEPRECATED - No more called for auto-repeat events - Synthesized in WindowImpl.consumeKeyEvent(..): No more injection by native- or java driver code - NEWTEvent.eventType: int -> short - field, as well as all method involving eventType changed to short. - NEWTEvent.isSystemEvent: REMOVED - Never used as well as never being implemented properly Internal Changes: - Simplified keyEvent driver code - Especially the Windows native driver's mapping code could be simplified using scanCode and MapVirtualKeyEx - NEWT Event Factories: hashMap -> switch/case Unit Tests: - - Added NewtCanvasAWT Offscreen Layer Tests important to test the AWT -> NEWT translation on OSX/CALayer: - TestNewtKeyCodeModifiersAWT - TestNewtKeyCodesAWT - TestNewtKeyEventAutoRepeatAWT - TestNewtKeyEventOrderAWT - TestNewtKeyPressReleaseUnmaskRepeatAWT
* Unit Tests: Add 'results-java7' to check-junit.sh (Completes commit ↵Sven Gothel2013-02-171-0/+1
| | | | fc9539d50c12f9def7a3babde7384e3d38f61721)
* Unit Tests: Use Property 'jvmJava.exe' ; Add target 'junit.run.local.java7' ↵Sven Gothel2013-02-171-0/+8
| | | | | | (if="jvmJava7.exe") See GlueGen commit 6b86764f2e195b4046000fd5a7fcf3331ca72d21
* OSX/Java7 Cleanup: Remove JavaNativeFoundation dependency; ↵Sven Gothel2013-02-176-2/+63
| | | | NativeWindow-JAWT: Remove c.fixup.jawt.version.macosx (redundant, libjawt.dylib is rpath'ed always)
* NEWT/OSX: Fix Memory Leak ; Fix Occasional Crash Duer to Lifecycle Ops not ↵Sven Gothel2013-02-173-6/+5
| | | | | | | | | | | | | | | | on Main-Thread. - Fix Memory Leak - NewtWindow::dealloc -> [NewtView release]: Fixes NewtView leak - NewtView::dealloc -> removeTrackingRect: Removes occasional crash (double free of TrackingRect) - Fix Occasional Crash Duer to Lifecycle Ops not on Main-Thread. Perform OSX WindowDriver ops on Main-Thread: - close0 - changeContentView0 - createWindow0 - Cleaned up AddRemove unit tests, added TestAddRemove03GLWindowNEWT
* TestWindowClosingProtocol01AWT: More relaxed timing reducing false positivesSven Gothel2013-02-161-3/+2
|
* Fix Bug 644: AWT GLCanvas and GLJPanel ignored their visibility stateSven Gothel2013-02-161-2/+2
| | | | | If !visible, GLCanvas and GLJPanel's paint* and display method shall not render as the other GLAutoDrawable impl. do (GLWindow, SWT GLCanvas).
* Fix Bug 691 (part-3): NSOpenGLLayer::openGLContextForPixelFormat(..) on ↵Sven Gothel2013-02-161-2/+2
| | | | | | | | | | | | | | | | | | | | main-thread deadlock'ed due to locked shared context NSOpenGLLayer::openGLContextForPixelFormat(..) is performed on main-thread at 1st NSOpenGLLayer display method. This happened irregulary, i.e. sometimes (T0) right after NSOpenGLLayer creation and attachSurfaceLayer()/AddCASublayer(..), sometimes later (T1). NSOpenGLLayer::openGLContextForPixelFormat(..) uses the passed shared user context. The shared user context is locked at NSOpenGLLayer's creation (T0) and if performed at this early time the call deadlocks due to pthread_mutex wait for the shared user context. This fix performs NSOpenGLLayer creation and layer attachment while the shared user context is kept unlocked and enforces NSOpenGLLayer display and hence NSOpenGLLayer::openGLContextForPixelFormat(..). Added CGL.setNSOpenGLLayerEnabled(..) to enable/disable NSOpenGLLayer - currently not used. - Passed AddRemove tests for GLCanvas/Swing and GLWindow/NewtCanvasAWT w/ 100 loops on Java6 and Java7 on OSX. - Passed Instruments Leaks test w/ 10 loops on Java6 and Java7
* Refine unit test for Bug 691: Add onscreen/offscreen tests [if available] ; ↵Sven Gothel2013-02-151-3/+3
| | | | Move tests to 'acore'.
* Fix Bug 675: NPE w/ Beans.setDesignTime(true) ; Fix GLCanvas.destroy(): ↵Sven Gothel2013-02-151-5/+5
| | | | | | | | | | | | | | | Don't issue removeNotify(), delete drawable and context only! - Fix Bug 675: NPE w/ Beans.setDesignTime(true) - Carefully consider Beans.isDesginTime() fixes NPE - added unit test - Fix GLCanvas.destroy(): Don't issue removeNotify(), delete drawable and context only! - AWT removeNotify() shall only be issued via AWT itself, not manually - Add 'destroyImpl(boolean destroyJAWTWindowAndAWTDevice)' to be called by - GLCanvas.destroy(): destroyImpl( false ); - GLCanvas.removeNotify(): destroyImpl( true ); - Ensures JAWTWindow and AWTDevice are created and destroyed via the AWT callbacks addNotify() and removeNotify() only.
* Fix Bug 691 (part-2): Extra '[subLayer release]' is wrong, since ↵Sven Gothel2013-02-151-7/+4
| | | | | | | | | | | | | | | | | | | | 'CGL.releaseNSOpenGLLayer' triggers release - but very late w/ AWT usage. OSXUtil_RemoveCASublayer0's added '[subLayer release]' in commit f6e6fab2a7ddfb5c9b614cb072c27ff697629161 is wrong, since 'CGL.releaseNSOpenGLLayer' actually does trigger it's release. This was not seen w/ AWT tests, since it happens very later. A NewtCanvasAWT test disclosed this error -> removed that extra release call. The culprit for the late release w/ AWT usage was CGL.createNSOpenGLLayer's call in the current thread. Moving it to the Main-Thread fixed the problem. All CALayer lifecycle calls are issued on the Main-Thread now. NSOpenGLLayer's CVDisplayLink OpenGL fitting via 'CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext' is now performed at it's context creation in 'NSOpenGLLayer::openGLContextForPixelFormat'. The 'extra' release of the NSOpenGLLayer's NSOpenGLContext as introduced in commit f6e6fab2a7ddfb5c9b614cb072c27ff697629161 is still valid.
* Fix OSX CALayer Bug 690 and Bug 691: Occasional Freeze on CVDisplayLinkStop; ↵Sven Gothel2013-02-143-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Layers and native GL-Context are _not_ Released ; Java Side wait for Main-Thread - Fix Bug 690: Occasional Freeze on CVDisplayLinkStop - NSOpenGLLayer.disableAnimation() shall not claim the renderLock mutex, since the CVDisplayLink callback could be waiting for the lock. This waiting callback could freeze the call to CVDisplayLinkStop. - Fix Bug 691: Layers and native GL-Context are _not_ Released - Following proper release cycle: Context unrealized: - JAWTWindow.detachSurfaceLayer() -> OSXUtil.RemoveCASublayer(..) - CGL.releaseNSOpenGLLayer(..) JAWTWindow.destroy() - MacOSXJAWTWindow.UnsetJAWTRootSurfaceLayer(..) - OSXUtil.DestroyCALayer(..) - 'Magic' CALayer release calls (w/o manual retain beforehand) at: - OSXUtil.RemoveCASublayer(..): [subLayer release] - MacOSXJAWTWindow.UnsetJAWTRootSurfaceLayer(..): [rootLayer release] - OSXUtil.DestroyCALayer(..): [rootLayer release] - 'Magic' NSOpenGLLayer's NSOpenGLContext dealloc: - [NSOpenGLContext clearDrawable] - CGLDestroyContext( [NSOpenGLContext CGLContextObj] ) - Java Side wait for Main-Thread - Waiting for the delegated Main-Thread on the Java side eases debugging and won't block the Main-Thread in native code. - Utilizing this for all CALayer calls Test case: TestGLCanvasAddRemove01SwingAWT
* Fix Animator resume() wait-condition (drawablesEmpty didn't wait for ↵Sven Gothel2013-02-011-4/+11
| | | | pausedIssued); Update TestGLWindows02NEWTAnimated (isPaused())
* Bump Android NDK to android-ndk-r8dSven Gothel2013-01-312-16/+18
|
* Fix AWTKeyAdapter: Reorder AWT events to NEWT order - also ensuring TYPED is ↵Sven Gothel2013-01-303-4/+18
| | | | | | | always sent. This foremost fixes an issue w/ OSX/Java7 and NewtCanvasAWT offscreen CALayer usage, which utilizes AWTKeyAdapter and AWTNewtEventFactory (AWT -> NEWT) key events.
* Add OSX Java7 build/test scriptsSven Gothel2013-01-302-0/+38
|
* Fix Bug 678: Deliver key-char value for printable chars on all ↵Sven Gothel2013-01-293-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | KeyEventListener (-> On Windows as well) The following is observed, where t0 and t1 refer to subsequent different timestamps: NEWT delivery order: PRESSED (t0), RELEASED (t1) and TYPED (t1) WINDOWS delivery order: PRESSED (t0), TYPED (t0) and RELEASED (t1) Windows Auto-Repeat: PRESSED (t0), TYPED (t0) Hence we changed the event reorder-code in NEWT to trigger NEWT-PRESSED on Windows-TYPED for printable chars, assuring key-char values on all listener callbacks. - KeyEvent.getKeyChar(): Removed disclaimer dedicated for Windows - Keyevent.isActionKey(): Completed for all NEWT non-printable action keys; Added static variant - Keyevent.isPrintableKey(): NEW: returns !isModifierKey(keyCode) && !isActionKey(keyCode) ; With static variant - Windows WindowDriver: - EVENT_KEY_PRESSED handles non-printable chars only - EVENT_KEY_TYPE handles printable chars only - Native: VK_DELETE passes keyCode - Unit tests: Wait for completion 1s -> 2s
* Bug 665 (part 1) - Allow dis-association of GLContext's GLDrawable ..Sven Gothel2013-01-242-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes allowing re-association (incl. null) of GLContext/GLDrawable: - GLAutoDrawable: Refine API doc 'setContext(..)' - GLContext: Refine API doc: 'setGLDrawable(..)' 'getGLDrawable()' - GLContextImpl.setGLDrawable(): Handle null drawable - GLAutoDrawableDelegate/GLAutoDrawableBase: Allow null GLContext - GLDrawableHelper.switchContext(..)/recreateGLDrawable(): Balance GLContext.setGLDrawable(..) calls - New GLEventListenerState, holding state vector [GLEventListener, GLContext, .. ] impl. relocation of all components from/to GLAutoDrawable. - GLDrawableUtil - Using GLEventListenerState for swapGLContextAndAllGLEventListener(..) +++ NEWT Window*: - getDisplayHandle() is 'final', no more 'shortcut' code allowed due to re-association incl. display handle. - close*: - close config's device (was missing) - null config +++ Changes allowing reconfig of Display handle as required to re-associate pre-existing GLContext to a 'window': - AbstractGraphicsDevice: Add isHandleOwner() / clearHandleOwner() - Impl. in X11GraphicsDevice and EGLGraphicsDevice, NOP in DefaultGraphicsDevice - DefaultGraphicsConfiguration add 'setScreen(..)' - MutableGraphicsConfiguration - Make DefaultGraphicsConfiguration.setScreen(..) public - NativeWindowFactory add 'createScreen(String type, AbstractGraphicsDevice device, int screen)' - Refactored from SWTAccessor - NativeWindow x11ErrorHandler: Dump Stack Trace in DEBUG mode, always.
* TestSwingAWTRobotUsageBeforeJOGLInitBug411: Fix 'chicken egg' init problem ↵Sven Gothel2013-01-191-2/+2
| | | | | | w/ AWTRobot, i.e. NativeWindow not yet initialized. Regression since: 50f997557b91a2f014ef0c2ea848c5c326d0cfb2
* Adapt to change 5060b728b26a89a14367f8fca9f4eb7968f719ca: ↵Sven Gothel2013-01-191-2/+2
| | | | ShaderState.uniform(..) returns false if no location available.
* NEWT/Android: Full Lifecycle for WindowDriver; Using static ViewGroup; ↵Sven Gothel2013-01-193-37/+115
| | | | | | | | | | | | | | | | AWTRobotUtil: More tolerant for non AWT env.; Fix adb-launch-* - NEWT/Android WindowDriver - Full Lifecycle, remove refs on closeNative() - Respect isFullscreen() - Using static ViewGroup if available and surface not ready, allows running from main() - AWTRobotUtil: More tolerant for non AWT env. - Check for NEWT first - Only use AWT iff available, which allows running on Android - Fix adb-launch-* - Launch main/junit tests
* Fix Bug 669: Recursive GLContext makeCurrent()/release()Sven Gothel2013-01-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | Culprit: GLContext's makeCurrent() didn't clear the boolean flag 'unlockContextAndSurface' in case the context is already current (-> recursion). Above case was detected within a code block tailed by a finally block, which acted on mentioned flag, i.e. called lock.unlock() and hence decremented the lock count even though the method return w/ successful state. Fixed. Added debug code: GLContext.release() debug code (DEBUG | TRACE_SWITCH), recording stack trace of last release() call, which is dumped in case no current was current. Added 2 unit tests: - Simple recursive GLContext makeCurrent()/release() from within GLEventListener's display(). Test also validates lock count and lock ownership. - GLAutoDrawable display() of another GLAutoDrawable from within GLEventListener's display(..).
* ShaderState: Reduce hash-map utilization at shader switch (reset ↵Sven Gothel2013-01-151-3/+3
| | | | uniforms/attributes); Refine API doc.
* NEWT-MouseEvent getWheelRotation() API Update - Fixes Bug 659: NEWT ↵Sven Gothel2013-01-145-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Horizontal Scrolling Behavior (OSX, X11, Win32); Bug 639: High-Res Mouse-Wheel - API update 'float getWheelRotation()': Usually a wheel rotation of > 0.0f is up, and < 0.0f is down. Usually a wheel rotations is considered a vertical scroll. If isShiftDown(), a wheel rotations is considered a horizontal scroll, where shift-up = left = > 0.0f, and shift-down = right = < 0.0f. However, on some OS this might be flipped due to the OS default behavior. The latter is true for OS X 10.7 (Lion) for example. The events will be send usually in steps of one, ie. -1.0f and 1.0f. Higher values may result due to fast scrolling. Fractional values may result due to slow scrolling with high resolution devices. The button number refers to the wheel number. - Fix Bug 659: NEWT Horizontal Scrolling Behavior (OSX, X11, Win32) - See new API doc above - X11/Horiz: Keep using button1 and set SHIFT modifier - OSX/Horiz: - PAD: Use highes absolute scrolling value (Axis1/Axis2) and set SHIFT modifier for horizontal scrolling (Axis2) - XXX: Use deltaX for horizontal scrolling, detected by SHIFT modifier. (traditional) - Windows/Horiz: - Add WM_MOUSEHWHEEL support (-> set SHIFT modifier), but it's rarely impl. for trackpads! - Add exp. WM_HSCROLL, but it will only be delivered if windows has WS_HSCROLL, hence dead code! - Android: - Add ACTION_SCROLL (API Level 12), only used if layout is a scroll layout - Using GestureDetector to detect scroll even w/ pointerCount > 2, while: - skipping 1st scroll event (value too high) - skipping other events while in-scroll mode - waiting until all pointers were released before cont. normally - using View config's 1/touchSlope as scale factor - Fix Bug 639: High-Res Mouse-Wheel - getWheelRotation() return value changed: int -> float allowing fractions, see API doc changes above. - Fractions are currently supported natively (API) on - Windows - OSX - Android - AndroidNewtEventFactory ir refactored (requires an instance now) and AndroidNewtEventTranslator (event listener) is pulled our of Android WindowDriver.
* Move all Exclusive Context Thread (ECT) tests to it's own package to ↵Sven Gothel2013-01-122-13/+13
| | | | de-clutter core test package
* Adding GEOMETRY_SHADER support in ShaderCode, adding core ↵Sven Gothel2013-01-121-1/+3
| | | | | | | | | | | | | | | | | | | GL3/GEOMETRY_SHADER unit tests. ; Simplified GLContext version number - Adding GEOMETRY_SHADER support in ShaderCode, adding core GL3/GEOMETRY_SHADER unit tests Chuck Ritola reported in December 2012 that we lack support of GEOMETRY_SHADER and he provided a test case. The latter is cleaned up to use GL3 core profile features only tesing a pass-through and the flip-XYZ geometry shader. ShaderUtil is fixed. - Simplified GLContext version number The OpenGL major/minor version is now hold in a VersionNumber instance to simplify usage. Also expose it via getGLVersionNumber() while marking getGLVersionMajor() and getGLVersionMinor() deprecated.
* GLAutoDrawable/AnimatorBase: Add ExclusiveContextThread (ECT) feature; ↵Sven Gothel2013-01-112-22/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AnimatorBase: Add setModeBits/MODE_EXPECT_AWT_RENDERING_THREAD; FPSAnimator: Make transactions deterministic. ExclusiveContextThread (ECT) allows user to dedicate a GLContext to a given thread. Only the ECT will be allowed to claim the GLContext, hence releasing must be done on the ECT itself. The core feature is accessible via GLAutoDrawable, while it can be conveniently enabled and disabled via an AnimatorBase implementation. The latter ensures it's being released on the ECT and waits for the result. Note that ECT cannot be guaranteed to work correctly w/ native (heavyweight) AWT components due to resource locking and AWT-EDT access. This is disabled in all new tests per default and noted on the API doc. Note: 'Animator transaction' == start(), stop(), pause(), resume(). - Add ExclusiveContextThread (ECT) feature - GLAutoDrawable NEW: - Thread setExclusiveContextThread(Thread t) - Thread getExclusiveContextThread() - AnimatorBase NEW: - Thread setExclusiveContext(Thread t) - boolean setExclusiveContext(boolean enable) - boolean isExclusiveContextEnabled() - Thread getExclusiveContextThread() - AnimatorBase: Add setModeBits/MODE_EXPECT_AWT_RENDERING_THREAD Allows user to pre-determine whether AWT rendering is expected before starting the animator. If AWT is excluded, a more simple and transaction correct impl. will be used. - FPSAnimator: Make transactions deterministic. FPSAnimator previously did not ensure whether a transaction was completed. A deterministic transaction is required to utilize ECT. FPSAnimator now uses same mechanism like Animator to ensure completeness, i.e. Condition and 'finishLifecycleAction(..)'. Both are moved to AnimatorBase. Tested manually on Linux/NV, Linux/AMD, Windows/NV and OSX/NV. - All new tests validated correctness. - All new tests shows an performance increase of ~3x w/ single GLWindow, where multiple GLWindows don't show a perf. increase.
* Update PNGJ 0.85 -> 1.12 (w/ interlace read support) ; Added PNG Interlace ↵Sven Gothel2012-12-311-2/+2
| | | | read tests (TestPNGTextureFromFileNEWT)
* Enhance PMVMatrix: Use FloatStack to implement PushMatrix and PopMatrix (Bug ↵Sven Gothel2012-12-311-3/+3
| | | | | | | | | | | | | 657) One FloatStack for each, MV, P and T, with initialialSize zero to save memore and growSizes: MV = 16 arrays, P = 2 arrays, T = 2 arrays, with array = 16 floats. This shall save performance due to the preallocated stack when used and growing only in the above mentioned grow intervals. We may finetune the growSize, if required.
* Bug632: Test NEWT Child Window Translucency (X11/Windows) ..Sven Gothel2012-12-303-27/+35
| | | | | | | | | | | | | - Windows: Child window is not translucent at all - X11: Child window is translucent to parent's background, however - parents content is _not_ 'composed in'. - TODO: Find whether there is a solution or not. - Note: The child window does not change it's rel. position if parent moves! This is a feature, since we don't have impl. a layout.
* Cleanup / Simplify: setGLFunctionAvailability(..) / ↵Sven Gothel2012-12-301-1/+1
| | | | | | | | | | createContextARBVersions(..) GL Version Validation String or integer based GL version validation now happens in setGLFunctionAvailability(..) depending on the requested profile. Due to the 'strictMatch' argument the method fails early when unsatisfied also allowing to simplify createContextARBVersions(..) implementation.
* Fix Bug 658 (Mesa 9.0 3.1 Intel compat quirk, 3.1 core only) ; No ↵Sven Gothel2012-12-291-2/+4
| | | | | | | | | | | | | | | | | | | PROFILE_ALIASING compat -> core ; Fix setGLFunctionAvailability(..) failure path @ profile query - Add GLRendererQuirks.GLNonCompliant, marking a GL context/profile non compliant. Currently: 'Mesa DRI Intel(R) Sandybridge Desktop' && 3.1 compat profile - Fix Bug 658 (Mesa 9.0 3.1 Intel compat quirk, 3.1 core only) Detect case using new GLRendererQuirks.GLNonCompliant in setGLFunctionAvailability() and return 'false'. - No PROFILE_ALIASING compat -> core Use true core GL profiles / context if available to ensure proper API behavior across platforms due to different functionality. E.g. don't use GL3bc if GL3 is requested. - Fix setGLFunctionAvailability(..) failure path @ profile query Destroy temp context & zero result to cont. iterating through GL versions. This missing cleanup lead to returning the faulty GL context handle and it's mapping/usage.
alue_offset) { validateGLUtessellatorImpl(); GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator; tess.gluGetTessProperty(which, value, value_offset); } /***************************************************************************** * <b>gluTessNormal</b> describes a normal for a polygon that the program is * defining. All input data will be projected onto a plane perpendicular to * the one of the three coordinate axes before tessellation and all output * triangles will be oriented CCW with repsect to the normal (CW orientation * can be obtained by reversing the sign of the supplied normal). For * example, if you know that all polygons lie in the x-y plane, call * <b>gluTessNormal</b>(tess, 0.0, 0.0, 0.0) before rendering any polygons.<P> * * If the supplied normal is (0.0, 0.0, 0.0)(the initial value), the normal * is determined as follows. The direction of the normal, up to its sign, is * found by fitting a plane to the vertices, without regard to how the * vertices are connected. It is expected that the input data lies * approximately in the plane; otherwise, projection perpendicular to one of * the three coordinate axes may substantially change the geometry. The sign * of the normal is chosen so that the sum of the signed areas of all input * contours is nonnegative (where a CCW contour has positive area).<P> * * The supplied normal persists until it is changed by another call to * <b>gluTessNormal</b>. * * Optional, throws GLException if not available in profile * * @param tessellator * Specifies the tessellation object (created by * {@link #gluNewTess gluNewTess}). * @param x * Specifies the first component of the normal. * @param y * Specifies the second component of the normal. * @param z * Specifies the third component of the normal. * * @see #gluTessBeginPolygon gluTessBeginPolygon * @see #gluTessEndPolygon gluTessEndPolygon ****************************************************************************/ public static final void gluTessNormal(GLUtessellator tessellator, double x, double y, double z) { validateGLUtessellatorImpl(); GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator; tess.gluTessNormal(x, y, z); } /***************************************************************************** * <b>gluTessCallback</b> is used to indicate a callback to be used by a * tessellation object. If the specified callback is already defined, then it * is replaced. If <i>aCallback</i> is null, then the existing callback * becomes undefined.<P> * * Optional, throws GLException if not available in profile * * These callbacks are used by the tessellation object to describe how a * polygon specified by the user is broken into triangles. Note that there are * two versions of each callback: one with user-specified polygon data and one * without. If both versions of a particular callback are specified, then the * callback with user-specified polygon data will be used. Note that the * polygonData parameter used by some of the methods is a copy of the * reference that was specified when * {@link #gluTessBeginPolygon gluTessBeginPolygon} * was called. The legal callbacks are as follows:<P> * * <b>GLU_TESS_BEGIN</b> * <UL> * The begin callback is invoked like {@link javax.media.opengl.GL#glBegin * glBegin} to indicate the start of a (triangle) primitive. The method * takes a single argument of type int. If the * <b>GLU_TESS_BOUNDARY_ONLY</b> property is set to <b>GL_FALSE</b>, then * the argument is set to either <b>GL_TRIANGLE_FAN</b>, * <b>GL_TRIANGLE_STRIP</b>, or <b>GL_TRIANGLES</b>. If the * <b>GLU_TESS_BOUNDARY_ONLY</b> property is set to <b>GL_TRUE</b>, then the * argument will be set to <b>GL_LINE_LOOP</b>. The method prototype for * this callback is: * </UL> * * <PRE> * void begin(int type);</PRE><P> * * <b>GLU_TESS_BEGIN_DATA</b> * <UL> * The same as the <b>GLU_TESS_BEGIN</b> callback except * that it takes an additional reference argument. This reference is * identical to the opaque reference provided when * {@link #gluTessBeginPolygon gluTessBeginPolygon} * was called. The method prototype for this callback is: * </UL> * * <PRE> * void beginData(int type, Object polygonData);</PRE> * * <b>GLU_TESS_EDGE_FLAG</b> * <UL> * The edge flag callback is similar to * {@link javax.media.opengl.GL#glEdgeFlag glEdgeFlag}. The method takes * a single boolean boundaryEdge that indicates which edges lie on the * polygon boundary. If the boundaryEdge is <b>GL_TRUE</b>, then each vertex * that follows begins an edge that lies on the polygon boundary, that is, * an edge that separates an interior region from an exterior one. If the * boundaryEdge is <b>GL_FALSE</b>, then each vertex that follows begins an * edge that lies in the polygon interior. The edge flag callback (if * defined) is invoked before the first vertex callback.<P> * * Since triangle fans and triangle strips do not support edge flags, the * begin callback is not called with <b>GL_TRIANGLE_FAN</b> or * <b>GL_TRIANGLE_STRIP</b> if a non-null edge flag callback is provided. * (If the callback is initialized to null, there is no impact on * performance). Instead, the fans and strips are converted to independent * triangles. The method prototype for this callback is: * </UL> * * <PRE> * void edgeFlag(boolean boundaryEdge);</PRE> * * <b>GLU_TESS_EDGE_FLAG_DATA</b> * <UL> * The same as the <b>GLU_TESS_EDGE_FLAG</b> callback except that it takes * an additional reference argument. This reference is identical to the * opaque reference provided when * {@link #gluTessBeginPolygon gluTessBeginPolygon} * was called. The method prototype for this callback is: * </UL> * * <PRE> * void edgeFlagData(boolean boundaryEdge, Object polygonData);</PRE> * * <b>GLU_TESS_VERTEX</b> * <UL> * The vertex callback is invoked between the begin and end callbacks. It is * similar to {@link javax.media.opengl.GL#glVertex3f glVertex3f}, and it * defines the vertices of the triangles created by the tessellation * process. The method takes a reference as its only argument. This * reference is identical to the opaque reference provided by the user when * the vertex was described (see * {@link #gluTessVertex gluTessVertex}). The method * prototype for this callback is: * </UL> * * <PRE> * void vertex(Object vertexData);</PRE> * * <b>GLU_TESS_VERTEX_DATA</b> * <UL> * The same as the <b>GLU_TESS_VERTEX</b> callback except that it takes an * additional reference argument. This reference is identical to the opaque * reference provided when * {@link #gluTessBeginPolygon gluTessBeginPolygon} * was called. The method prototype for this callback is: * </UL> * * <PRE> * void vertexData(Object vertexData, Object polygonData);</PRE> * * <b>GLU_TESS_END</b> * <UL> * The end callback serves the same purpose as * {@link javax.media.opengl.GL#glEnd glEnd}. It indicates the end of a * primitive and it takes no arguments. The method prototype for this * callback is: * </UL> * * <PRE> * void end();</PRE> * * <b>GLU_TESS_END_DATA</b> * <UL> * The same as the <b>GLU_TESS_END</b> callback except that it takes an * additional reference argument. This reference is identical to the opaque * reference provided when * {@link #gluTessBeginPolygon gluTessBeginPolygon} * was called. The method prototype for this callback is: * </UL> * * <PRE> * void endData(Object polygonData);</PRE> * * <b>GLU_TESS_COMBINE</b> * <UL> * The combine callback is called to create a new vertex when the * tessellation detects an intersection, or wishes to merge features. The * method takes four arguments: an array of three elements each of type * double, an array of four references, an array of four elements each of * type float, and a reference to a reference. The prototype is: * </UL> * * <PRE> * void combine(double[] coords, Object[] data, * float[] weight, Object[] outData);</PRE> * * <UL> * The vertex is defined as a linear combination of up to four existing * vertices, stored in <i>data</i>. The coefficients of the linear * combination are given by <i>weight</i>; these weights always add up to 1. * All vertex pointers are valid even when some of the weights are 0. * <i>coords</i> gives the location of the new vertex.<P> * * The user must allocate another vertex, interpolate parameters using * <i>data</i> and <i>weight</i>, and return the new vertex pointer * in <i>outData</i>. This handle is supplied during rendering callbacks. * The user is responsible for freeing the memory some time after * {@link #gluTessEndPolygon gluTessEndPolygon} is * called.<P> * * For example, if the polygon lies in an arbitrary plane in 3-space, and a * color is associated with each vertex, the <b>GLU_TESS_COMBINE</b> * callback might look like this: * </UL> * <PRE> * void myCombine(double[] coords, Object[] data, * float[] weight, Object[] outData) * { * MyVertex newVertex = new MyVertex(); * * newVertex.x = coords[0]; * newVertex.y = coords[1]; * newVertex.z = coords[2]; * newVertex.r = weight[0]*data[0].r + * weight[1]*data[1].r + * weight[2]*data[2].r + * weight[3]*data[3].r; * newVertex.g = weight[0]*data[0].g + * weight[1]*data[1].g + * weight[2]*data[2].g + * weight[3]*data[3].g; * newVertex.b = weight[0]*data[0].b + * weight[1]*data[1].b + * weight[2]*data[2].b + * weight[3]*data[3].b; * newVertex.a = weight[0]*data[0].a + * weight[1]*data[1].a + * weight[2]*data[2].a + * weight[3]*data[3].a; * outData = newVertex; * }</PRE> * * <UL> * If the tessellation detects an intersection, then the * <b>GLU_TESS_COMBINE</b> or <b>GLU_TESS_COMBINE_DATA</b> callback (see * below) must be defined, and it must write a non-null reference into * <i>outData</i>. Otherwise the <b>GLU_TESS_NEED_COMBINE_CALLBACK</b> error * occurs, and no output is generated. * </UL> * * <b>GLU_TESS_COMBINE_DATA</b> * <UL> * The same as the <b>GLU_TESS_COMBINE</b> callback except that it takes an * additional reference argument. This reference is identical to the opaque * reference provided when * {@link #gluTessBeginPolygon gluTessBeginPolygon} * was called. The method prototype for this callback is: * </UL> * * <PRE> * void combineData(double[] coords, Object[] data, float[] weight, Object[] outData, Object polygonData);</PRE> * * <b>GLU_TESS_ERROR</b> * <UL> * The error callback is called when an error is encountered. The one * argument is of type int; it indicates the specific error that occurred * and will be set to one of <b>GLU_TESS_MISSING_BEGIN_POLYGON</b>, * <b>GLU_TESS_MISSING_END_POLYGON</b>, * <b>GLU_TESS_MISSING_BEGIN_CONTOUR</b>, * <b>GLU_TESS_MISSING_END_CONTOUR</b>, <b>GLU_TESS_COORD_TOO_LARGE</b>, * <b>GLU_TESS_NEED_COMBINE_CALLBACK</b> or <b>GLU_OUT_OF_MEMORY</b>. * Character strings describing these errors can be retrieved with the * {@link #gluErrorString gluErrorString} call. The * method prototype for this callback is: * </UL> * * <PRE> * void error(int errnum);</PRE> * * <UL> * The GLU library will recover from the first four errors by inserting the * missing call(s). <b>GLU_TESS_COORD_TOO_LARGE</b> indicates that some * vertex coordinate exceeded the predefined constant * <b>GLU_TESS_MAX_COORD</b> in absolute value, and that the value has been * clamped. (Coordinate values must be small enough so that two can be * multiplied together without overflow.) * <b>GLU_TESS_NEED_COMBINE_CALLBACK</b> indicates that the tessellation * detected an intersection between two edges in the input data, and the * <b>GLU_TESS_COMBINE</b> or <b>GLU_TESS_COMBINE_DATA</b> callback was not * provided. No output is generated. <b>GLU_OUT_OF_MEMORY</b> indicates that * there is not enough memory so no output is generated. * </UL> * * <b>GLU_TESS_ERROR_DATA</b> * <UL> * The same as the GLU_TESS_ERROR callback except that it takes an * additional reference argument. This reference is identical to the opaque * reference provided when * {@link #gluTessBeginPolygon gluTessBeginPolygon} * was called. The method prototype for this callback is: * </UL> * * <PRE> * void errorData(int errnum, Object polygonData);</PRE> * * @param tessellator * Specifies the tessellation object (created with * {@link #gluNewTess gluNewTess}). * @param which * Specifies the callback being defined. The following values are * valid: <b>GLU_TESS_BEGIN</b>, <b>GLU_TESS_BEGIN_DATA</b>, * <b>GLU_TESS_EDGE_FLAG</b>, <b>GLU_TESS_EDGE_FLAG_DATA</b>, * <b>GLU_TESS_VERTEX</b>, <b>GLU_TESS_VERTEX_DATA</b>, * <b>GLU_TESS_END</b>, <b>GLU_TESS_END_DATA</b>, * <b>GLU_TESS_COMBINE</b>, <b>GLU_TESS_COMBINE_DATA</b>, * <b>GLU_TESS_ERROR</b>, and <b>GLU_TESS_ERROR_DATA</b>. * @param aCallback * Specifies the callback object to be called. * * @see javax.media.opengl.GL#glBegin glBegin * @see javax.media.opengl.GL#glEdgeFlag glEdgeFlag * @see javax.media.opengl.GL#glVertex3f glVertex3f * @see #gluNewTess gluNewTess * @see #gluErrorString gluErrorString * @see #gluTessVertex gluTessVertex * @see #gluTessBeginPolygon gluTessBeginPolygon * @see #gluTessBeginContour gluTessBeginContour * @see #gluTessProperty gluTessProperty * @see #gluTessNormal gluTessNormal ****************************************************************************/ public static final void gluTessCallback(GLUtessellator tessellator, int which, GLUtessellatorCallback aCallback) { validateGLUtessellatorImpl(); GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator; tess.gluTessCallback(which, aCallback); } /***************************************************************************** * <b>gluTessVertex</b> describes a vertex on a polygon that the program * defines. Successive <b>gluTessVertex</b> calls describe a closed contour. * For example, to describe a quadrilateral <b>gluTessVertex</b> should be * called four times. <b>gluTessVertex</b> can only be called between * {@link #gluTessBeginContour gluTessBeginContour} and * {@link #gluTessBeginContour gluTessEndContour}.<P> * * Optional, throws GLException if not available in profile * * <b>data</b> normally references to a structure containing the vertex * location, as well as other per-vertex attributes such as color and normal. * This reference is passed back to the user through the * <b>GLU_TESS_VERTEX</b> or <b>GLU_TESS_VERTEX_DATA</b> callback after * tessellation (see the {@link #gluTessCallback * gluTessCallback} reference page). * * @param tessellator * Specifies the tessellation object (created with * {@link #gluNewTess gluNewTess}). * @param coords * Specifies the coordinates of the vertex. * @param data * Specifies an opaque reference passed back to the program with the * vertex callback (as specified by * {@link #gluTessCallback gluTessCallback}). * * @see #gluTessBeginPolygon gluTessBeginPolygon * @see #gluNewTess gluNewTess * @see #gluTessBeginContour gluTessBeginContour * @see #gluTessCallback gluTessCallback * @see #gluTessProperty gluTessProperty * @see #gluTessNormal gluTessNormal * @see #gluTessEndPolygon gluTessEndPolygon ****************************************************************************/ public static final void gluTessVertex(GLUtessellator tessellator, double[] coords, int coords_offset, Object data) { validateGLUtessellatorImpl(); GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator; tess.gluTessVertex(coords, coords_offset, data); } /***************************************************************************** * <b>gluTessBeginPolygon</b> and * {@link #gluTessEndPolygon gluTessEndPolygon} delimit * the definition of a convex, concave or self-intersecting polygon. Within * each <b>gluTessBeginPolygon</b>/ * {@link #gluTessEndPolygon gluTessEndPolygon} pair, * there must be one or more calls to * {@link #gluTessBeginContour gluTessBeginContour}/ * {@link #gluTessEndContour gluTessEndContour}. Within * each contour, there are zero or more calls to * {@link #gluTessVertex gluTessVertex}. The vertices * specify a closed contour (the last vertex of each contour is automatically * linked to the first). See the {@link #gluTessVertex * gluTessVertex}, {@link #gluTessBeginContour * gluTessBeginContour}, and {@link #gluTessEndContour * gluTessEndContour} reference pages for more details.<P> * * Optional, throws GLException if not available in profile * * <b>data</b> is a reference to a user-defined data structure. If the * appropriate callback(s) are specified (see * {@link #gluTessCallback gluTessCallback}), then this * reference is returned to the callback method(s). Thus, it is a convenient * way to store per-polygon information.<P> * * Once {@link #gluTessEndPolygon gluTessEndPolygon} is * called, the polygon is tessellated, and the resulting triangles are * described through callbacks. See * {@link #gluTessCallback gluTessCallback} for * descriptions of the callback methods. * * @param tessellator * Specifies the tessellation object (created with * {@link #gluNewTess gluNewTess}). * @param data * Specifies a reference to user polygon data. * * @see #gluNewTess gluNewTess * @see #gluTessBeginContour gluTessBeginContour * @see #gluTessVertex gluTessVertex * @see #gluTessCallback gluTessCallback * @see #gluTessProperty gluTessProperty * @see #gluTessNormal gluTessNormal * @see #gluTessEndPolygon gluTessEndPolygon ****************************************************************************/ public static final void gluTessBeginPolygon(GLUtessellator tessellator, Object data) { validateGLUtessellatorImpl(); GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator; tess.gluTessBeginPolygon(data); } /***************************************************************************** * <b>gluTessBeginContour</b> and * {@link #gluTessEndContour gluTessEndContour} delimit * the definition of a polygon contour. Within each * <b>gluTessBeginContour</b>/ * {@link #gluTessEndContour gluTessEndContour} pair, * there can be zero or more calls to * {@link #gluTessVertex gluTessVertex}. The vertices * specify a closed contour (the last vertex of each contour is automatically * linked to the first). See the {@link #gluTessVertex * gluTessVertex} reference page for more details. <b>gluTessBeginContour</b> * can only be called between * {@link #gluTessBeginPolygon gluTessBeginPolygon} and * {@link #gluTessEndPolygon gluTessEndPolygon}. * * Optional, throws GLException if not available in profile * * @param tessellator * Specifies the tessellation object (created with * {@link #gluNewTess gluNewTess}). * * @see #gluNewTess gluNewTess * @see #gluTessBeginPolygon gluTessBeginPolygon * @see #gluTessVertex gluTessVertex * @see #gluTessCallback gluTessCallback * @see #gluTessProperty gluTessProperty * @see #gluTessNormal gluTessNormal * @see #gluTessEndPolygon gluTessEndPolygon ****************************************************************************/ public static final void gluTessBeginContour(GLUtessellator tessellator) { validateGLUtessellatorImpl(); GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator; tess.gluTessBeginContour(); } /***************************************************************************** * <b>gluTessEndContour</b> and * {@link #gluTessBeginContour gluTessBeginContour} * delimit the definition of a polygon contour. Within each * {@link #gluTessBeginContour gluTessBeginContour}/ * <b>gluTessEndContour</b> pair, there can be zero or more calls to * {@link #gluTessVertex gluTessVertex}. The vertices * specify a closed contour (the last vertex of each contour is automatically * linked to the first). See the {@link #gluTessVertex * gluTessVertex} reference page for more details. * {@link #gluTessBeginContour gluTessBeginContour} can * only be called between {@link #gluTessBeginPolygon * gluTessBeginPolygon} and * {@link #gluTessEndPolygon gluTessEndPolygon}. * * Optional, throws GLException if not available in profile * * @param tessellator * Specifies the tessellation object (created with * {@link #gluNewTess gluNewTess}). * * @see #gluNewTess gluNewTess * @see #gluTessBeginPolygon gluTessBeginPolygon * @see #gluTessVertex gluTessVertex * @see #gluTessCallback gluTessCallback * @see #gluTessProperty gluTessProperty * @see #gluTessNormal gluTessNormal * @see #gluTessEndPolygon gluTessEndPolygon ****************************************************************************/ public static final void gluTessEndContour(GLUtessellator tessellator) { validateGLUtessellatorImpl(); GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator; tess.gluTessEndContour(); } /***************************************************************************** * <b>gluTessEndPolygon</b> and * {@link #gluTessBeginPolygon gluTessBeginPolygon} * delimit the definition of a convex, concave or self-intersecting polygon. * Within each {@link #gluTessBeginPolygon * gluTessBeginPolygon}/<b>gluTessEndPolygon</b> pair, there must be one or * more calls to {@link #gluTessBeginContour * gluTessBeginContour}/{@link #gluTessEndContour * gluTessEndContour}. Within each contour, there are zero or more calls to * {@link #gluTessVertex gluTessVertex}. The vertices * specify a closed contour (the last vertex of each contour is automatically * linked to the first). See the {@link #gluTessVertex * gluTessVertex}, {@link #gluTessBeginContour * gluTessBeginContour} and {@link #gluTessEndContour * gluTessEndContour} reference pages for more details.<P> * * Optional, throws GLException if not available in profile * * Once <b>gluTessEndPolygon</b> is called, the polygon is tessellated, and * the resulting triangles are described through callbacks. See * {@link #gluTessCallback gluTessCallback} for * descriptions of the callback functions. * * @param tessellator * Specifies the tessellation object (created with * {@link #gluNewTess gluNewTess}). * * @see #gluNewTess gluNewTess * @see #gluTessBeginContour gluTessBeginContour * @see #gluTessVertex gluTessVertex * @see #gluTessCallback gluTessCallback * @see #gluTessProperty gluTessProperty * @see #gluTessNormal gluTessNormal * @see #gluTessBeginPolygon gluTessBeginPolygon ****************************************************************************/ public static final void gluTessEndPolygon(GLUtessellator tessellator) { validateGLUtessellatorImpl(); GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator; tess.gluTessEndPolygon(); } /***************************************************************************** * <b>gluBeginPolygon</b> and {@link #gluEndPolygon gluEndPolygon} * delimit the definition of a nonconvex polygon. To define such a * polygon, first call <b>gluBeginPolygon</b>. Then define the * contours of the polygon by calling {@link #gluTessVertex * gluTessVertex} for each vertex and {@link #gluNextContour * gluNextContour} to start each new contour. Finally, call {@link * #gluEndPolygon gluEndPolygon} to signal the end of the * definition. See the {@link #gluTessVertex gluTessVertex} and {@link * #gluNextContour gluNextContour} reference pages for more * details.<P> * * Optional, throws GLException if not available in profile * * Once {@link #gluEndPolygon gluEndPolygon} is called, * the polygon is tessellated, and the resulting triangles are described * through callbacks. See {@link #gluTessCallback * gluTessCallback} for descriptions of the callback methods. * * @param tessellator * Specifies the tessellation object (created with * {@link #gluNewTess gluNewTess}). * * @see #gluNewTess gluNewTess * @see #gluNextContour gluNextContour * @see #gluTessCallback gluTessCallback * @see #gluTessVertex gluTessVertex * @see #gluTessBeginPolygon gluTessBeginPolygon * @see #gluTessBeginContour gluTessBeginContour ****************************************************************************/ public static final void gluBeginPolygon(GLUtessellator tessellator) { validateGLUtessellatorImpl(); GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator; tess.gluBeginPolygon(); } /***************************************************************************** * <b>gluNextContour</b> is used to describe polygons with multiple * contours. After you describe the first contour through a series of * {@link #gluTessVertex gluTessVertex} calls, a * <b>gluNextContour</b> call indicates that the previous contour is complete * and that the next contour is about to begin. Perform another series of * {@link #gluTessVertex gluTessVertex} calls to * describe the new contour. Repeat this process until all contours have been * described.<P> * * Optional, throws GLException if not available in profile * * The type parameter defines what type of contour follows. The following * values are valid. <P> * * <b>GLU_EXTERIOR</b> * <UL> * An exterior contour defines an exterior boundary of the polygon. * </UL> * <b>GLU_INTERIOR</b> * <UL> * An interior contour defines an interior boundary of the polygon (such as * a hole). * </UL> * <b>GLU_UNKNOWN</b> * <UL> * An unknown contour is analyzed by the library to determine whether it is * interior or exterior. * </UL> * <b>GLU_CCW, GLU_CW</b> * <UL> * The first <b>GLU_CCW</b> or <b>GLU_CW</b> contour defined is considered * to be exterior. All other contours are considered to be exterior if they * are oriented in the same direction (clockwise or counterclockwise) as the * first contour, and interior if they are not. If one contour is of type * <b>GLU_CCW</b> or <b>GLU_CW</b>, then all contours must be of the same * type (if they are not, then all <b>GLU_CCW</b> and <b>GLU_CW</b> contours * will be changed to <b>GLU_UNKNOWN</b>). Note that there is no * real difference between the <b>GLU_CCW</b> and <b>GLU_CW</b> contour * types. * </UL><P> * * To define the type of the first contour, you can call <b>gluNextContour</b> * before describing the first contour. If you do not call * <b>gluNextContour</b> before the first contour, the first contour is marked * <b>GLU_EXTERIOR</b>.<P> * * <UL> * <b>Note:</b> The <b>gluNextContour</b> function is obsolete and is * provided for backward compatibility only. The <b>gluNextContour</b> * function is mapped to {@link #gluTessEndContour * gluTessEndContour} followed by * {@link #gluTessBeginContour gluTessBeginContour}. * </UL> * * @param tessellator * Specifies the tessellation object (created with * {@link #gluNewTess gluNewTess}). * @param type * The type of the contour being defined. * * @see #gluNewTess gluNewTess * @see #gluTessBeginContour gluTessBeginContour * @see #gluTessBeginPolygon gluTessBeginPolygon * @see #gluTessCallback gluTessCallback * @see #gluTessEndContour gluTessEndContour * @see #gluTessVertex gluTessVertex ****************************************************************************/ public static final void gluNextContour(GLUtessellator tessellator, int type) { validateGLUtessellatorImpl(); GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator; tess.gluNextContour(type); } /***************************************************************************** * <b>gluEndPolygon</b> and {@link #gluBeginPolygon * gluBeginPolygon} delimit the definition of a nonconvex polygon. To define * such a polygon, first call {@link #gluBeginPolygon * gluBeginPolygon}. Then define the contours of the polygon by calling * {@link #gluTessVertex gluTessVertex} for each vertex * and {@link #gluNextContour gluNextContour} to start * each new contour. Finally, call <b>gluEndPolygon</b> to signal the end of * the definition. See the {@link #gluTessVertex * gluTessVertex} and {@link #gluNextContour * gluNextContour} reference pages for more details.<P> * * Optional, throws GLException if not available in profile * * Once <b>gluEndPolygon</b> is called, the polygon is tessellated, and the * resulting triangles are described through callbacks. See * {@link #gluTessCallback gluTessCallback} for * descriptions of the callback methods. * * @param tessellator * Specifies the tessellation object (created with * {@link #gluNewTess gluNewTess}). * * @see #gluNewTess gluNewTess * @see #gluNextContour gluNextContour * @see #gluTessCallback gluTessCallback * @see #gluTessVertex gluTessVertex * @see #gluTessBeginPolygon gluTessBeginPolygon * @see #gluTessBeginContour gluTessBeginContour ****************************************************************************/ public static final void gluEndPolygon(GLUtessellator tessellator) { validateGLUtessellatorImpl(); GLUtessellatorImpl tess = (GLUtessellatorImpl) tessellator; tess.gluEndPolygon(); } // Boolean public static final int GLU_FALSE = 0; public static final int GLU_TRUE = 1; // String Name public static final int GLU_VERSION = 100800; public static final int GLU_EXTENSIONS = 100801; // Extensions public static final String versionString = "1.3"; public static final String extensionString = "GLU_EXT_nurbs_tessellator " + "GLU_EXT_object_space_tess "; // ErrorCode public static final int GLU_INVALID_ENUM = 100900; public static final int GLU_INVALID_VALUE = 100901; public static final int GLU_OUT_OF_MEMORY = 100902; public static final int GLU_INVALID_OPERATION = 100904; // QuadricDrawStyle public static final int GLU_POINT = 100010; public static final int GLU_LINE = 100011; public static final int GLU_FILL = 100012; public static final int GLU_SILHOUETTE = 100013; // QuadricCallback // GLU_ERROR // QuadricNormal public static final int GLU_SMOOTH = 100000; public static final int GLU_FLAT = 100001; public static final int GLU_NONE = 100002; // QuadricOrientation public static final int GLU_OUTSIDE = 100020; public static final int GLU_INSIDE = 100021; // NurbsDisplay // GLU_FILL //public static final int GLU_OUTLINE_POLYGON = 100240; //public static final int GLU_OUTLINE_PATCH = 100241; // NurbsCallback //public static final int GLU_NURBS_ERROR = 100103; public static final int GLU_ERROR = 100103; //public static final int GLU_NURBS_BEGIN = 100164; //public static final int GLU_NURBS_BEGIN_EXT = 100164; //public static final int GLU_NURBS_VERTEX = 100165; //public static final int GLU_NURBS_VERTEX_EXT = 100165; //public static final int GLU_NURBS_NORMAL = 100166; //public static final int GLU_NURBS_NORMAL_EXT = 100166; //public static final int GLU_NURBS_COLOR = 100167; //public static final int GLU_NURBS_COLOR_EXT = 100167; //public static final int GLU_NURBS_TEXTURE_COORD = 100168; //public static final int GLU_NURBS_TEX_COORD_EXT = 100168; //public static final int GLU_NURBS_END = 100169; //public static final int GLU_NURBS_END_EXT = 100169; //public static final int GLU_NURBS_BEGIN_DATA = 100170; //public static final int GLU_NURBS_BEGIN_DATA_EXT = 100170; //public static final int GLU_NURBS_VERTEX_DATA = 100171; //public static final int GLU_NURBS_VERTEX_DATA_EXT = 100171;