aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/javax/media/opengl/awt
Commit message (Collapse)AuthorAgeFilesLines
* Enhance and generalize AWT Threading* implementation; Minor changes ..Sven Gothel2012-03-252-247/+144
| | | | | | | | | | | | | | | | | | | | | | | | | Threading*: - add invoke(..) generalizing the Therading decision GLCanvas: - remove 'manual' Threading decision, simply call Threading.invoke(..) - use anonymous Runnable instances - remove drawable lock, drawable is volatile instead GLJPanel: - remove 'manual' Threading decision, simply call Threading.invoke(..) - use anonymous Runnable instances - DEBUG: Use getThreadName() prefix GLContextImpl: - Remove GLWorkerThread idle command on makeCurrent(), no holding of context in worker thread while idle. - DEBUG: Use getThreadName() prefix X11GLXContext: - DEBUG: Use getThreadName() prefix TODO: Validate whether it's OK for GLCanvas and GLJPanel to set Threading.Mode.MT as the default mode!
* Cleanup: Use getThreadName() and validateCurrent() to remove redundancy and ↵Sven Gothel2012-03-201-26/+24
| | | | to add thread-name info; GLWorkerThread: Use ArrayList and generics.
* Reduce Thread.dumpStack() in debug mode where no negative behavior appears ↵Sven Gothel2012-03-181-1/+1
| | | | or a stack trace may be helpful.
* Adapt to gluegen Properties/Security commits ↵Sven Gothel2012-03-131-7/+3
| | | | f4ac27e177f6deb444280d3b375e7d343e38bd080 and eedb4b530fb83fc59a26962bcf7847a1404092a0
* NativeWindow public-spec to public-impl reorg ↵Sven Gothel2012-03-062-6/+6
| | | | (javax.media.nativewindow.<impl> -> com.jogamp.nativewindow.<impl>) 2/3
* DEBUG Output: More thread-names to drawable/context lifecycle; Remove ↵Sven Gothel2012-02-221-6/+6
| | | | massive '!!!' occurence
* Minor GL/GLContext additions / cleanups (GL_BGRA, isNPOTTextureAvailable())Sven Gothel2012-02-221-2/+2
| | | | | | | | - Subsume GL_EXT_texture_format_BGRA8888 -> GL, Added GLContext.isTextureFormatBGRA8888Available() - Movied generic isNPOTTextureAvailable() from GL -> GLContext, used by GL (desktop), added simplified impl. in GLES1/GLES2 (false/true)
* OpenGL ES/EGL OverhaulSven Gothel2012-02-132-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - GLProfile properly detects native EGL/ES1/ES2 on the 'desktop' device factory. This allows usage of Mesa's EGL/ES or Imageon's PVR emulation, etc. - GLProfile drops getDefaultDesktopDevice() and getDefaultEGLDevice() since both are aligned by getDefaultDevice(). - Fix GL_ARB_ES2_compatibility detection and utilize resulting isGLES2Compatible() where possible. This allows ES2 compatible desktop profiles to use core ES2 functionality (glShaderBinary() .. etc) even with a GL2ES2 desktop implementation. - EGLDrawable: If createSurface(..) fails (BAD_NATIVE_WINDOW) w/ surfaceHandle it uses windowHandle if available and differs. This allows the ANGLE impl. to work. - Properly order of EGL/ES library lookup: ES2: libGLESv2.so.2, libGLESv2.so, GLES20, GLESv2_CM EGL: libEGL.so.1, libEGL.so, EGL - *DynamicLookupHelper reference will be null if it's library is not complete (all tool libs, all glue libs and a ProcAddressFunc lookup function - if named). - Enhance GL version string (incl. ES2 compatible, hw/sw, ..) - GLBase: Fix docs and remove redundancies - Prepared (disabled) DesktopES2DynamicLibraryBundleInfo to be used for a real EGL/ES2 implementation within the desktop GL lib (AMD). Sadly it currenly crashed within eglGetDisplay(EGL_DEFAULT_DISPLAY), hence it's disabled.
* SWT GLCanvas: Adapt to latest JOGL changes (init, destroy, ..), Align main() ↵Sven Gothel2012-01-091-3/+3
| | | | | | entry w/ AWT GLCanvas functionality. -
* GLContext*/GLDrawableHelper: Fix consistency of recursive ↵Sven Gothel2012-01-082-78/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | makeCurrent()/release()/destroy() calls ; Enable context switch tracing ; GLCanvas: proper AbstractGraphicsDevice destruction GLContext*/GLDrawableHelper: Fix consistency of recursive makeCurrent()/release()/destroy() calls Utilizing volatile and lock.tryLock(0) for lockConsiderFailFast(), reducing redundant synchronization and using RecursiveLock implicit sync. GLContext 'early-out' is the case where the thread already holds the context, ie. context is already current and the native makeCurrent is skipped. makeCurrent()'s 'early-out' w/o incr. the recursive lock of GLContext and it's NativeSurface could lead to asymetry in lock/unlock count with release()/destroy() calls. The 1st release actually released the native ctx already. Properly utilize recursive lock/unlock in all cases and impl. 'early-out' after locking. Following the above in GLDrawableHelper.invokeGL()'s 'early-out' case as well, ie calling makeCurrent()/release() symmetrical. Introduce GLDrawableHelper.disposeGL(), which issues dispose on all GLEventListeners within a current context and issued context destruction directly. This simplifies GLAutodrawable's destroy/dispose calls and ensures that the above sequence of events happens atomically (lock is being hold until destruction). Enable context switch tracing If property 'jogl.debug.GLContext.TraceSwitch' is defined, trace context switch. GLCanvas: proper AbstractGraphicsDevice destruction
* GLJPanel: Fix dispose of backend (J2DOGL thread, no double dispose)..,Sven Gothel2011-12-222-104/+94
| | | | | | | | | | | | | | | | | | | | | | | GLJPanel: - fix dispose of backend - proper J2DOGL thread - no double dispose - remove VERBOSE - no dispose regenerate flag - add @Overrride - more safe createContext(..) impl - setSynchronized(true); for all backends - ensure AbstractGraphicsDevice close() is being called GLDrawableHelper: - Clarify w/ isDisposeAction = null==initAction GLPbufferImpl: - ensure AbstractGraphicsDevice close() is being called Java2D: - remove VERBOSE -
* New Interface 'OffscreenLayerOption', impl. by JAWTWindow (impl) and ↵Sven Gothel2011-12-171-31/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | NewtCanvasAWT/GLCanvas (delegation) ; Fix GLCanvas OffscreenLayerSurface usage. JAWTWindow.destroy(): - No more getGraphicsConfiguration().getScreen().getDevice().close() call, since the configuration (hence the device) is passed @ creation and owned by the caller. New Interface 'OffscreenLayerOption', impl. by JAWTWindow (impl) and NewtCanvasAWT/GLCanvas (delegation) - Abstract offscreenLayer option to be delegated by using classes - Allow offscreen testing of GLCanvas as well (like NewtCanvasAWT) Fix GLCanvas OffscreenLayerSurface usage - common 'createDrawableAndContext()' for context and drawable instance creation - addNotify() calls createDrawableAndContext() after super.addNotify() to be able to lock the surface (JAWTWindow) and hence to determine offscreen usage. - reshape(...) issues recreation 'dispose(true)' in case of using an offscreen layer - dispose() explicitly destroys the JAWTWindow NewtCanvasAWT: - explicitly close the device of the JAWTWindow (as GLCanvas does) Tests: com.jogamp.opengl.test.junit.newt.parenting.TestParentingOffscreenLayer01GLCanvasAWT com.jogamp.opengl.test.junit.newt.parenting.TestParentingOffscreenLayer02NewtCanvasAWT
* GLDrawableFactory*.createOffscreenDrawable(): No implicit setRealized(true) ↵Sven Gothel2011-12-171-0/+1
| | | | | | | | | | | | | | @ creation GLDrawableFactory*.createOffscreenDrawable(): No implicit setRealized(true) @ creation, following deferred creation like onscreen drawables. This allows using offscreen drawables in classes like GLCanvas, where realization is deferred due to pending valid size. Only createGLPBuffer() realizes the offscreen pbuffer drawable immediatly to reduce the impact on user-code. GLDrawableFactoryImpl.createGLDrawable(): - Simplify OffscreenLayerSurface validation and check it first regardless of the chosenCaps to get a chance to use pbuffer.
* Fix concurrency bug of GLProfile initialization ; Fix SharedResourceRunner ↵Sven Gothel2011-12-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'dead' thread (Applets) GLDrawableFactory: - clarify: public getWasSharedContextCreated(..) -> protected createSharedResource(..) - add: getSharesResourceThread() GLProfile: - proper locking of initSingletion(..) path: - Use RecursiveThreadGroupLock and add/remove GLDrawableFactory's sharesResourceThread while creating it's the sharedResource. This simplifies and fixes GLProfile's locking code. - Fix and simplify initSingleton(boolean) API doc - mark it deprecated. - Add initSingleton() for controlled initialization only, pairing w/ shutdown(..) Remove initSingleton(boolean) calls in code and test! +++ Fix SharedResourceRunner 'dead' thread (Applets) In Applets, stopping an Applet makes the browser Java plugin interrupting and killing all related threads, including our SharedResourceRunner thread. - Validate whether the shared resource thread is alive - Catch interruption in shared resource thread and assume it's a kill signal - releaseSharedResource: clear devicesTried set
* Nativewindow AWT Device/Screen: Cleanup construction [default, specific]; ↵Sven Gothel2011-11-251-1/+3
| | | | AWTDevice: Remove subtype
* NativeSurface's getGraphicsConfiguration() returns the native (delegated) ↵Sven Gothel2011-11-232-4/+4
| | | | | | | | | | | AbstractGraphicsConfiguration, if delegation is used. This change restricts the usage of AbstractGraphicsConfiguration's getNativeGraphicsConfiguration() to NativeSurface implementations and hence reduces complexity. NativeSurface implementations are adapted and access to it's AbstractGraphicsConfiguration is controlled via get/set method avoiding flawed usage (read/write), since read access shall return the delegated AbstractGraphicsConfiguration, if used.
* OSX: SharedResource add knowledge of NPOT-, RECT- and Float-Texture ↵Sven Gothel2011-11-081-11/+3
| | | | | | features, used by pbuffer drawable before a current context. - Also extract getNextPowerOf2() -> GLBuffers (remove redundancy)
* GLCanvas / GLWindow: Change 'manual' resize/repaint animation filterSven Gothel2011-10-131-1/+1
| | | | | | We not only shall skip windowing system triggered repaint if another animation thread is running, but also if the current thread is the animator thread. This keeps the animator intervals stable while resizing.
* Adapt to GlueGen's Lock ChangeSet: e4baba27507ce78e64a150ec6f69fb96f5721a34 ↵Sven Gothel2011-09-271-6/+11
| | | | ; Use generics
* Destruction of GLAutoDrawable shall not remove them from AnimatorControl ↵Sven Gothel2011-09-081-2/+0
| | | | | | | | | | | | | | | | | | | (due to recreation) ; NEWT/Window: Remove isValid() API entry - always true! Destruction of GLAutoDrawable shall not remove them from AnimatorControl (due to recreation) - Completes commit b65e1e76d413b70e5593173e6bd36d30675554a6 - WindowImpl: - volatile: windowHandle/visible fields (memeory sync critical) - destroy must set visible := false, to avoid immediate recreation via a display call of another thread, ie an animator. NEWT/Window: Remove isValid() API entry - always true! - NEWT/Window's can always be recreated. - redundancy in API is even worse than redundancy in impl. :)
* Test: Cleanup warnings; Add GLProfile.initSingleton(true) call for ↵Sven Gothel2011-08-301-1/+0
| | | | | | | | | | fluctuating NEWT tests Add GLProfile.initSingleton(true) call for fluctuating NEWT tests - Some of these tests even fail in the <init> state, i.e. cause a JVM stack dump around an early GLX createContext method only when issued via Jenkins. The Ubuntu 11.04/64bit Jenkins node runs 2 nodes (32 and 64 bit). TODO: Find cause.
* NewtVersionActivity: Remove 'gears' test; Version Info: Drop ↵Sven Gothel2011-08-221-1/+1
| | | | NativeWindow/Newt Version since we use *all* targets
* Fix 'main' invocationSven Gothel2011-07-071-0/+1
|
* GLProfile: Initialization fix and clarifications ( GLExceptions on n/a ↵Sven Gothel2011-07-072-12/+29
| | | | | | | | | | | | | | profiles ) - GLProfile.initSingleton(boolean) (implicit or explicit) won't throw any exception anymore. Followup 'GLProfile GLProfile.get(..)' calls will throw a GLException, if n/a. Availability maybe queried via GLProfile.isAvailable(..). - GLCapabilties, GLCanvas, GLJPanel: Clarify case where GLException maybe thrown, i.e. no default GLProfile available on default device. - Remove redundant GLProfile.is<ProfileName>Available(..)
* Add unified support for GL_ARB_debug_output and GL_AMD_debug_output.Sven Gothel2011-04-242-2/+31
| | | | | | | | | | | | | | | | | | | | | | If GL_ARB_debug_output is not available, but GL_AMD_debug_output exist, fallback to the latter, offering generic aliased methods translating the delta (AMD category <-> ARB source/type). Generic aliased methods reside in GLContext* Enable/Disable via GLContext and GLAutoDrawable. To enable the GLDebugOutput feature GLContext.enableGLDebugMessage(true) or GLContext.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG) shall be called _before_ context creation via GLContext.makeCurrent()! In case GLAutoDrawable is being used, GLAutoDrawable.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG) shall be issued before context creation via GLContext.makeCurrent()!. After context creation, the GLDebugOutput feature may be enabled or disabled at any time using this method. Verify both unit tests for usability.
* Fix TAB: Replace all TAB with 4 spacesSven Gothel2011-04-081-3/+3
|
* Fix unnecessary NPE in case of unrealized GLCanvas (getRequestedCapabilities())Sven Gothel2011-03-261-1/+1
|
* Fix Bug #460 - GLCanvas NPESven Gothel2011-03-211-1/+4
|
* 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).