aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/awt
Commit message (Collapse)AuthorAgeFilesLines
* Attempt to analyze failed AWT UI tests, where no paint is being issued to ↵Sven Gothel2011-02-261-3/+14
| | | | GLCanvas.
* Code cleanup: override, imports, StringBuilder, ..Sven Gothel2011-02-261-10/+17
|
* Move implementation private files from com.jogamp.<module>.impl. to ↵Sven Gothel2011-02-092-12/+12
| | | | | | | | | | | | | | | jogamp.<module> (2/2) - edit files - com.jogamp.opengl.impl -> jogamp.opengl - com.jogamp.opengl.util.glsl.fixedfunc.impl -> jogamp.opengl.util.glsl.fixedfunc - com.jogamp.nativewindow.impl -> jogamp.nativewindow - com.jogamp.newt.impl -> jogamp.newt This sorts implementation details from the top level, ie skipping the public 'com', allowing a better seperation of public classes and implementation details and also reduces strings. This approach of public/private seperation is also used in the OpenJDK.
* Move GLCanvas' static initialization of default GLProfile into constructor ↵Dan Krisher2011-02-051-3/+1
| | | | to avoid requiring native libraries at class initialization time.
* GLCapabilities enhancements: Choosing, All-Available, Data Handling (X11, ↵Sven Gothel2011-01-311-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | WGL and EGL) - GLDrawableFactory exposes: public final List/*GLCapabilitiesImmutable*/ getAvailableCapabilities(AbstractGraphicsDevice device) - GLCapabilities platform specialization containing native ids (XVisual/FBConfig, PFD, EGLConfig, ..) - GLCapabilities setPbuffer(true) disables onscreen - Capabilities setOnscreen(true) disables pbuffer - Capabilities implements Comparable - *Capabilities: enhanced 'toString(..)' - CapabilitiesChooser.chooseCapabilities: 'CapabilitiesImmutable[] available' -> 'List /*<CapabilitiesImmutable>*/ available' - VersionApplet, GLCanvas.main, GLWindow.main, GLProfile/debug: dumps all available GLCaps - WGLGLCapabilities: proper non-displayeble (pbuffer) pfdid handling TODO: ES/EGL test with emulation
* GLCanvas: lock/sync drawable usage ; remove destroyed refs (context, ↵Sven Gothel2010-12-231-17/+104
| | | | drawable, awtConfig) ; Try create/destroy AbstractGraphicsDevice on EDT
* JOGL/NEWT: Introduce WindowClosingProtocol (solves Bug/Request 444)Sven Gothel2010-12-192-85/+137
| | | | | | | | | | | | | | | | | Similar to JFrame's closing behavior, the following components window closing follow the new WindowClosingProtocol: - GLCanvas - GLJPanel - NEWT Window, GLWindow - NEWT NewtCanvasAWT The implementation obeys either 1) the user value set by this interface, 2) an underlying toolkit set user value (JFrame, ..) 3) or it's default, eg. {@link #DO_NOTHING_ON_CLOSE DO_NOTHING_ON_CLOSE} within an AWT environment. If none of the above determines the operation, this protocol default behavior {@link #DISPOSE_ON_CLOSE DISPOSE_ON_CLOSE} shall be used.
* GLCanvas: init drawable by paint/display makes the init sequence more equal ↵Sven Gothel2010-12-181-1/+3
| | | | for all launch flavors (applet/javaws/..)
* GLJPanel/GLPbufferImpl: destroy pbuffer reentrance fix; disable device close ↵Sven Gothel2010-12-121-10/+13
| | | | (X11 error on nvidia); reenable GLJPanel test
* Windows RegisterClass: Use new RegisteredClassFactory (window class), Misc.Sven Gothel2010-12-121-1/+0
| | | | | | | | | | | | | | | | | This solves the issue when an applet is started/stop and started again, or another applet runs in the same JVM. Also soves the issue for multiple JVMs. RegisteredClassFactory can be instanced to manage one shared window class, currently in use for GDI's dummy window and NEWT. A class base name and a window proc handle must be passed in the factory cstr. Before registering, the class is tested if already exists, eg another applet in the same JVM. If registration fails, the class name will iterate until successful or MAX_INT reached, eg if multiple JVMs are running. Added NativeWindow Common Native Code.
* GLCanvas: sync drawable access; flush awtConfig at remove;Sven Gothel2010-12-101-80/+101
|
* GLCanvas: Adding convenient constructor for GLCapabilties and Shared Context ↵Sven Gothel2010-12-031-1/+14
| | | | (with unit test)
* Cleanup GLDrawableFactory API and platform ImplementationsSven Gothel2010-12-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | - Finish API change using the AbstractGraphicsDevice, which denotes the target device for the desired NativeSurface / GLDrawable. The AbstractGraphicsDevice argument may be null to reflect the platform's default device. Clarified API documentation. This move is necessary to make the API coherent. - createOffscreenDrawable(..) may create a Pbuffer drawable if caps and supported. This unifies the functionality with createGLDrawable(..). Further more, a Pbuffer drawable is an offscreen as well. - added createOffscreenSurface(..) following the same behavior as createOffscreenDrawable(..), this is a convenient native offscreen surface factory entry. - removed createGLPbufferDrawable(..), use createOffscreenDrawable(..), since it is redundant! Implementation Details: - EGLDrawableFactory holds a shared native EGLGraphicsDevice, being used by the offscreen EGL drawable (no more multiple creation).
* GLCanvas: Fix disableBackgroundErase/X11, make drawable creation more ↵Sven Gothel2010-11-272-19/+78
| | | | | | | | | | | | | | | | robust, doc Java2D/AWT properties. On X11 disableBackgroundErase() must happen before native peer creation, this patch issues it before and after super.addNotify(). Make drawable creation more robust, ie only create a drawable in case the size is > 0x0 and do this check/create at display/paint in case size it not yet determined. Add documentation about Java2D/AWT properties impact on GLCanvas. Make JUnit tests on AWT/GLProfile's more robust, while adding frame validate() ensuring 1st paint will have a size, hence will create the drawable. This is necessary for eg. AMD GPU's and GL context > 3.
* Refined VersionInfo usageSven Gothel2010-11-251-2/+2
|
* GLCanvas: Refine access modifiersSven Gothel2010-11-251-4/+4
|
* Fix GLCanvas Recreation - Regression 96af6c9bf2d683115996Sven Gothel2010-11-251-32/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | 96af6c9bf2d683115996 moved the creation of the AWTGraphicsConfiguration, GLDrawable and GLContext to the GLCanvas constructor. This disabled recreation, removeNotify()/addNotify() after 1st addNotify(), since the drawable/context were already set to null. Smart recreation, ie not destroying the resources completly: 1 - drawable 2 - context 3 - AWTGraphicsConfiguration's Device (X11: Display) is not possible, since removeNotify() is the only destroy notification we have from AWT, which would leave the above resources open -> leak. This is especially true for (3), since the device is created 'on the fly'. In NEWT we use lazy creation/destroy and are able to keep the references alive. A remodelling of AbstractGraphicsConfiguration would be required, which indeed would be overkill. Simple solution is to move the creation block back to addNotify() but before 'super.addNotify()', since it needs our chosen AWTGraphicsConfiguration. Also flagging sendReshape in addNotify(). Added test case com.jogamp.test.junit.jogl.awt.TestAWT03GLCanvasRecreate01.
* Add GLJPanel test (works better in jogl-demos though, need to copy)Sven Gothel2010-11-231-6/+10
|
* GLAnimatorControl pause()/resume() don't fail fast, return a boolean instead ↵Sven Gothel2010-11-221-4/+1
| | | | to simplify usage.
* JOGL/NEWT: Animator fixesSven Gothel2010-11-211-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider use cases with many drawables and no drawables at start, this had to be reflected all over this patch set, implementation, usage and test cases. - GLAnimatorControl - refine API doc / states - add 'void remove(GLAutoDrawable drawable);' - Animator*: - using RecursiveLock 'stateSync' for all actions out of the big synchronized (animator) block: - get status methods (thread, isPaused, ..), hence no more synchronized - display drawables change, utilizing synced ArrayList swap This removes the need for volatiles usage shouldPause/shouldStop within the display method. - added blocking wait for state change for add(GLAutoDrawable)/remove(GLAutoDrawable) method - remove flawed double checked locking in anim thread (pause/idle condition) - thread is now a daemon thread, hence it won't hinder the JVM from shutdown - - Animator use change: - Always resume after pause, except in case of final destroy -> NEWT invalidate / GLCanvas, this considers use cases with many drawables and no drawables at start. - GLDrawableHelper: Don't pause at implicit dispose()
* Merge branch 'master' of github.com:sgothel/joglMichael Bien2010-11-181-54/+47
|\
| * JOGL/AWT: Fix ~ 2 year old regressions: Choose & Use GraphicsConfiguration ↵Sven Gothel2010-11-181-54/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | for Canvas. ; Adding FSAA test. Canvas/X11: The Canvas GraphicsConfiguraton should be chosen before the native peer is being created. Choosing AWT GraphicsConfiguration (all platforms): Don't filter our capabilities with 'AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capsChosen, gc)', not necessary (see above) and it would remove ourrequired alpha channel. Canvas display(): Don't render if drawable is not realized (yet).
* | print platform info additional to the module info.Michael Bien2010-11-181-0/+2
|/
* Finishing Immutable changes including GLCapabiltiesImmutable.Sven Gothel2010-11-172-32/+40
|
* NativeWindow AbstractGraphicsDevice: Add 'unitID' attribute and getUniqueID()Sven Gothel2010-11-151-1/+1
| | | | | | | | | | Preparation to support multiple devices on one machine, hence adding the unitID a unique ID/index of the associated GPU, or GPU affinity. Adding getUniqueID() to return a cached semantic unique string id for the device. This was removed from the temp. impl in JOGL's GLContext, added unitID. All other changes just adapt to the above.
* JOGL: Complete eager and lazy mapping of GLProfiles in respect to multiple ↵Sven Gothel2010-11-142-7/+7
| | | | | | | | | | | | | | device. AbstractGraphicsDevice's 'connection' and 'type' attribute is used as a unique key to map GLProfiles and GLContext's major/profile -> major/minor/profile mapping. Eager initialiaztion as well as lazy is supported to maintain a simple API. This is currently tested on X11, where one app display NEWT/GL window and content on the local and remote device. See TestRemoteWindow01NEWT.java and TestRemoteGLWindows01NEWT.java
* Adapt to GlueGen Version changes; Adding NativeWindowVersion, JoglVersion ↵Sven Gothel2010-11-121-5/+9
| | | | | | | | | and NewtVersion. Adapt to GlueGen Version changes: b735755815312b5fe2c003642de60711be1cd645 .. 556c7e70d3d57aa99b5787b1e4d8a7b1c299ed3f Show information of all subcomponenet.
* Adding simple static main test entry to provide standalone autobuild ↵Sven Gothel2010-11-091-0/+55
| | | | verification
* Proper X11 Display ClosingSven Gothel2010-10-292-30/+68
| | | | | | | | | | | | | | | | | | | | | X11Util: Removed TLS semantics, since TLS name -> dpy mapping is erroneous at this point. Added lists for open connections (for optional later shutdown). AbstractGraphicsDevice interface and implementations: Adding 'close()' method allowing native implementations the ability to close the native resource, ie X11GraphicsDevice. This becomes necessary for 'on the fly' created X11 Display connections, ie in X11AWTGLXGraphicsConfigurationFactory, which enables closing. Utilize 'close' call in use cases: GLCanvas, GLJPanel and AWTCanvas. Remove active X11 Display creation in X11JAWTWindow, as a last resort, use the X11SunJDKReflection method. Used for reference only, not active rendering etc, mostly for on the fly AWT parenting in NewtFactoryAWT. However, these 'on the fly' references are erroneous and should be remodelled, ie passice and active X11GraphicsDevice's ..
* WindowImpl/GLWindow LifecycleHook:Sven Gothel2010-10-272-4/+30
| | | | | | | | | | | - 'destroyAction' -> 'destroyActionPreLock' 'destroyActionInLock', to be able to stop animation before locking. GLDrawableHelper.invokeGL() dispose case (initAction == null): - pause animator if animating before makeCurrent (locking) GLCanvas/GLJPanel dispose: recreate case - resume animator if was animating
* JOGL: Reenable Applet/Webstart/RCP support for JOGL + AWT + X11Sven Gothel2010-10-142-25/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed GLProfile/NativeWindowFactory/.. initialization methodology: GLProfile: public static synchronized void initSingleton(final boolean firstUIActionOnProcess); NativeWindowFactory: public static synchronized void initSingleton(final boolean firstUIActionOnProcess); +++ Introducing NativeWindow ToolkitLock, implementations are NullToolkitLock JAWTToolkitLock X11JAWTToolkitLock X11ToolkitLock AbstractGraphicsDevice provides generic global toolkit locking methods, implemented by the ToolkitLock interface. ToolkitLock's are aggregated in NativeWindow's DefaultGraphicsDevice to implement it's superclass lock()/unlock() methods. This enables a device specific locking strategy, ie on X11/AWT utilizing JAWT && X11 locking, and maybe none for others (NEWT). No locking is required for X11 / AWT, in case the above mentioned initialization happened as a 'firstUIActionOnProcess'. The ToolkitLock factory is currently a hardcoded part of NativeWindowFactory. We may have to allow 3rd party NativeWindow implementations to register custom ones. +++ com.jogamp.opengl.impl.GLDrawableImpl cleanup: Dealing with all locking code, providing all public methods. Exceptions are commented. Specializations x11/windows/.. only contains platform code. Pulled down access qualifiers if possible public -> protected. com.jogamp.nativewindow.impl.x11.X11Util Wrapping all X11Lib method with the new locking code. com.jogamp.nativewindow.impl.jawt.JAWTUtil Utilize global SunToolkit.awtLock() is available, the fallback to global JAWT.lock(). The latter just invokes the first. javax.media.nativewindow.awt.AWTGraphicsDevice setHandle(long handle) -> setSubType(String type, long handle) which also resets the ToolkitLock respecting the new type. This ensures correct locking after the sub type has been determined, ie AWT using an X11 peer. +++ Misc Changes done on the way .. GLCanvas: Fixed inversed this.drawableHelper.isExternalAnimatorAnimating() condition, which disabled normal repaint. GLJPanel: Removed drawableHelper.isExternalAnimatorAnimating() condition, which disabled painting, since the animation thread just updates the source image. NEWT WindowImpl: When reparenting back to parent and 'refit' child if it's size exceeds it's parent. More 'Fix: Memory consumption' commit 6ced17f0325d5719e992b246ffd156e5b39694b4. NEWTEvent: Removed code to evaluate the 'system event' attribute, need to find a better approach.
* NativeWindow/NativeSurface Refactoring ; Added mouseClick NEWT/AWT unit testSven Gothel2010-10-062-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | NativeWindow/NativeSurface Refactoring - Using NativeSurface interface - NativeWindow extends NativeSurface, adds getLocationOnScreen(Point) - NativeWindow add: getParent() - NativeWindow/Surface: Removed 'invalidate()', use 'destroy()' if you must. - NullWindow -> ProxySurface impl NativeSurface - JOGL: Uses NativeSurface only. - GLDrawable.getNativeWindow() -> GLDrawable.getNativeSurface() Added mouseClick NEWT/AWT unit test JOGL: - GLAnimatorControl add: resetCounter() - NEWT: - GLWindow counters: return GLWindow counters always - WindowImpl - requestFocus() wait until done - reparent: readded requestFocusImpl(true), native impl skips java focusAction if reparented - X11Window: Add XRaiseWindow() in requestFocus()
* Unit test for Bug 411 (Pre AWT/Swing Usage, Mixed usage with JOGL) - ↵Sven Gothel2010-09-251-18/+21
| | | | | | | | | | | | | GLCanvas NPE fix - NewtCanvasAWT added destroy(..) Unit test for Bug 411 (Pre AWT/Swing Usage, Mixed usage with JOGL): Added exhausting Pre AWT/Swing usage test utilizing a later JOGL init with GLCanvas and NEWTCanvasAWT. This works for NV+X11+Ubuntu+64bit, have to do more testing. GLCanvas NPE fix at destroy/dispose, check if already destroyed, ie context==null NewtCanvasAWT: Add destroy() and destroy(boolean unrecoverable)
* NEWT: Animator API Change - Changed Lifecycle of Display/Screen (part 4)Sven Gothel2010-09-232-8/+13
| | | | | | | | | | | | | | | | | | | | | Change GLAutoDrawable interface: setAnimator(Thread) -> setAnimator(GLAnimatorControl) to minimize the setAnimator(..) calls and to allow fine grained control over the animation, ie in case of reparenting where the animation shall pause while changing the window(s). Introducing GLAnimatorControl interface: - abstract class AnimatorBase implements GLAnimatorControl - class Animator extends AnimatorBase - class FPSAnimator extends AnimatorBase This also changes FPSAnimator, since it is no more derived from Animator, use it's superclass or superinterface instead. +++ - Fix GLJPanel.paintComponent(): Don't issue reshape/display in case an external animator thread is animating. - Fix: Documentation [API]
* GLAutoDrawable: setAnimator/getAnimator/invoke/display changes; NEWT: Adding ↵Sven Gothel2010-06-262-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | native repaint; NewtCanvasAWT focus fix Support for native repaint, which shall call display() in case no animator is running. GLAutoDrawable invoke(GLRunnable) impl. handles case if invoked on animator thread, or no animator thread is running (issueing a display() call). The impl resides in GLDrawableHelper. GLEventListener's init() and glViewport()/reshape() method must be called before the 1st display() and after a dispose() call. It could miss the 1st display() call if added after the setVisible(true) call - due to the native repainting. The impl resides in GLDrawableHelper. The Animator un-/registers itself at the GLAutoDrawable via setAnimator. NEWT Window reparent always issues a resize() and display() call. NEWT native Window uses direct send.*Event for input events (again), instead of enqueueing it for performance. NEWT Window implements all status change and Java native event callbacks, instead of having duplicated code in all implementations. NewtCanvasAWT if the Newt window is focused, the AWT/Swing component[s] will loose the focus.
* JOGL.GLAutoDrawable:Sven Gothel2010-06-162-0/+16
| | | | | | | | | | | | | | | | | | | | | | - Add: 'public void addGLEventListener(int index, GLEventListener listener)' Fixes previous GLWindow addition, ie public in interface and common impl. behavior. - Add: 'public void invoke(boolean wait, GLRunnable glRunnable)' - Change: 'public void display()' semantics, in regards to the GLRunnable queue New: GLRunnable, invoke() at GLAutoDrawable Allows injection of GL commands from other threads, executed after the GLEventListener's display() notifyier by the GLAutoDrawable. NEWT: - Fix EDTUTil.invokeAndWait() and Display.enqueueAndWait() impl., where we only wait for the single action/event to be processed now. JUnit: NEWT Parenting - Added test cases for Swing (JFrame, JPanel and COntainer) with NewtCanvasAWT - Added thread calling 'invoke(true, GLRunnable)' - start Animator ASAP
* Fix: Locking/Threading; Common IntIntHashMap and Buffers; Fix: ↵Sven Gothel2010-06-102-16/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | glMap*Buffer*; GLX/WGL/CgGL: All runtime dynamic; Misc .. TODO: Compile and test on MacOSX .. Fix: ===== Multithreading/Locking: See jogl/doc/Implementation/MultiThreading.txt - Locking layer is not platform agnostic, ie GLContextImpl, GLDrawableImpl, .. and NEWT: Window/Display - No more use of JAWT global lock necessary, removed. - No need for X11 Display lock, on the contrary, this made the NV driver hang. - Use common window/surface lock - All NativeWindow surfaceLock's are recursive now glMapBuffer: If size is 0, don't do cont with the native call. glMapBufferRange: Fix capacity. glNamedBufferDataEXT: Track the size. glMapNamedBufferEXT: Manual impl. - use the tracked size glXGetVisualFromFBConfig, glXChooseFBConfig, glXChooseVisual: Instead of ignoring and implement a renamed version (*Copied), we just use ManualImplementation for the proper copy-result code. DesktopGLDynamicLookupHelper: Initialize _hasGLBinding* attributes in the determing loadGLJNILibrary() method, which is called by super(). Otherwise static init will overwrite them after the super() call. X11GLXDrawableFactory: Don't release anything at shutdown (removed sharedContext.destroy()), since this caused a freeze/SEGV sometimes. Fixed NEWT's reparentWindow() functionality incl NewtCanvasAWT usage. - Native: if not visible, don't focus, etc - NewtCanvasAWT: Use the container size to start with - Run the command on the EDT Using GlueGen's new DynamicLibraryBundle utility: - X11, Windows and MacOSX OpenGL adapted to DynamicLibraryBundleInfo. - X11GLXDynamicLookupHelper -> X11GLXDynamicLibraryBundleInfo - Remove all path from lib names. - GL order: libGL.so.1, libGL.so, GL - shallLinkGlobal: true -> to server some 'old' DRI systems -> http://dri.sourceforge.net/doc/DRIuserguide.html - shallLookupGlobal: false - Try both : glXGetProcAddressARB and glXGetProcAddress - Using bootstrap: GLX.glXGetProcAddress(long glxGetProcAddressHandle, String glFuncName) Found the issue with LIBGL_DRIVERS_PATH, ie if not set no valid GL instance can be found (ie ATI fglrx/DRI). This may happen if using a differen user than the desktop user for whom the env var is set within some /etc/X11/Xsession.d/ script. Enhancements: ============= GLBufferSizeTracker: Use IntIntHashMap and add DirectState size tracking. GLBufferStateTracker: Use IntIntHashMap. GLStateTracker: Use IntIntHashMap. GLDynamicLookupHelper: More generic (global loading/lookup and GetProcAddress function name list), remove redundant code. FIXME: MacOSXCGLDynamicLookupHelper: - Not tested - Not using NSImage lookup anymore as recommended by OSX API Doc, so dlsym is used always (to be tested) WindowsWGLDynamicLookupHelper: - Not tested GLX/WGL/CgGL is all runtime-dynamic as now, ie loaded and looked-up at runtime, no compile time dependencies to GL anymore, nor a need to specify CgGL. Split up WGL in GDI and WGL, to allow proper dynamic runtime linkage of OpenGL32 while using static binding to GDI32 NEWT events generated by native code are enqueued and not send directly. This should ease locking mechanisms .. if any are necessary. NEWT: More platform specific code moved to *Impl method, simplifying the generic code of the superclass and impl protocol. Cleanup: ========= Replace all InternalBufferUtil's with com.jogamp.common.nio.Buffers Removed all InternalBufferUtil's from repository Removed GLContextImpl notion of 'optimized' surface locking, where the surface gets unlocked during makeCurrent/release. This just makes no sense and would impact multithreading in a horrible way.
* JOGL: Unify library loading (impl and binding), incl. lookup ; ↵Sven Gothel2010-06-042-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | GLAutoDrawable: dispose() calls only with created context. - Using the EGL approach of DynamicLookupHelper, now generalized in abstract GLDynamicLookupHelper, DesktopGLDynamicLookupHelper and EGLGLDynamicLookupHelper. The implementation of these are self contained. - Sharing common code. - Unifying implementation and binding loading, as well as the function lookup within the impl libs. - Removed DRIHack, since its no more required due to the new DesktopGLDynamicLookupHelper. - Removed compile time link to GL and GLU libs - Removed redundant library OS functions from X11/WGL bindings, GlueGen's common code is being used now. - GLAutoDrawable: dispose() calls only with created context. This cleans up stack traces in case of eventual bugs, where context creation is not successful.
* NEWT: Fix AWT Parenting ; Multithreading Issues ; Semantics: destroy(), .. ; ↵Sven Gothel2010-05-282-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Misc. Due to incapabilities of the previous AWT/NEWT reparenting the implementation and spec had to be changed to support this feature. See the first 2 comments below. - Tested on GNU/Linux (OK), Windows (a few bugs left) - TODO: - Clarify the size/layout issue, ie who is responsible etc In the test, incl AWT/NEWT, we set the size on the GLWindow and ie pack the AWT Frame. - Fix remaining [Windows] bugs .. - Fix/Implement MacOSX port .. Fix AWT/NEWT reparenting: =========================== - Now NewtFactory's createWindow() method for parenting handles NativeWindow only and is no more responsible for creating a child window upon an AWT Component. See class com.jogamp.newt.awt.NewtCanvasAWT for NEWT/AWT parenting. - New com.jogamp.newt.awt.NewtCanvasAWT, responsible for handling AWT's reparent events via addNotify/removeNotify. Reparenting is implemented via the new NEWT Window's reparentWindow() method. Also sets the background erase to false, if supported. - Fix zero size semantics in Window (setSize/setVisible) Since a zero size window is not supported by many compoenent (Windowing system, OpenGL, ..) we use the visibility methodology to not show a 0x0 window. See Javadoc. AWT components may start with zero size. - New NEWT Window: reparentWindow(NativeWindow newParent, Screen newScreen) Allowing to change the parent of a window. Similar with the fullscreen toggle, but without size/position change. Native reparenting allows to keep alive the native window while changing the container, hence it is preferred to a destroy/create cycle. To benefit from the native reparenting, a NEWT implementation has to implement 'protected boolean reparentWindowImpl(long newWindowHandle)' and return true, otherwise reparenting will be 'emulated' via the expensive destroy/create cycle. - NEWT's Window references all of it's children, if any - NEWT's Window propagates setVisible/destroy actions to it's children. - Fix NEWT's destroy() semantics. A call of destroy() or destroy(false) shall only result in the destruction of the native window (handle) nothing more. A subsequent setVisible(true) shall allow the complete recreation of the Window into a usable state. A call of destroy(true) destroys all resources the Window holds, may include Screen/Display and OpenGL resources in case of GLWindow. This is necessary to allow proper reparenting, where a native window may become destroyed, but should be recreated via setVisible(true) later on. - Fix NEWT set[Size|Position|Fullscreen|Visible] synchronization. Use a recursive lock instead of the Window instance, otherwise arbitrary Window access via AWT's EDT, NEWT's EDT or other threads can block. Also removed a use pattern like: key.lock() try { EDT.invoke(action()); } finally { key.unlock(); } Where action() itself uses the same lock object (here key), the result is a deadlock. NativeWindow Changes: ====================== - We can use XInitThreads() now (concurrent threading support) in combination with AWT. Might have been some async in our NEWT locking in regards to AWT (sync()), and the X11 Display changes made in c787f50d77e2491eb0d8201d534a6fa4885a929e. - NativeWindow's window handle is _not_ transient like surface handle, fixed documentation. JOGL Changes: ============= - New 'isRealized()' method in GLDrawable. - Misc Fixes ============ - Fix NEWT set[Size|Position|Fullscreen|Visible] duplicate code Due to pure abstract signatures, the set[Size|Position|Fullscreen|Visible] implementations of X11, OSX, .. contained duplicate code and state handling (size, pos, ..). These are now decoupled, ie generic set[Size|Position|Fullscreen|Visible] implementations calling simple set[Size|Position|Fullscreen|Visible]Impl implementations. - Fix NEWT: Renamed setAutoDrawableClient(boolean) to setHandleDestroyNotify(boolean) The semantic of setAutoDrawableClient(boolean) defaults to false was too complicated and specific, hence changed to setHandleDestroyNotify(boolean) defaults to true since its more clear and the name refers the window itself.. - Fix NEWT: Removed GLWindow's unused global window list - Fix NEWT: Remove Window's unused event mask - Rename com.jogamp.newt.impl.awt.AWTNewtFactory -> com.jogamp.newt.awt.NewtFactoryAWT
* ATI (fglrx) PBuffer/X11Display bug workaround/cleanupSven Gothel2010-04-131-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - See https://bugzilla.mozilla.org/show_bug.cgi?id=486277 - Description: - To use PBuffer, a context must be current - X11Display cannot be switched while using the PBuffer [within one thread]. Hence we shall try harder to reuse _the_ user configured X11Display - whenever possible. This is actually a good thing, ie cleanup up our code again. - Changes to workaround/cleanup: - GLDrawableFactory* methods 'canCreate*()' are changed to 'canCreate*(AbstractGraphicsDevice)' to allow pipelining the X11Display. This reduces the overhead of using a local TLS X11Display. - WindowsDummyWGLDrawable cstr gets the GLProfile as a parameter now, this is done while adding X11DummyGLXDrawable - forseeing the usecase to query available GLProfiles at startup. - X11DummyGLXDrawable added, following the WindowsDummyWGLDrawable path to have a dummy GLContext current to fix the ATI bug. NativeWindow X11: - Add XIOErrorHandler to identify the fatal failure of closing a Display (-> ATI bug). Build: - Adding ant.jar and ant-junit.jar to the junit compile/run classpath - Misc: - Fix: CreateDummyWindow(..) returns a HWND, not a HDC - mapToRealGLFunctionName: Added mapping for X11/GLX. - X11GLXGraphicsConfigurationFactory: Uncommented dead code 'createDefaultGraphicsConfigurationFBConfig' Tests: Passed (Linux64bit: NVidia/ATI) Todo: More tests on ATI, especially multithreading/X11Display usage.
* refactoring: renamed com.sun.opengl -> com.jogamp.opengl.Michael Bien2010-03-272-8/+5
|
* GLDrawableFactory Cleanup (-> On- Offscreen and PBuffer)Sven Gothel2009-10-051-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | - Base all PBuffer/Offscreen GLDrawable creators on a prev. created 'NativeWindow + SurfaceChangeable' instance. Simplifies implementation path. This also removes the almost cyclic referencing of GLWindow -> OffscreenWindow GLWindow -> Drawable -> NullWindow -> OffscreenWindow Now it is just GLWindow -> OffscreenWindow GLWindow -> Drawable -> OffscreenWindow - createGLDrawable() shall be used for all types now, especially if you want to pass the offscreen NativeWindow and benefit from the surfaceChangedListener etc .. - Add public createOffscreenDrawable(..) - EGLDrawable: - Query surface only if not 0 - [re]create surface only if needed, using 'ownEGL*' flag for destruction only.
* GL3 Related:Sven Gothel2009-08-012-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Fix glGetStringi's return type to String - Fix ExtensionAvailabilityCache: GL3's glGetStringi for GL_EXTENSIONS Ensure to add GL_VERSION_2_0 in case version >= 3.0 Ensure to not exceed version 3.0 for non GL3.1 context. In case of GL 3.1, do not include GL_VERSIONS below 3.0, since this is a forward compatible context. - Add Prologue to glGetString, where the ExtensionCache is being used for GL_EXTENSIONS - if already initialized. This feature adds backward compatibility for GL3 context on GL_EXTENSION. +++ General: Add GLPipelineFactory, a convenient pipeline factory for Debug/Trace and custom ones .. Change 'void setGL(GL)' to 'GL setGL(GL)', and let it return the successful set GL, or null.
* Fixed GL* documentation. Moved common GL functions to GLBase. Moved ↵sg2158892009-07-291-15/+15
| | | | glAllocateMemoryNV to GL2GL3 only. Add GL2GL3 interface. Fix some GL2 signatures. BroadcomEGL disable custom setSize().
* Add: Extended support for CVM crosscompile:sg2158892009-07-241-63/+88
| | | | | | | | | | | | | | | | | | | - Clean up X11 dependency - NativeWindow: - Seperate X11 out of core. - Add nativewindow.x11.jar and nativewindow.x11.cdc.jar - Newt: - Seperate X11,win,osx out of core. - Add newt.x11.jar, newt.win.jar, newt.osx.jar and the CDC variants Fix: External Context & Drawable (X11 and Windows) - Properly fetch current context values (ctx, display, drawable, ..) - Create GraphicsConfiguration based on the given pixelformat/FBConfig Fix: Java2D OpenGL Usage - Using the external context as shared for the external drawable - JAWTUtil: Skip locking in case of OGL-Flush-Queue - TODO: Windows FBO still does not work .. (X11 is fine)
* Fix property query. Thx to Ken pointing this out.Sven Gothel2009-07-031-3/+5
| | | | git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@2018 232f8b59-042b-4e1e-8c03-345bb8c30851
* Copied JOGL_2_SANDBOX r1957 on to trunk; JOGL_2_SANDBOX branch is now closedKenneth Russel2009-06-154-0/+2419
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1959 232f8b59-042b-4e1e-8c03-345bb8c30851