aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
Commit message (Collapse)AuthorAgeFilesLines
* Hide dump of screen origin/size behind DEBUG flag.Sven Gothel2012-02-191-1/+3
|
* OpenGL ES/EGL OverhaulSven Gothel2012-02-132-21/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* NEWT: Fix deadlock w/ AWT parent (NewtCanvasAWT) - focus window @ creation ↵Sven Gothel2012-02-081-3/+7
| | | | after releasing parent lock (AWT lock).
* Fix Bug 516 (Determine Java Version) / Fix OS X 10.5 linkage (weak ↵Sven Gothel2012-01-221-0/+4
| | | | | | | | | | | | | | | framework, NEWT) - Fix Bug 516 (Determine Java Version). See gluegen: 64639b805a32338385421f168e12c1ef7f749d00 - Fix OS X 10.5 linkage (weak framework, NEWT) - Use weak framework linkage for all modules and frameworks: AppKit, QuartzCore, Cocoa, OpenGL, JavaNativeFoundation - NEWT: Handle NS exception while calling OS X >= 10.6 only methods: - 'setAllowsConcurrentViewDrawing()' - 'setCanDrawConcurrently()'
* NEWT/OSX: Window close (release) on main thread, ensuring no 'main thread' ↵Sven Gothel2012-01-191-1/+2
| | | | event is pending
* NEWT/X11: Fix Insets determination for undecorated / child window.Sven Gothel2012-01-181-53/+86
| | | | | | | | | | | | Due to latest changes, a bug is disposed where the native 'updateInsets' attempts to determine the window insets by it's parent window (fall-back). The latter works only in case of a top-level window. Adding query to the WM whether the window is decorated (top-level) or not. Attempt to use the fall-back parent window method in case of a decorated window. This whole inset code based on the parent window is probably completly redundant, nevertheless we keep it alive until further notice.
* NEWT: Use accessors to read/write postion and size, allowing better trace ↵Sven Gothel2012-01-189-132/+124
| | | | | | | | | and controlling autoPosition; Restrict more fields to private where possible. WindowImpl's position and size is made private and accessed by it's getter and setter (definePosition/defineSize). This allows better tracing of value changes and ensures autoPosition is set to false.
* NEWT/OSX: Cleanup 'javaWindowObject' @ window-close & avoid NPE; Disable ↵Sven Gothel2012-01-184-16/+78
| | | | | | | | | | | | | | | | | | lostFocus (resignKeyWindow) when in fullscreen mode; Ignore invalid key release/type events. - Cleanup 'javaWindowObject' @ window-close & avoid NPE Ensure that the direct window.close() impl. removes the global reference and that all use cases check for NULL pointer. - Disable lostFocus (resignKeyWindow) when in fullscreen mode Similar to the X11 KDE bug, OS X delivers a lostFocus event which we prevent from being processed in fullscreen mode. - Ignore invalid key release/type events In case of offscreen/onscreen switching (fullscreen/reparenting) via destroy/create, the still pressed key would be send to the new window and repeat the action (key typed). State validation discards the double processing.
* Newt: Add fullscreen for offscreen windows (currently OSX only); Focus ↵Sven Gothel2012-01-182-98/+173
| | | | | | | | | | | | | | | | | | handling; Misc. - Add fullscreen for offscreen windows (currently OSX only), - Focus handling - requestFocus() @ creation - remove requestFocus() delay in setFullscreen() since focus loss in fullscreen mode is caused by a KDE 'misbehavior' in general. See X11Common.c FS_GRAB_KEYBOARD, an experimental focus loss prevention, disabled due to it's behavioral impact of removing the ability to use WM keyboard commands (task switcher). - Remove pending events waiting longer than TO (1200ms)
* NEWT/OSX: Cleanup NewtMacWindow header (sort, fix and add declarations); ↵Sven Gothel2012-01-173-123/+129
| | | | Remove warning of unused var
* NEWTWindow Focus: Skip requestFocus() if already owning focus; ↵Sven Gothel2012-01-162-4/+10
| | | | | | | | | | | setFullscreen() requests focus 'later'. We shall rely on the focus state, hence we can skip 'requestFocus()' if we already own the focus. This allows a fast-path especially when called from native code (mouse click). Request focus 'later' on setFullscreen() allowing native WM to complete event handling, this is required especially on X11 to guarantee a focused fullscreen window.
* NewtCanvasAWT: Handle 'lost' child and fullscreen case.Sven Gothel2012-01-162-31/+62
| | | | | | | NewtCanvasAWT may loose it's parent role (reparenting). In such cases it shall no more handle focus events. Focus handling is also no more desired in case the child is in fullscreen mode.
* NEWT childWindow: No autoPosition, use 0/0 as default.Sven Gothel2012-01-161-4/+10
|
* NEWT/OSX Pointer Invisible Fix: 10.6.* responder declarations & test ↵Sven Gothel2012-01-164-11/+41
| | | | | | | | | | | | | focus/isInside On OS X 10.6.8 the lack of responder method declarations (mouseEntered, ..) lead to ignore the impl. callbacks. 'isMouseInside' cannot rely on 'mouseExit'/'mouseEntered' when setMouseInvisible() is being called, deduce it manually. focusLost == mouseExit (OS X behavior), hence focusGained needs to set mouse invisible/visible in case it's requested.
* NEWT/OSX Performance Fix: Cache CGDisplayScreenSize() result, since it's ↵Sven Gothel2012-01-132-8/+80
| | | | | | | ridiculous slow Each call to CGDisplayScreenSize() took around 6ms (5ms .. 20ms, avrg 6ms) which added up to ~2s for ~400 Screen modes.
* GLContext/NativeSurface Impl's toString(): Add lock.toString()Sven Gothel2012-01-082-2/+3
|
* GLContext*/GLDrawableHelper: Fix consistency of recursive ↵Sven Gothel2012-01-081-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* NEWT/Android: MonitorMode: Don't validate refreshRate (0 on some devices); ↵Sven Gothel2011-12-262-3/+6
| | | | AndroidWindow: Trigger ScreenModeChanged only if Screen is already valid.
* ScreenImpl.ScreenMode: getOrAdd current ScreenMode.Sven Gothel2011-12-241-14/+20
| | | | | On Gnome it happend that the current mode was not 'scanned' by RandR, hence adding it if not existing helps stability.
* NEWT Windows/X11: Remove missed negative coordinate restrictions.Sven Gothel2011-12-244-16/+9
|
* NEWT Screen: Add virtual top-left origin getX()/getY() ; WindowsWindow.c: ↵Sven Gothel2011-12-2413-74/+147
| | | | | | | | | | | | | | | | | | allow negative coordinates - ScreenImpl: - Use Point & Dimension for holding virtual origin and size - updateScreenSize() -> updateVirtualScreenOriginAndSize() - DimensionImmutable getNativeScreenSizeImpl() -> void getVirtualScreenOriginAndSize(Point virtualOrigin, Dimension virtualSize) - WindowImpl setFullscreen(true): Use Screen virtual origin - WindowsWindow.c - For x/y coords use GET_X_LPARAM/GET_Y_LPARAM which casts '(int)(short)' to preserve negative coordinates. - NewtWindow_setVisiblePosSize() allow negative coordinates
* Fix regression of commit: 3f5df93484a2ea97c6e51a717f05d9ddcec64d84 (compile ↵Sven Gothel2011-12-231-2/+2
| | | | error, private field access)
* NEWT/OSX MacWindow.close(): More conservative closing approach.Sven Gothel2011-12-232-6/+14
| | | | | | | | | | | Closing: - Java: Set handle to null - Native: - Don't release the NSView explicit, but rely on NSWindow's release - Don't use NSWindow close() but simply call release() instead. The latter doesn't produce a crash SIGSEGV on exit in some cases. OSX 10.7.2, NV GPU
* Screen: width/height reflects virtual Screen size (-> big-desktop)Sven Gothel2011-12-2312-52/+112
| | | | | | | | | | Add updateScreenSize() utilizing new getNativeScreenSizeImpl() to set/update the virtual Screen size. This replaces setScreenSize() where the ScreenMode dimension was being used which doesn't reflect the virtual size. ScreenMode Test Impact: We cannot assertEquals(sm.getRotatedWidth(), screen.getWidth()), since ScreenMode size != virtual size.
* NEWT/X11: Fix regressions of commit ↵Sven Gothel2011-12-233-9/+13
| | | | f3f794fe37a7e33a771a4a702f3f46ead4dc6d03: Unresolved symbols. Disable VERBOSE.
* NEWT Multi-Monitor 1/2: Allow negative window position; Validate Screen-Index;Sven Gothel2011-12-2327-1155/+1448
| | | | | | | | | | | | | | | | - Allow negative window position, using flag 'autoPosition' to mark a custom user position. This impacts Windows and X11 window creation code, which supports native auto positioning. - Screen: Validate Screen-Index. In 'big-desktop' mode the Screen index is always 0. This is true for X11 with Xinerama enabled and MS-Windows in general. Platforms w/o multiple Screen support always use index 0. - X11: Separate X11 Display/Screen/Window native code in their respective C files - Windows test scripts: use '%*' to catch all arguments - Add missing (c)
* NEWT OSX: Add native ScreenMode impl. - TODO: Programmatically set the ↵Sven Gothel2011-12-203-12/+239
| | | | | | | rotation! (How to ?) Get/Set ScreenMode impl on OSX. Set is limited to resolution and size, since I don't know how to change the rotation.
* NEWT initScreenModeStatus(): Issue setScreenSize() to update screen size ↵Sven Gothel2011-12-202-2/+13
| | | | | | | | based on native RANDR (more correct) Clarify Screen's getWidth(), getHeight() values (-> rotated) Also add DEBUG output for collected native modes and nativeIdx mapping.
* Fix bug 531. Thx to Sebastien (finding) and Julien (fixing) it.Sven Gothel2011-12-181-3/+3
| | | | | | | https://jogamp.org/bugzilla/show_bug.cgi?id=531 Sorry .. we normally don't add credits in these git logs, maybe we should change that to encourage contributors!?
* CgDynamicLibraryBundleInfo: Add TempJarCache usage for atomic native jar (of ↵Sven Gothel2011-12-181-0/+2
| | | | | | | atomic java JAR) - GLProfile, NWJNILibLoader, NEWTJNILibLoader: Issue Platform.initSingleton() upfront within priviledge block.
* New Interface 'OffscreenLayerOption', impl. by JAWTWindow (impl) and ↵Sven Gothel2011-12-172-21/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix GLDrawableFactory lack of GLProfile initialization in case get*Factory() ↵Sven Gothel2011-12-132-2/+0
| | | | is called 1st, add tests. Add performance numbers of init/shutdown in tests.
* JOGLNewtApplet1Run: Config and add GLEventListener before hooking ↵Sven Gothel2011-12-111-7/+7
| | | | GLWindow/NewtCanvasAWT to AWT Applet Container
* Fix concurrency bug of GLProfile initialization ; Fix SharedResourceRunner ↵Sven Gothel2011-12-113-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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
* NEWT EVENT_MOUSE_WHEEL_MOVED: Fix Bug 413 - Generate proper mouse wheel events.Sven Gothel2011-12-026-16/+75
| | | | | | | | | | > 0: UP < 0: DOWN See MouseEvent.getWheelRotation() for details. OSX/Windows: Default to wheel 'button' 1 OSX: Properly report '<0' X11: Synthesize wheel events by mapping buttons 4/5 and 6/7 to wheel 1 and 2.
* New GLProfile.ShutdownType: SHARED_ONLY / COMPLETE - Enhance/Fix Lifecycle ↵Sven Gothel2011-12-011-4/+1
| | | | | | | | | | | | | | | | | | | | | Management - Leave Platform, .. TempJarCache untouched. - GLDrawableFactoryImpl*: Leave DynamicLibraryBundle(lib-binding) untouched, for NativeLibrary, JNILibLoaderBase (JNI libs), .. consistency. - SHARED_ONLY: shutdown shared GLDrawableFactoryImpl* resources and NativeWindowFactory - COMPLETE: additionally shutdown GLContext* Clear all cached GL/GLX proc-address and device/context mappings. - Use new "GLProfile.shutdown(GLProfile.ShutdownType.SHARED_ONLY)" in Applets - X11GLXDrawableFactory Shutdown: Uncomment close/destroy of shared resources. - JAWTWindow.destroy(): Close the delegated device. In case it's X11 this closes the exclusive opened X11 Display.
* Fix Bug 522: NEWT requestFocus() causes a crash if !isNativeValid()Sven Gothel2011-12-011-1/+1
|
* Adapt to GlueGen commit 7e6cf46ed2e0e9772f79e06437596056efa8c682: ↵Sven Gothel2011-12-011-1/+1
| | | | JNILibLoaderBase addNativeJarLibs(..)
* Move manual GDI utils to GDIUtil ; Minor cleanup.Sven Gothel2011-12-012-6/+2
| | | | | | RegisteredClassFactory: Reference the factories itself instead of the RegisteredClass. This enables the shutdown hook to clear the factories state, which is required for proper recreation.
* JOGLNewtApplet1Run: Issue GLProfile.shutdown() to adapt to the 'new' plugin ↵Sven Gothel2011-11-301-3/+5
| | | | | | | | | | | | lifecycle. Applet 'restart' (init.start.stop.destroy .. init.start...) didn't work on Windows browsers (Firefox, Safari, Chrome, ..) w/ JVM 6u26..6u29. It seems that after destroy we loose the ClassLoader already (plugin2) hence we need to bind to the native resources again. Solution is to map the JOGL lifecycle of GLProfile [initSingleton()..shutdown()] to the Applet's [init..destroy].
* NEWTMacWindow:View: Make lock recursive ..Sven Gothel2011-11-292-15/+26
| | | | | Attempt to fix the shared-context-multithreading bug (eg. TestSharedContextVBOES2NEWT2) via proper locking .. but seems not to be sufficient (yet).
* NEWT MacWindow: the softLock (pthread mutex) is now always blocking (remove ↵Sven Gothel2011-11-291-18/+0
| | | | non blocking code)
* NEWT ScreenMode: Use unified ScreenMode in impl; X11Screen: Be verbose if TO ↵Sven Gothel2011-11-282-7/+7
| | | | reached, ie not successfully changed mode.
* NEWT MacWindow: Fix positionChange() Usage ; Fix getLocationOnScreenImpl()Sven Gothel2011-11-271-32/+27
| | | | | | | | | - Native invocation of positionChange(x,y) uses screen coordinates of client area. Manual invocation shall respect the semantics - hence calling super.positionChanged w/ client coords. - getLocationOnScreenImpl() shall return the screen coordinates of the client area - Use getTopLevelLocationOnScreen(), ie substract Insets of getLocationOnScreenImpl()
* MacWindow: Impl. DriverUpdatePosition; Alias position2TopLevel -> ↵Sven Gothel2011-11-273-70/+84
| | | | | | | | getLocationOnScreenImpl Since the MacWindow position needs to be changed in concert with the parent, we need to be triggered to update ours. AWTParentWindowAdapter issues 'updatePosition()' if DriverUpdatePosition is implemented.
* NEWT: Add DriverUpdatePosition interface; Clarify NativeWindow API doc ↵Sven Gothel2011-11-272-1/+10
| | | | | | | (position) DriverUpdatePosition: Interface tagging driver requirement of absolute positioning, ie. depend on parent position.
* NEWT OSX: Add stopNSApplication(), revert commit ↵Sven Gothel2011-11-273-9/+70
| | | | c26d6005e1fe74e9aee01d9d72942f566884fcd2
* MacOSX: Disable native verbositySven Gothel2011-11-261-1/+1
|
* NEWT OSX closeWindow: simple close, no extra view detachment etcSven Gothel2011-11-261-3/+0
|
* Revert some changes: X11Screen/RANDR, X11Util (XInitThreads/XLockDisplay), ↵Sven Gothel2011-11-262-6/+18
| | | | | | | | | | | | | | | NEWT XDisplay Locking Revert X11Screen RANDR commit 8cecd0c2963d982aa119cbb07698e56b9c271188, ie. use default 'render' display connection, best results on Ubuntu, Solaris, CentOS (no failures). Revert X11Util (XInitThreads/XLockDisplay) rational logic, commit 0314be79a7a93931a74fe4322bc78e699d7741e9, X11Util.HAS_XLOCKDISPLAY_BUG:=true and X11Util.XINITTHREADS_ALWAYS_ENABLED:=true. Which enables always utilizing XInitThreads() either before or after AWT initialization, as well as disable all XLockDisplay/XUnlockDisplay locks. Rever NEWT XDisplay X11 basic Locking commit 50100b85ce5fde48788efbc2211b26fb9d7c9dfd, ie use null locking if X11Util.HAS_XLOCKDISPLAY_BUG and X11Util.XINITTHREADS_ALWAYS_ENABLED.