aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/native/macosx
Commit message (Collapse)AuthorAgeFilesLines
* Completing swap-interval implementation for OSX's CALayer usage. Closing Bug 555Sven Gothel2012-04-222-39/+85
| | | | | | | | | | | | - Based on Andres Colubri's initiative and commit 218d67fc0222d7709b21c45792d44501351939c4. - Reading real screen refresh rate ('stolen' from NEWT) - Properly handling swap-interval and vsync-to in native code - Increasing accuracy vsync-to to microseconds Tested manually w/ TestGearsES2AWT.
* OSX CALayer fix for Java7 (force CALayer to 0/0, always remove all animations)Sven Gothel2012-02-131-5/+15
|
* NEWT/OSX CALayer Animation Fix: Use '[layer removeAllAnimations]', '[layer ↵Sven Gothel2012-01-161-6/+0
| | | | removeAnimationForKey: kCAOnOrderIn, kCAOnOrderOut, kCATransition]' doesn't work
* OSX Fixes: bug 548 (another regression: pixelfmt), ctx creation failure -> ↵Sven Gothel2012-01-131-13/+16
| | | | | | | | | | no exception, - bug 548: Another regression: pixelfmt failed for 10.6.7 and/or software OpenGL - enforcing accelerated leads to no pixelformat, - using the NSOpenGLView defaultPixelFormat causes to SIGSEGV - ctx creation failure shall just lead to return null, no immediate exception
* MaxOSXWindowSystemInterface: deleteContext / releaseNSOpenGLLayer:Sven Gothel2011-12-172-10/+25
| | | | | - release on main-thread doesn't wait anymore - use recursive lock
* GLContextImpl*: createImpl() / makeCurrentImpl() refinement / robostnessSven Gothel2011-11-291-0/+15
| | | | | | | | | | | | | | | createImpl(): If successful must leave context current. makeCurrentImpl(): Is only called if context is not just created, hence the boolean parameter 'boolean newCreatedContext' is removed. This clearifies and actually cleans up the native makeContextCurrent/releaseContext call pairs. MacOSXCGLContext: CGL and NS impl. of native makeContextCurrent/releaseContext uses CGL locking to provide a thread safety. This is recommended in OS X OpenGL documentation on [shared context] multithreaded use cases. Post creation code, as seen in some pbuffer cases is moved to overriden createImpl() methods.
* MacOSX: Disable native verbositySven Gothel2011-11-262-2/+2
|
* OSX GLLayer (native): Remove CALayer add/remove/swap sublayer animation; Fix ↵Sven Gothel2011-11-261-8/+7
| | | | | | | DestroyNSWindow0 The CALayer animations (add/remove/swap) confused somewhat rendering (layer position) and even triggered a deallocation sometimes.
* OS X Layered View Part8: Generalize OffscreenLayerSurface ; Use local JAWT ↵Sven Gothel2011-11-123-40/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instance ; Applet's on OS X are working Generalize OffscreenLayerSurface - Using new OffscreenLayerSurface allows using this functionality in a clean manner, ie. no 'dirty' usage of MacOSXJAWTWindow in a JOGL GL class. - 'Promoting' OffscreenLayerSurface functionality to JAWTWindow and it's handling to GLDrawableFactoryImpl::createGLDrawable(). - Move MacOSXCGLDrawableFactory's "MacOSXJAWTWindow getLayeredSurfaceHost(NativeSurface surface)" to NativeWindowFactory "OffscreenLayerSurface getOffscreenLayerSurface(NativeSurface surface, boolean ifEnabled)" Use local JAWT instance - Only w/ a local JAWT instance per JAWTWindow it is possible to switch between offscreen-layer and onscreen. We also have to determing offscreen-layer lazy at surface lock, since only at that time we have knowledge whether it's an Applet or not. +++ ContextUpdater: Use local pthread mutex, add DEBUG output JAWTWindow/NewtCanvasAWT: Adding methods to request offscreen-layer-surface (if supported), besides 'if applet' this may trigger the new functionality. +++ Applet's on OS X are working: - OS X 10.6.4 - Safari: - Hangs for a while at start .. whole screen freezes .. approx. 10s - Sometimes crashes when Applet stops - after all our resources are released! - Keyboard input isn't assigned sometimes. - Otherwise .. works well, incl. offscreen/onscreen parenting - Firefox 8.0: - Hangs for a while at start .. whole screen freezes .. approx. 10s - Sometimes crashes when Applet stops - after all our resources are released! - Keyboard input is never assigned. - Otherwise .. works well, incl. offscreen/onscreen parenting - OS X 10.7 - Safari: - Sometimes crashes when Applet stops - after all our resources are released! - Keyboard input isn't assigned sometimes. - Otherwise .. works well, incl. offscreen/onscreen parenting - Firefox 8.0: - Sometimes crashes when Applet stops - after all our resources are released! - Keyboard input is never assigned. - Otherwise .. works well, incl. offscreen/onscreen parenting
* OSX: Fix context update callSven Gothel2011-11-121-2/+2
| | | | | It turns our that the native ContextUpdater does not work reliable in all cases, hence we need to verify if the drawable size has changed as well.
* OS X Layered View: Part7 Allow NEWT onscreen MacWindow to be used incl ↵Sven Gothel2011-11-112-2/+9
| | | | | | reparenting Test: enable NEWT 'onscreen' case
* OS X Layered View: Part6 (native) Using a root CALayer where we ↵Sven Gothel2011-11-101-22/+70
| | | | | | | | | | | | | | | | | attach/detach our GL one - it seems to be more stable, having one root CALayer attached to the JAWT_SurfaceView forever - tackles crach at GL layer destruction - proper release of all GL layer resources - now final [gl-layer dealloc] happens at very destruction of JAWT object, even though it was removed from root-layer earlier (and all other references) - see comment in MacOSXWindowSystemInterface-pbuffer.m :: createNSOpenGLLayer(..) - at least no more crash .. and resource release ASAP, but the GL-layer itself (see above)
* OS X Layered View: Part5 NEWT/AWT Interaction ; Fix NSOpenGLLayer pos ; CleanupSven Gothel2011-11-091-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Better JAWT* name for offscreen layer surface: - MacOSXCGLDrawableFactory, JAWTUtil, JAWTWindow, MacOSXJAWTWindow - FIXME: Need to get rid of the cached JAWT instance, in case we like to have dual usage of offscreenLayerSurface and onscreen. This would be done implicit by using NEWT .. hence low prio. AWTGraphicsConfiguration: - Fix create(): Use capsRequested for AWT aligned caps if capsChosen is null. (was capsChosen .. which is null) - Add updateGraphicsConfiguration() which allows to update the AWTGraphicsConfiguration. NewtFactoryAWT: - Add updateGraphicsConfiguration() .. entrypoint for AWTGraphicsConfiguration.updateGraphicsConfiguration() NSOpenGLLayer Impl: - For 'some reason' the layer's position is initially negative, fix it @ 1st 'draw' - Re-add CVDisplayLink OpenGL setting .. for what it's worth .. I don't know JAWTWindow: - Remove test setting: Only enable offscreenLayerSurface for applets if avail. (New unit test enables it seperatly) NewtCanvasAWT: - If NEWT child is offscreen, attach AWTMouseAdapter and AWTKeyAdapter to route these AWT input events to NEWT. - Don't loose-focus if NEWT child is offscreen. - Impl. NativeSurfaceHolder, NativeWindowHolder - NativeWindow is created at construction and it's GraphicsConfiguration updated at addNotify(..). - At addNotify/reparent: try harder to determine proper NEWT child size: - use preferred size if set - use minimum size if set - subtract insets from container size OffscreenWindow/WindowImpl: - Allow setSize() .. currently NOP for offscreen. - WindowImpl: Commented out recreate case for offscreen-setSize .. TEST: com.jogamp.opengl.test.junit.newt.parenting.TestParentingOffscreenLayer01AWT Passed tests: - GLCanvas - NewtCanvasAWT/OffscreenWindow
* OS X Layered View: Part2 Java/Native MacOSXCGLContext / MacOSXPbufferCGLContextSven Gothel2011-11-091-41/+286
| | | | | | | | | | | | | | | | | | | | | | | Undo 368cbf4462d7f3635c1ef4497424c360b5ccc203: - "use SurfaceUpdateListener() to notify layer", simply use MacOSXCGLContext's swap impl. MacOSXCGLContext: - NSOpenGLImpl.create(): - issues createNSOpenGLLayer() using tex-size (maybe POT) as args - attaches the NSOpenGLLayer to the JAWT layered surface host - NSOpenGLImpl.setSwapInterval() propagates interval to our NSOpenGLLayer impl. - NSOpenGLImpl.swapBuffer() (layer case): - waits for v-sync if enabled (v-sync), or until native 'draw' is finished (tearing) using our pthread/ NSOpenGLLayer synchronization. The latter uses CADisplayLink or CVDisplayLinkRef for v-sync synchronization. - flushes our local ctx - triggers our NSOpenGLLayer to 'draw' - MacOSXPbufferCGLContext create() sets the texture size independently of pbuffer size (POT/NPOT)
* OS X Layered View: Use pbuffer method (pbuffer w/ dbl buffer)Sven Gothel2011-11-064-165/+326
| | | | | | | | | - attributes +NSOpenGLPFANoRecovery +NSOpenGLPFAAccelerated - use SurfaceUpdateListener() to notify layer - swapBufferImpl() adapt to 0038e2d41825c22bdd18a7b86a8229a3fab674a3 - pbuffer: don't enforce POT tex-size to surface size, but pbuffer only - FIXME: Check POT pbuffer/tex-size for X11/Win32/.. ! -
* OSX: CGL type cleanup ; layeredSurface impl.Sven Gothel2011-11-052-126/+242
| | | | | | | | | - Use proper OSX types for NS/CGL prototypes (gluegen) and impl. - Impl layeredSurface (native): - OSXUtil: NSView backing creation - OSXUtil: AttachJAWTSurfaceLayer - CGL: NSOpenGLLayer type impl. and hook
* OSX: Enable OpenGL profile support, ie OpenGL 3.2 -> GL3 for OSX >= 10.7Sven Gothel2011-10-261-0/+8
|
* OSX: Fix CGL deleteContext()'s release call on MainThread (typo, shall have ↵Sven Gothel2011-10-161-2/+2
| | | | no ':' for void func call)
* OSX: Avoid invoking JNI or performSelectorOnMainThread in JNI if already ↵Sven Gothel2011-10-131-1/+1
| | | | mainThread
* MacOSX: Always release ctx on main thread (offscreen was frozen as well); ↵Sven Gothel2011-10-132-30/+18
| | | | | | Cleanup Warnings and OSX ContextUpdater -
* MacOSX: Fix shared ctx release [onMainThread]; Make GLContextShareSet ↵Sven Gothel2011-10-131-43/+47
| | | | | | | | | | | | | | | | | lifecycle deterministic; Remove warnings Fix shared ctx release [onMainThread] - Releasing the shared contexts caused a freeze of about 10s from one of the shared release operations. [NSOpenGLContext release] - Thorough triage concluded the workaround to release the shared ctx on the main thread. - Using enhanced GLContextShareSet, see below Make GLContextShareSet lifecycle deterministic - Programmatically control the lifecycle of tracked shared ctx allows us using 'hard' references. - Features queries for isShared() and ofc unregister a share set if all are destroyed. Remove warnings - MacOSXWindowSystemInterface.m used 'long', where 'GLint' was requested.
* JOGL/OSX: Properly utilize NSOpenGLContext update() via ContextUpdater, ↵Sven Gothel2011-10-133-27/+61
| | | | | | | | | | | | | | | which only holds the 'update' state now. Avoid calling updater() for every makeCurrent(), but if view's frame has changed only. This solves the pixel flickering experienced on OSX. - GLContextImpl:update() -> drawableUpdatedNotify() w/ comments - ContextUpdater holds context, view, old view frame and the update state. It doesn't issue NSOpenGLContext update() by itself, but allows querying and clearing the update flag. - MacOSXOnscreenCGLContext impl drawableUpdatedNotify() - register via ContextUpdater, and use it if available.
* OSX Minor Cleanups: ctx delete note (freeze when shared ctx), Better ↵Sven Gothel2011-10-121-7/+1
| | | | MainThread Thread name[s]
* NEWT/JOGL: MacOSX UpdateSven Gothel2011-09-251-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Feature related: - Added always-on-top - Added translucency - Child Window Position - AWT parent: manual traverse up the tree and calc position on screen (Problem: the parent view rect is not at the proper position, but covers the whole frame) EDTUtil related: - Works now w/ AWT ot headless (again) - OSX native JNI callbacks gathering JNIEnv properly and attaches/detaches thread. - AWT case: using AWT-Event which properly dispatches our cocoa events - MainThread (headless) case: Fork off thread w/ main class and kick off NSApp run(). This leads to same behavior as w/ AWT case. - Using DefaultEDTUtil - Cleanup MainThread (implements EDTUtil) - Currently not used as EDTUtil (osx), just as launcher - Removed EDTUtil impl code, reuse DefaultEDTUtil - Cleanup AWTEDTUtil (implements EDTUtil) - Currently not used as EDTUtil (osx)
* Fix TAB: Replace all TAB with 4 spacesSven Gothel2011-04-083-387/+387
|
* Fix On-/Offscreen and PBuffer.Sven Gothel2009-10-051-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Demos are working again: demos.jrefract.JRefract - X11, Win32, OSX -Dsun.java2d.opengl=true demos.jrefract.JRefract - X11, Win32 demos.readbuffer.Main [-GL2,-GL2ES1] -test 0 demos.es1.RedSquare - X11, Win32, OSX, EGL demos.readbuffer.Main [-GL2,-GL2ES1] -test [12] demos.es1.RedSquare - X11, Win32 - OSX not, because of the missing feature of attaching a read surface. - EGL not, because the emulation I used didn't support attaching a read surface. Emulation bug .. probably .. MacOSXWindowSystemInterface.m createContext(): - Verify if passed surface handle _is_ a view, now it could be a pbuffer etc .. handle as well. Cleanup GLDrawableImpl.setRealized(boolean realized) - Calls setRealizedImpl() (implementation) now, and only if new stated differs .. - setRealizedImpl() fixed for: MacOSXPbufferCGLDrawable: recreate/destroy WindowsOffscreenWGLDrawable: recreate/destroy WindowsPbufferWGLDrawable: no-recreate/destroy X11OffscreenGLXDrawable: recreate/destroy X11PbufferGLXDrawable: recreate/destroy WindowsWGLContext: - wglMakeContextCurrent(): uses isFunctionAvailable .. - create(): Uses WGL.MakeCurrent() and releases the created context, due to unavailable MakeContextCurrent extensions before updating the procaddress tables.
* Fix MacOSX External GLContextSven Gothel2009-09-252-25/+82
|
* Copied JOGL_2_SANDBOX r1957 on to trunk; JOGL_2_SANDBOX branch is now closedKenneth Russel2009-06-153-0/+825
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@1959 232f8b59-042b-4e1e-8c03-345bb8c30851