summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix EGLDrawableFactory.createOffscreenDrawableImpl(NativeSurface): Validate ↵Sven Gothel2012-08-171-1/+1
| | | | | | | | passed NativeSurface 'target' via getEGLSurface(target) Makes impl. consistent w/ EGLDrawableFactory.createOnscreenDrawableImpl(). Even for offscreen drawable creation, the passed NativeSurface maybe platform specific (X11, GLX) for which we require to create a WrappedSurface w/ EGL instances.
* GLDrawableFactory.createGLDrawable() offscreen: Fix caps - set double-buffer ↵Sven Gothel2012-08-173-185/+178
| | | | | | := false to be consistent w/ GLDrawableFactory.createOffscreenDrawable() TestGLDrawable01NEWT: Enhance test case to run w/ EGLDrawableFactory (ES2) besides GL2 and GLX/WGL/..-Factory
* Robostness FBObject / GLReadBufferUtil: Ignore pre-existing GL errors - ↵Sven Gothel2012-08-173-5/+10
| | | | | | | | | | | remove GL error checking in FBObject bind/unbind. - User GL code caused errors shall not fail impl. - FBObject bind/unbind GL error checking is almost useless due to it's simple code, would only catch user GL code errors, which should be ignored here. - MultisampleDemoES2: Only enable GL_MULTISAMPLE if available, i.e. validate passed multisample flag
* Fix EGLDrawableFactory.getEGLSurface(..): Catch WrappedSurface case w/ ↵Sven Gothel2012-08-171-1/+8
| | | | | | | | | | | | | | | | | EGLDevice and EGLGraphicsConfiguration - Regression of 43a473b2005d7f59a7f4f5b8bc7ca9ae88b4e894 Do not create a WrappedSurface around a given WrappedSurface if the latter is intended for EGL, i.e. uses EGLDevice and EGLGraphicsConfiguration even though the surface handle is not valid [yet]. For this case we assume the WrappedSurface has a lifecycle hook as it is used for the dummy drawable. Otherwise we would have a recursive WrappedSurface, ie with EGLDrawableFactory.createOnscreenDrawableImpl( dummySurface ), where dummySurface is a WrappedSurface w/ EGL pbuffer drawable lifecycle hook. Commit 43a473b2005d7f59a7f4f5b8bc7ca9ae88b4e894 didn't take the above case into account.
* Robustness: FBObject or reset(..)Sven Gothel2012-08-171-37/+69
| | | | | | | | | | - Add property 'jogl.fbo.force.min' to simulate minimum FBO caps - Check new size in reset(..) - Ignore the status in attachColorbuffer(..), attachRenderbufferImpl(..) and attachTexture2D(..) when recreating the resources in detachAllImpl(..)/reset(..). The status is validated after recreation of all resources in detachAllImpl(..)
* Robostness: GLDrawableImpl's contextMadeCurrent()/contextRealized() ; ↵Sven Gothel2012-08-173-4/+39
| | | | | | | | | | | | | | | GLFBODrawableImpl.contextMadeCurrent(false), OffscreenAutoDrawable.setSize(..) GLDrawableImpl's contextMadeCurrent()/contextRealized(): - Catch exception which may appear during callback and cont. w/ GLContextImpl's release()/destroy() while throwing catched exception at end. GLFBODrawableImpl.contextMadeCurrent(false): - Detect null Colorbuffer ASAP and throw exception OffscreenAutoDrawable.setSize(..): - Catch exceptions at 1) GLFBODrawableImpl.setSize(..) and 2) GLContext.release() .. throw it in proper order.
* Fix FFMPEGMediaPlayer: Use GL_ALPHA (texture format intern/data) instead of ↵Sven Gothel2012-08-163-12/+34
| | | | | | | | | GL_RGBA/GL_ALPHA ; Load dedicated native libav/libffmpeg - ES2 spec does not allow GL_RGBA/GL_ALPHA. - Load dedicated native libs (libav/libffmpeg) since distributions don't create symlink e.g. libavutil.so -> libavutil.so.53
* EGLGraphicsConfigurationFactory: Fix platform w/o GLX but X11 window handle.Sven Gothel2012-08-161-5/+12
| | | | | | | | Without GLX but X11 windows, there is no pre-configured X11GLXGraphicsConfigurationFactory set, hence fetch the fallback X11GraphicsConfigurationFactory via: GraphicsConfigurationFactory.getFactory(com.jogamp.nativewindow.x11.X11GraphicsDevice.class, CapabilitiesImmutable.class) TODO: Cleanup cases for other platform - simplify!
* EGLDisplayUtil: Workaround (latest) PVR 540 EGL regression where 3nd ↵Sven Gothel2012-08-165-66/+127
| | | | | | | | | | | | | EGLDisplay's eglInitialize(..) fails ; Fix EGLDrawableFactory.getEGLSurface() - EGLDisplayUtil: Workaround (latest) PVR 540 EGL regression where 3nd EGLDisplay's eglInitialize(..) fails In this case and if eglGetDisplay(..) fails w/ a non EGL_DEFAULT_DEVICE, fall back to EGL_DEFAULT_DEVICE - always. This workaround actually simplifies handling both cases. - Fix EGLDrawableFactory.getEGLSurface() Tests whether a given NativeSurface w/ EGLGraphicsDevice and EGLGraphicsConfiguration has a valid EGL Surface. Only if true, reuse the whole NativeSurface, otherwise construct the missing pieces (device, config and use a WrappedSurface for EGL).
* NEWT: Adding support for BCM VC IV (Broadcom VideoCodec 4) and Linux console ↵Sven Gothel2012-08-1610-11/+925
| | | | | | | | | | | | | | | | | | mouse tracker Rasperry PI uses the 'BCM VC IV' GPU via console as it's default configuration. This driver enables direct support for JOGL/NEWT. Due to the lack of detection (TODO) users have to specify the Java property: -Dnativewindow.ws.name=jogamp.newt.driver.bcm.vc.iv - Autodetection should be included in 'NativeWindowFactory._getNativeWindowingType()' while adding a new TYPE: 'TYPE_BCM_VC_IV'. - Autodetection may need to detect whether an X11 Display runs and the installed EGL library uses it (instead of the default console one) This work is authored in coop w/ Xerxes Rånby <[email protected]>!
* Resolve conflictSven Gothel2012-08-077-25/+24
|\
| * Rename jogamp.newt.driver.kd.* classes to allow OpenKODE testing by passingXerxes Rånby2012-07-107-24/+24
| | | | | | | | -cp jar/atomic/newt-driver-kd.jar -Dnativewindow.ws.name=jogamp.newt.driver.kd
| * Rename jogamp.newt.driver.kd.* classes to allow OpenKODE testing by passingXerxes Rånby2012-07-103-0/+0
| | | | | | | | -cp jar/atomic/newt-driver-kd.jar -Dnativewindow.ws.name=jogamp.newt.driver.kd
* | Fix X11 Display Connection leak w/ new GLAutoDrawableBase code when used w/ ↵v2.0-rc10Sven Gothel2012-08-0311-29/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | offscreen drawables, reported by Mark Raynsford New common GLAutoDrawableBase missed to close the AbstractGraphicsDevice in case it has been created and dedicated for the passed GLDrawable. This detailed knowledge is only known to the creator, hence it is passed in the constructor and is being passed through all specializations. Further more the new X11/GLX impl. of GLDrawableFactory's 'createMutableSurfaceImpl' always creates it's own private X11 display connection to avoid locking / threading issues. Since the old implementation reused the shared display connection which is prone to threading issues, this bug was not visible before. Also fixed the unit test TestNEWTCloseX11DisplayBug565, now correctly validating that no display connection is left over after a new cycle of create/destroy of onscreen and offscreen drawables.
* | Add property: 'jogl.disable.opengles' to disable querying and using OpenGL ESSven Gothel2012-07-251-2/+9
| | | | | | | | | | | | | | | | | | | | | | This might be required by a few older buggy ES implementations. Also assists to discable ANGLE is not properly detected (?) on Windows 32bit - the latter causes SEGV within FF and Chrome. TODO: Fix ANGLE detection and usage within broser NOTE: ANGLE works fine standalone ..
* | SWT Update: SWT GLCanvas creates lazy when resource is ready; Create new ↵Sven Gothel2012-07-2525-448/+2038
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NewtCanvasSWT allowing to parent NEWT windows natively. SWT GLCanvas creates lazy when resource is ready - Ensures drawable and context are created when size > zero and native visualID is valid. The latter is platform dependent. - Note that you cannot utilize custom GLCapabilities w/ this one, since the configurations is already realized - use NewtCanvasSWT. Create new NewtCanvasSWT allowing to parent NEWT windows natively: - Similar to NewtCanvasAWT - Allows attaching / detaching NEWT windows NewtCanvasAWT: Public setNEWTChild(..) fixed Added test cases for the above - tested on Linux, OSX and Windows w/ SWT Note: As usual for OSX, add -XstartOnFirstThread Details: - NEWT Display has new method: 'EDTUtil setEDTUtil(EDTUtil)' allowing to set a custom event dispatch utility. We use this to set our SWTEDTUtil for using NEWT w/ SWT complying w/ SWT threading constraints.
* | Fix GraphicsConfigurationFactory: Map factory to device-type _and_ ↵Sven Gothel2012-07-2429-143/+419
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | capabilities-type; Add a pre-set nativeVisualID to chooseGraphicsConfiguration(..) Map factory to device-type _and_ capabilities-type: - Allows using different GraphicsConfigurationFactory implementations for different capabilities-types. Previous impl. failed to use an OpenGL agnostic CapabilitiesImmutable for 'chooseGraphicsConfiguration(..)' since only the GL aware factory was mapped. The latter failed since it expected a GLCapabilitiesImmutable. - The passed capabilities-type as well as device-type given at getFactory(..) is traversed top-to-down to find a most suitable factory: For-All devT := getTopDownDeviceTypes(deviceType) For-All capsT := getTopDownCapabilitiesTypes(capabilitiesType) f = factory.get(devT, capsT); if(f) { return f; } end end Add a pre-set nativeVisualID to chooseGraphicsConfiguration(..) - In situations where a native visualID is already chosen [by external means for example], but we still need to query a matching GraphicsConfiguration - we require to pass a non VisualIDHolder.VID_UNDEFINED nativeVisualID. We had a hack implemented before within some implementations and their static calls, however an agnostic mechanism is required to implement new NativeSurface/Window's platform agnostic. - X11GLXGraphicsConfigurationFactory: respect a pre-set xvisualID - X11GLXDrawableFactory.createProxySurfaceImpl(..) queries the given windowHandle's visualID and 'chooses' the configuration accordingly. If the visualID is undefined an exception is thrown, since window is invalid. These mechanics are implicit for Windows and OSX. Fix X11GLXGraphicsConfiguration.updateGraphicsConfiguration(): - Skip any action if a valid X11GLCapabilities is already chosen, i.e. w/ visualID. Otherwise choose a suitable configuration incl. visualID. The latter is quite impossible and invalid, since visualID must be defined at window creation time and the update method is issued with a valid window. X11 - Misc: - Added 'int jogamp.nativewindow.x11.X11Lib.GetVisualIDFromWindow(..)' - All returned visualID's are of type 'int'
* | Align TestSWTAccessor02GLn w/ TestSWTJOGLGLCanvas01GLn, dropping the canvas ↵Sven Gothel2012-07-222-14/+2
| | | | | | | | | | | | cstr on SWT thread, which seems not to be required.
* | Fix Bug 606 - New AWT threading implementation breaks .. ; Fix ↵Sven Gothel2012-07-2211-426/+649
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GLAutoDrawable multi-threading w/ proper pattern (hope so) Considering code changes and remarks: 3ed491213f8f7f05d7b9866b50d764370d8ff5f6 1a91ec5c8b6fd9d9db7bc115569c369fe7b38e9b 3334a924309a9361a448d69bc707d4cce416b430 4f27bcecf7484dc041551f52a5c49e2884cb3867 It seems necessary to have - recursive locking employed for all semantic actions which changes drawable & context (and the Window resource) - to avoid deadlock, we have to ensure the locked code segment will not spawn off to another thread, or a thread holds the lock, spawns of an action requiring the lock. .. sure - other read-only methods (flags, ..) shall at least utilize a safe local copy of a volatile field if further use to produce the result is necessary. - flags like sendReshape require to be volatile to guarantee it's being processed Patch impacts: AWT/SWT GLCanvas, GLAutoDrawableBase [and it's specializations] and hopefully closes any loopholes of missing a cache hit, etc. If you review this and find optimizations, i.e. removing a lock due to semantics etc, don't hold back and discuss it, please.
* | Fix TestSWTAccessor02GLn regression .. forgot to: ↵Sven Gothel2012-07-201-3/+7
| | | | | | | | canvas.addControlListener(swtUpstreamHook);
* | Fix OSX OffscreenLayerSurface (OLS) regressions (pbuffer based)Sven Gothel2012-07-205-15/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | - Use pbuffer (still), don't set FBO (invisible) - OLS (only impl is JAWTWindow now) stores the attached layer handle created and attached by the GLContext implementation, so 'others' may detach it -> NewtCanvasAWT - NewtCanvasAWT.removeNotify() needs to ask the OLS to detach the layer since it's parent will be gone. - MacOSXCGLContext destroy allows a removed OLS (see above)
* | Fix OSX regression of commit 20bf031db719f7baa4c6e74734fc999061e08fe2 - ↵Sven Gothel2012-07-206-2/+38
| | | | | | | | handling w/ non NSView handles (pbuffer)
* | Fix TestFocus01SwingAWTRobot failure duer to RedSquareES2's setFullscreen() ↵Sven Gothel2012-07-203-25/+10
| | | | | | | | | | | | toggle mouse adapter :) Moved the fullscreen toggle mouse adapter to main test class.
* | Minor editsSven Gothel2012-07-202-12/+10
| |
* | GLCapabilities Native Aquisition: Set alpha bits at last - due to it's auto ↵Sven Gothel2012-07-2012-63/+82
| | | | | | | | | | | | | | | | | | setting by setSampleBuffers(true) and setBackgroundOpaque(false) This bug lead to X11 GLCapabilities rgba: 8/8/8/1 - which ofc is invalid. Sideeffect was a bad selected GLXFB configuration and the GLContext couldn't be made current. Patch sets alpha bits reflecting reality carefully after opaque/samples. Added API doc note.
* | Fix NEWT exception handling in event dispatching: Catch and fwd to callerSven Gothel2012-07-203-24/+47
| | | | | | | | | | | | | | | | Exceptions caused by NEWTEvent processing (on it's EDT) were not propagated to the caller (diff thread). Hence the EDT were brought down and the caller may have waited forever (deadlock). Catch exception if caller waits and throw exception at waiting point.
* | Bug 599 - FBObject / Offscreen Support - Part 1Sven Gothel2012-07-19140-2152/+6019
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - New FBObject implementation handling FBO and it's attachments *** API CHANGE: Util -> Core *** while it's size and sample-count can be reconfigured on the fly. - com.jogamp.opengl.util.FBObject -> com.jogamp.opengl.FBObject - agnostic to texture unit - separate attachments using OO hierarchy reflecting FBO - handling MSAA and blitting - no FBO destruction for reconfig (attach/detach) - New GLFBODrawableImpl impl. an FBObject based GLDrawable - Instantiated by a dummy native surface (onscreen and invisible) hooked up to a dummy GLDrawable, which is the delegation for context creation. - Utilizies ProxySurface.UpstreamSurfaceHook for dummy surface avoiding specialization for native platforms. - TODO: Allow to utilize common surface interface as a dummy-surface to supporting API seperation of windowing/GL. The latter allows impl. of createGLDrawable(NativeSurface) with FBO. - New OffscreenAutoDrawable (extends GLAutoDrawableDelegate) for all offscreen drawables. Shall replace GLPbuffer. - New GLCapabilities*.isFBO() / setFBO(boolean) to request FBO offscreen, similar to isPBuffer(). Rule: if both are requested, FBO shall be favored. - GLContext adds raw FBO availability query (min. FBO avail), FBObject contains fine grained queries (TODO: Move parts to GLContext for efficiency). - Add framebuffer tracking, allowing fast querying: - GLBase/GLContext: public int getBoundFramebuffer(int target); public int getDefaultDrawFramebuffer(); public int getDefaultReadFramebuffer(); - GLContextImpl public final void setBoundFramebuffer(int target, int framebufferName) .. called by GL impl bind framebuffer - GL: getDefaultDrawFramebuffer(), getDefaultReadFramebuffer() Adding default framebuffer queries being issued by GL.glBindFramebuffer(target, 0) w/ a default framebuffer, o.e. zero. This allows a transparent use of a custom FBO even in case the applications attempts to reset FBO to zero. Value flow: GL <- GLContext <- GLDrawable, - GLCapabilities handle fbo/pbuffer seperate, don't disable the other - GLContext/GL track read/write framebuffer to be queried by FBObject to determine whether to bind/unbind a framebuffer - Test cases for multiple FBO w/ and w/o MSAA Other Features: - New interface ProxySurface.UpstreamSurfaceHook, allowing to hook an upstream surface of unknown type providing lifecycle and information (size, ..) callbacks. Used for all new dummy NativeSurface impl and SWT GLCanvas. - GLContext -> GLDrawable propagation context/drawable lifecycle via ProxySurface.UpstreamSurfaceHook allowing dynamic resources to react (create, init, ..) - contextRealized() - contextMadeCurrent() - SurfaceChangeable -> MutableSurface currently only contains setting the surface handle. TODO: May need to move ProxySurface.UpstreamSurfaceHook -> MutableSurface.UpstreamSurfaceHook, allowing other impl. classes (NEWT OffscreenWindow) to utilize the new upstream hookup mechanism - will allow FBO/Dummy window to work. - SWT GLCanvas using ProxySurface.UpstreamSurfaceHook for proper size propagation. - New GLAutoDrawable::getUpstreamWidget(), allowing GLEventListener to fetch the owning Java side UI element (NEWT, SWT, AWT, ..). - GLDrawableFactory: Removed createOffscreenSurface() - unused and not GL related - EGLDrawableFactory handles device/profile avail. mapping while actually creating context/drawable. This allows us to learn whether the ES context is software/hardware as well as FBO avail. - EGLDrawable: Removed secret buckets of EGL configs :) Employ native surface (X11, WGL, ..) to EGL 'mapping' in EGLDrawableFactory utilizing new EGLUpstreamSurfaceHook (implements ProxySurface.UpstreamSurfaceHook). Other Bugs: - Add CTX_OPTION_DEBUG to ctx/extension cache key since only a debug ctx may expose the ARB debug capability. This bug caused lack of ARB/AMD debug functionality. - Fix GLProfile deadlock (debug mode, w/ EGL/ES, no X11), dump availability information _after_ lock. - ImmModeSink draw(): Use GL's glDrawElements(..), don't cast for GL2ES1. Fixes use for GL2ES2. - Fix KeyEvent.getKeyChar() comment (-> only stable for keyTyped(..)) Misc: - Refined alot of API doc - New GLExtensions holds commonly used GL extension strings, allows better referencing and usage lookup. - Move GL (interface) decl. to GLBase - GLBuffers: Cleanup API doc (format, types) - TextureIO: Add PAM and PPM static suffix identifier - GLCapabilities getNumSamples() returns 0 if sampleBuffers is disabled, this seems to be more natural. - finalized a lot
* | GLCapabilities*: Add 'isFBO()' and 'setFBO(boolean)', allowing upcoming ↵Sven Gothel2012-07-092-9/+44
| | | | | | | | impl. to select offscreen FBO (GLDrawable, ..)
* | EGLGraphicsDevice adds desctruction callback and nativeDisplayID; ↵Sven Gothel2012-07-0910-127/+182
|/ | | | | | | | | | | EGLDisplayUtil adds creation of EGLGraphicsDevice. Due to EGL's location in JOGL, supporting destruction of an EGLGraphicsDevice is solved (hack) temporary by passing an eglTerminate callback to it's ctor. Using EGLGraphicsDevice's close() method to also issue eglTerminate() simplifies the code. In future we shall move EGL to nativewindow!
* Fix commit dfee8c58d4915f78f57545c26a492668b2b68a87Sven Gothel2012-07-062-6/+0
|
* Fix SWT GLCanvas threading. Note: On OSX _only_ it's main thread is valid!Sven Gothel2012-07-067-126/+132
|
* C code: remove warningsSven Gothel2012-07-063-11/+11
|
* Enhance Bootsrapping of JOGL around 37% - 40% (1st start in new JVM) - ↵Sven Gothel2012-07-0611-87/+220
| | | | | | | | | | | | | | | | | | | | | | | | GLProfile and GLContext* GLProfile: Enhance bootsrapping performance of loading GL*Impl class - Offthread classloading of all GL*Impl via reflection at startup reduces startup time here around 12% (800ms down to 700ms). GLContext*: Enhance bootsrapping performance of querying available GL profiles - Add PROFILE_ALIASING mode, defaults to true - can be disabled w/ property 'jogl.debug.GLContext.NoProfileAliasing' - PROFILE_ALIASING: If true (default), bootstrapping the available GL profiles will use the highest compatible GL context for each profile, hence skipping querying lower profiles if a compatible higher one is found. Linux x86_64 - Nvidia: 28%, 700ms down to 500ms Linux x86_64 - AMD : 40%, 1500ms down to 900ms - GL*Impl: - make fields final: glProfile, _context, buffer*Tracker and glStateTracker - allow null _context/glProfile in initialization (bootstrapping) - JoglVersion.getDefaultOpenGLInfo(..) - add arg: 'boolean withCapabilitiesInfo', allowing to suppres the list of caps
* GLContext adds FBO availability to profile mapping; Fix ↵Sven Gothel2012-07-0512-121/+678
| | | | | | | | | | | | | | | | GL[Auto]Drawable/GLContext re-association (switch) incl. unit test. - GLContext adds FBO availability to profile mapping - GLContext added 'GLDrawable setGLDrawable(GLDrawable readWrite, boolean setWriteOnly)' allowing to set the write GLDrawable. This method enables switching context/drawable. Fix GL[Auto]Drawable/GLContext re-association (switch) incl. unit test Commit eed8508ae1132e5f45f788e9cb3f3d5a1050ac70 impl. of GLAutoDrawable's setContext(..) enabled proper setting of the GLAutoDrawable context incl. updating the context's drawables. Test covers: - remove/set (GLContext, GLEventListener) of GL[Auto]Drawable - switch (GLContext, GLEventListener) of 2 GLAutoDrawables
* NEWT/KD Adapt to 'new' KD Window Creation API, use EGLConfigSven Gothel2012-07-052-21/+10
|
* NativeWindow/Newt X11ErrorHandler enhancement / unification - don't throw ↵Sven Gothel2012-07-0512-141/+276
| | | | | | | | | | | | exceptions. Handles also XAWT BadMatch X_SetInputFocus. X11ErrorHandler code now dumps proper information about the opcode and error message and the running Java thread. Having propery "nativewindow.debug.X11Util.XErrorStackDump" or "nativewindow.debug=all' set, a stack trace is dumped. Since the X11ErrorHandler may catch an XAWT error: BadMatch X_SetInputFocus, we cannot throw an exception and better keep running.
* GLAutoDrawable* refinement of abstraction / generalization - API Change!Sven Gothel2012-07-0427-311/+582
| | | | | | | | | | | | | | | | | | | | | | | | - GLAutoDrawable (compat change - recompile): - 'void invoke(boolean wait, GLRunnable glRunnable)' -> 'boolean invoke(boolean wait, GLRunnable glRunnable)' Allows notifying caller whether the task has been executed or at least enqueued. - GLAutoDrawable add 'GLEventListener removeGLEventListener(int index)' - This allow one to remove a specific GLEventListener and reusing it (return value). - GLDrawableImpl remove 'destroy()' to favor 'setRealized(false)' - Using more common code of GLAutoDrawableBase, i.e. GLPbufferImpl can use defaultDestroyOp(). - Removes redundancy of methods - GLAutoDrawableBase/Delegate - better 'default' names to emphasize it's purpose, adding API doc - includes more generic functionality - defaultWindowDestroyNotify() - defaultDestroyOp() - TestGLAutoDrawableDelegateNEWT demonstrates a simple example w/ all window events handled. - Fix TestParenting01cSwingAWT's threading use (gl disturbance thread)
* GLAutoDrawable: Refine API doc; Use new abstract impl. GLAutoDrawableBase ↵Sven Gothel2012-07-0210-561/+736
| | | | | | | | | | | | | | | (GLWindow, ..); Add new GLAutoDrawableDelegate. - Refine API doc - 'void setContext(GLContext)' -> 'GLContext setContext(GLContext)' - Add note to createContext(GLContext) override -Use new abstract impl. GLAutoDrawableBase, used by: - GLWindow - GLAutoDrawableDelegate - GLPbufferImpl - Add new GLAutoDrawableDelegate incl. unit test
* Test case cleanupSven Gothel2012-07-0214-63/+122
| | | | | | | - Gears w/ 640x480 size and proper aspect ratio frustum - query type of drawable.getNativeSurface() instead of auto-drawable itself - RedSquareES2 allow setting no-rotation and aspect-ratio for frustum - TestInitConcurrentNEWT: Don't use vsync
* Fix Bug 597: XDisplayString(0) -> SIGSEGV; Handle n/a DISPLAYSven Gothel2012-06-301-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It works now as follows: Note: Remote connection tested using ssh to localhost or an actual remote machine. Test w/ proper X11 authentication, i.e. DISPLAY and xauth: > cd projects/JOGL/jogl-bugs/597-headless/ > echo $DISPLAY localhost:10.0 > xclock 'works' T1.1 OK> java plop jogamp.opengl.x11.glx.X11GLXDrawableFactory@f581593 T1.2 OK> java -Djava.awt.headless=true plop jogamp.opengl.x11.glx.X11GLXDrawableFactory@6f34a7d8 +++ Test _without_ proper X11 authentication, i.e. DISPLAY and xauth: > xclock No protocol specified No protocol specified Error: Can't open display: :0.0 T2.1 OK> java plop No protocol specified No protocol specified Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable. (Stack trace from: GLProfile.initProfilesForDefaultDevices(..) -> NativeWindowFactory.initSingleton(..) -> JAWTUtil.<clinit>-> sun.awt.X11.XToolkit.<clinit> -> sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) T2.2 OK> java -Djava.awt.headless=true plop No protocol specified No protocol specified ... jogamp.opengl.x11.glx.X11GLXDrawableFactory@394a8cd1
* Fix Bug #589 (JAWT Offscreen-Layer resize) and Offscreen-Layer ↵Sven Gothel2012-06-306-71/+110
| | | | | | | | | | | | | | | | | | | | | | | | | setSwapInterval() deadlock; Reuse JAWT instance; Cleanup - Fixes - OSXUtil.CreateCALayer*(..): Pass layer target size (if known). This fixes Bug #589 - MacOSXWindowSystemInterface-pbuffer.m: - ALL: displayLink NULL check - setSwapInterval(..): lock only for variable setting, could deadlock when start/stop CVDisplayLink - JAWTWindow.destroy(): use 'surfaceLock' instead of 'synchronized' - Cleanup / Performance - JAWTWindow.lockSurface(): Reuse JAWT instance - MacOSXJAWTWindow: AttachJAWTSurfaceLayer0(..) -> SetJAWTRootSurfaceLayer0(..) Reflects semantic better. - DEBUG - JAWTWindow.updateBounds(..) notify of bounds change
* JAWTUtil/MacOSXWindowSystemInterface-pbuffer: Cleanup / More DEBUG infoSven Gothel2012-06-302-17/+24
| | | | | | | | | | | | | | JAWTUtil.getJAWT(..): - better local var names - one time init - add DEBUG trace JAWTUtil.<init>: - add offscreenLayer info MacOSXWindowSystemInterface-pbuffer.m: - remove warning: access of protected vars from outside class - better local var names - more DEBUG info (pbuffer texture)
* GLContextImpl/GLDrawableImpl: More fail-safe, cleanup, mark some methods finalSven Gothel2012-06-293-19/+25
| | | | | | | | | | | GLContextImpl: Cleanup - release(): simplify the conditions - destroy(): allow locked twice before (destroy case) GLDrawableImpl: - fail safe: swapBuffers - final methods: getFactoryImpl, toHexString, getGLProfile, getRequestedGLCapabilities, getFactory, isRealized, lockSurface, unlockSurface
* NativeSurface.unlockSurface(): Change fail-fast policy to fail safe tolerantSven Gothel2012-06-298-21/+26
| | | | | | | | | - This policy allows more simple destruction handling w/o validating on the top level. - Hence 'unlockSurface()' shall not throw any exception. - 'lockSurface()' keeps unchanges, clarified w/ explicit 'throws' declaration, ie will fail-fast.
* Minor cleanupSven Gothel2012-06-293-17/+16
|
* Bug #589 - Enhance snapshot/textIO test: Add offscreen mode; Add AWT ↵Sven Gothel2012-06-284-83/+298
| | | | onscreen/offscreen-layer resize test.
* AWT/SWT GLCanvas: Remove volatile of context instance, use drawable ↵Sven Gothel2012-06-282-4/+4
| | | | instance's volatile 'feature'
* NEWT GLWindow multithreading fix and annotations (see commit ↵Sven Gothel2012-06-282-72/+242
| | | | | | | | bc7503c77892a9e14b10e8b8e9ce48b148c6fa4c). NEWT GLWindow multithreading fix: - Add required locking of display(), otherwise a drawable/context destruction of another threads could lead to [still] use asynced data.
* SWT/AWT GLCanvas multithreading annotations (see commit ↵Sven Gothel2012-06-282-6/+30
| | | | 1a91ec5c8b6fd9d9db7bc115569c369fe7b38e9b) ; AWT GLCanvas remove dead code.
* SWT GLCanvas: Fix destroy(), Remove local concurrency hack & out-of-process ↵Sven Gothel2012-06-283-107/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | locking ; Revise threading code; Proper name for SWT unit tests. SWT GLCanvas: - Fix destroy() drawable.setRealized(false); is being called within dispose() method - Remove local concurrency hack [MT-0] The hack: 'final GLContext ctx = getContext(); a = null != ctx ? ctx.something() : 0;' is thread safe locally, however, w/o covering the hole use case of the caller it makes no sense to add thread safe code here - would be only an illusion. In case any of the methods are called outside of a locked state extra care should be added. Maybe we shall expose locking facilities to the user. However, since the user shall stick to the GLEventListener model while utilizing GLAutoDrawable implementations, she is safe due to the implicit locked state. - Removing out-of-process locking [MT-1] Claiming the recursive lock in the dispose/display/.. methods and _then_ issuing a complex off-thread GL task could lead to deadlock. The GL task could involve calling GLEventListener methods, which itself could try to manipulate the GLCanvas -> deadlock. Similar to [MT-0] we may need to either find a proper locking mechanism or simply ignore it and reduce functionality. TBH .. the number of scenarious of the mentioned deadlock are very limited and exotic. - Revise threading code [MT-2] Besides the other MT-* remarks, the logic whether to spawn off the GL task and determination which thread to use is too complex and redundant. (See isRenderThread(), runInGLThread() and runInDesignatedGLThread()) - Proper name for SWT unit tests. Reflect the semantics.