aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes
Commit message (Collapse)AuthorAgeFilesLines
* Newt/AWT Event Factory: Add Mouse Wheel Event ConversionSven Gothel2012-04-242-2/+16
| | | | .. also reverse AWT rotation sign, since NEWT uses the reverse oriantation.
* NEWT/MainThread: Wait for new non daemon threads after 'main' class has ↵Sven Gothel2012-04-211-24/+102
| | | | finished, mimics proper Java behavior.
* NEWT/Android: Fix requestFocus() - run impl. on UI thread.Sven Gothel2012-04-181-3/+7
|
* NEWT/Android: Add (soft) keyboard input. Complete the Android -> NEWT key ↵Sven Gothel2012-04-162-77/+106
| | | | | | | | | | | | | | | | | | | | | | translation. Minor fixes for mouse as well. - AndroidNewtEventFactory - Android -> NEWT KeyCodes, leave out control keys like HOME, BACK, .. TBD .. - We don't consume the key event, in case we cannot map it, so the Android OS has a chance to handle the control keys. - Key-Release generates a Key Typed event. - Key/Mouse translate Android time-base (upTime) to Unix. - AndroidWindow - set our onKeyListener, using above tranlator - setFocusable(true) and setFocusableInTouchMode(true) on our SurfaceView, otherwise no key event will be delivered. Note: 'requestFocus()' must also be called on the view for key input! - Test: NEWTGearsES2Activity, which launches the soft key via: InputMethodManager mgr = (InputMethodManager) win.getAndroidView().getContext().getSystemService(Context.INPUT_METHOD_SERVICE); mgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); // shows keyboard .. and requests the focus of the view for input.
* NEWT WindowImpl: Ensure screenChange suspense animation, even w/o having the ↵Sven Gothel2012-04-161-0/+4
| | | | | | | notify method being called. This happens on android, where we just react on an already happened screen rotate. W/o animation suspend GL rendering could be disturbed or the thread could starve.
* StringBuffer -> StringBuilder (Local objects, no concurrency) ; Impacts: ↵Sven Gothel2012-04-162-3/+3
| | | | Capabilities/GLContext API 'toString(StringBuilder)'
* AndroidWindow: Fix regression (commit ↵Sven Gothel2012-04-121-1/+1
| | | | c9066a6df7a0b8612a8a0b3e5c8977268a1257e8), no destruction on surface size change.
* Android: Cleanup AndroidWindow. NewtBaseActivity: Reset FPSCounter on ↵Sven Gothel2012-04-092-43/+15
| | | | resume, Sync LauncherUtil
* NEWT/Android: Add notion of 'brokenFocusChange' for Android impl, where ↵Sven Gothel2012-04-042-12/+16
| | | | requestFocus and focusChanged is always forced
* AndroidWindow/NewtBaseActivity: Properly split functionality, remove ↵Sven Gothel2012-04-032-81/+182
| | | | | | | | | | | | | | | | | | | | | | | | android.view.Window reference and use from AndroidWindow; Force transparency flag; Multiple NEWT Windows in Activity. AndroidWindow: - Force transparency flag to EGL Capabilities chooser (see commit 0d12af05128da433aa7b6767ba5a7f6ee9bce6c4) - Keep androidFormat besides nativeFormat, used to determine transparency flag and recreation. - Move transparency style selection from AndroidWindow.instantiationFinished() -> NewtBaseActivity.setContentView(..) - Remove AndroidWindow.becomeContentViewOf(..) and add it's fullscreen layout features to NewtBaseActivity.setContentView(..) NewtBaseActivity: - General support for multiple NEWT windows. - Adding functionality removed from AndroidWindow - see above - Adding 'addContentView(..)' and 'registerNEWTWindow(..)' which, besides 'setContentView(..)' performs registration of the NEWT window for the 'onDestroy()' method. The 'add*' and 'set*' variant also handle layout etc. - Add direct methods to set fullscreen feature and transparency theme.
* Enhance and generalize AWT Threading* implementation; Minor changes ..Sven Gothel2012-03-251-60/+8
| | | | | | | | | | | | | | | | | | | | | | | | | 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!
* Reduce Thread.dumpStack() in debug mode where no negative behavior appears ↵Sven Gothel2012-03-182-2/+0
| | | | or a stack trace may be helpful.
* Adapt to GlueGen IO resource changes URL -> URLConnection for effeciency; ↵Sven Gothel2012-03-171-25/+25
| | | | | | | | | | API doc enhancements; Minor edits - API doc added/enhanced: - ShaderCode - ShaderUtil - NewtBaseActivity: Clarify method / var names
* Android Tests: Using JogAmp's ActivityLauncher (gluegen commit: ↵Sven Gothel2012-03-142-31/+109
| | | | | | | | 0cfc7847c58b51c9a26b50d905b592d1fc4c8578) - Remove jogl.android-launcher.apk in favor of generic jogamp.android-launcher.apk - All Android test code resides in jogl.test.apk (initial launcher and delegated 'real' one)
* Adapt to gluegen Properties/Security commits ↵Sven Gothel2012-03-133-76/+18
| | | | f4ac27e177f6deb444280d3b375e7d343e38bd080 and eedb4b530fb83fc59a26962bcf7847a1404092a0
* Android: Minor cleanup ; NewtBaseActivity: clear static context at destroySven Gothel2012-03-102-1/+2
|
* AndroidWindow: Fix Native PixelFormat == VisualID { <0 case, TRANSLUCENCY, ↵Sven Gothel2012-03-101-73/+53
| | | | | | | | | | | | | | | | ..} ; Generate focus event/state; onTouch() consumed - fix Native PixelFormat == VisualID { <0 case, TRANSLUCENCY, ..} - surfaceChanged(..): use 'ANativeWindow_getFormat(surfaceHandle)' if given format is generic (<0) - match used caps w/ format exactly - generate focus event/state: always focus at creation and listen to onFocusChange() - onTouch() consumed only if we mapped a NEWT event, otherwise return false. - use VisualIDHolder of already chosen config to determine native VisualID - use Log.d(MD.TAG, ..)
* NEWT/setFullscreen(v): Save new state for to-be-created windows (not yet valid).Sven Gothel2012-03-101-11/+12
|
* AndroidWindow.surfaceChanged(.., int pFormat, ..): Use passed pixel-format ↵Sven Gothel2012-03-071-4/+8
| | | | | | | if valid Turns out on Android 4.0.3 / Pandaboard ES (at least), the NDK method 'ANativeWindow_getFormat()' returns '1'.
* NativeWindow public* reorg 3/3 ; NativeVisualID -> VisualIDHolder incl. ↵Sven Gothel2012-03-061-3/+5
| | | | | | | | | | | | | | | | | | | | | | proper utilization. - VisualIDHolder: Update documentation (Exception case, etc) - NativeVisualID -> VisualIDHolder (public) - incl. generic Comparator - better doc and enum values - VID_UNDEFINED == 0 - methods shall not throw exception, but return UNDEFINED - CapabilitiesImmutable extends VisualIDHolder - All Capabilties impl. - use VID_UNDEFINED for undef. value - use final private (immutable) fields - AbstractGraphicsConfiguration extends VisualIDHolder - X11 CreateDummyWindow takes (int) visualID
* NativeWindow public-spec to public-impl reorg ↵Sven Gothel2012-03-0614-30/+46
| | | | (javax.media.nativewindow.<impl> -> com.jogamp.nativewindow.<impl>) 2/3
* Fix GLWindow/SWT-GLCanvas: set context synchronized ; Misc ChangesSven Gothel2012-03-051-0/+1
| | | | | | | | | | | | Fix GLWindow/SWT-GLCanvas: set context synchronized - GLWindow fix commit a0177c8a1048683e5d43f4712f8f9e37091d4e85. Removed explicit recursive surface lock requires recursive context locking, otherwise concurrent rendering fails. The implicit recursive surface lock within context makeCurrent() is applied after the context lock itself. Misc Changes - Fix TestPBufferDeadlockAWT, which was not using the unique profile string reference
* Complete LOCK_SURFACE_CHANGED ; Introduce NativeVisualID (Daisy chaining ↵Sven Gothel2012-03-053-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *GraphicsConfiguration) ; ... NativeVisualID: New interface for Capabilities implementations, allowing retrieval of the native 'visual id'. Impl. by WGL, X11 and EGL. JAWTWindow.lockSurface() - Detect surfaceHandle change an return LOCK_SURFACE_CHANGED (see: LOCK_SURFACE_CHANGED) EGLDrawable: - Impl. updateHandle() (see: LOCK_SURFACE_CHANGED) - use NativeVisualID for EGLGraphicsConfiguration selection to respect a native 'visual id' EGLContext.createContextImpl: Use NIO for attributes EGLDisplayUtil: Enhance eglGetDisplay w/ DEBUG code and NativeSurface / EGL_DEFAULT_DISPLAY variation EGL, XGL, WGL GraphicsConfiguration: - Don't set ALPHA_SIZE and STENCIL_SIZE if not requested in attribute list for context creation. - toString() shows proper identification, eg.: egl, x11, win32 .. EGLGraphicsConfigurationFactory: Daisy chain GraphicsConfigurationFactory for native device type (currently only X11). This allows choosing the EGLGraphicsConfiguration and hence native visual id based on EGL when invoked via the factory model (generic). In case EGLGraphicsConfigurationFactory is not suitable or doesn't produce a native visual id, it falls back the the original one. X11AWTGraphicsConfigurationFactory and X11Window: Use generic NativeVisualID which allows EGLGraphicsConfiguration implicit. *GraphicsConfiguration's DEBUG flag is pushed up to DefaultGraphicsConfiguration LOCK_SURFACE_CHANGED: - commit 006e9fe402a0a47b45fd2c4af51296aef895e8b5 - commit a0177c8a1048683e5d43f4712f8f9e37091d4e85 Impact: - Fixes EGL/GLES (wrapper/native) usage on X11, proper Xvisual selection w/ EGL - Fixes EGL/GLES (wrapper/native) usage on Windows, ANGLE works w/ NEWT and forced ES2
* NEWT/Windows lockSurfaceImpl(): Detect hdc change and result w/ ↵Sven Gothel2012-03-041-4/+19
| | | | | | | | LOCK_SURFACE_CHANGED This allows an underlying delegation/mapping to update the handles, eg.: EGLDrawable. See commit a0177c8a1048683e5d43f4712f8f9e37091d4e85
* NewtFactory: Since the platform string references are unique, let's just ↵Sven Gothel2012-03-044-20/+18
| | | | compare the references instead of a string compare
* NEWT/GLWindow.display(): No explicit surface locking/unlocking for ↵Sven Gothel2012-03-041-7/+2
| | | | | | | | | | GLDrawableHelper.invokeGL(..) - it's done implicit at makeCurrent()/release() The explicit locking takes away the locking result, eg. SURFACE_CHANGED, which is required to update the delegated drawable handles (e.g.: EGL surface handle). With the followup fix of EGLDrawable.updateHandle()'s recreate EGL surface, an EGL 'wrapper' can work on Windows (eg. ANGLE).
* NativeWindow: Relax Xinerama dependency / Rename Windows impl subfolder to ↵Sven Gothel2012-02-271-1/+1
| | | | | | | common name win32 (same as stub_include) Utilizing dlopen/dlsym in an efficient way relaxes the platform requirement of having Xinerama available. This allows using Nokia N9 MeeGo out of the box.
* ScreenMode/X11: Use common defaults in case of undefined values. X11: ↵Sven Gothel2012-02-272-9/+17
| | | | Tolerate invalid refresh rate and use default.
* NEWT Screen.getCurrentScreenModeIntern() !ScreenMode case: Attempt to get ↵Sven Gothel2012-02-261-0/+3
| | | | screen size if 0.
* NEWT/ScreenMode DEBUG_TEST_SCREENMODE_DISABLED ↵Sven Gothel2012-02-231-1/+6
| | | | (-Dnewt.test.Screen.disableScreenMode) - If set also avoid 'getCurrentScreenModeImpl()'
* NEWT: Add time costs in DEBUG mode. NEWT/XRandR: Reuse ↵Sven Gothel2012-02-234-71/+107
| | | | | | | | | | | XRRScreenConfiguration to reduce perf hit on Linux ARM Omap4. On Linux ARM Omap4, we experience a performance hit when using XRandR: 1st call of XRRSizes: ~ 1668 ms Each call of XRRGetScreenInfo: ~ 1109 ms Even though XRRGetScreenInfo is cached in NEWT's X11Screen initialization, overall init time is ~2s, far too expensive.
* EGL Display Lifecycle Robustness Patch (impl. workaround)Sven Gothel2012-02-222-6/+6
| | | | | | | | | | Added EGLDisplayUtil helper class managing the lifecycle of the EGL display handle recursively. This class is required, due to implementation bugs within EGL where EGL.eglTerminate(long) does not mark the resource for deletion when still in use, bug releases them immediatly. This fixes unit test com.jogamp.opengl.test.junit.jogl.acore.TestInitConcurrentNEWT on Linux ARM w/ Omap4 and Tegra2.
* DEBUG Output: More thread-names to drawable/context lifecycle; Remove ↵Sven Gothel2012-02-222-8/+7
| | | | massive '!!!' occurence
* 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).
* 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-181-8/+36
| | | | | | | | | | | | | | | | | | 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-181-97/+143
| | | | | | | | | | | | | | | | | | 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)
* NEWTWindow Focus: Skip requestFocus() if already owning focus; ↵Sven Gothel2012-01-161-3/+9
| | | | | | | | | | | 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-161-2/+2
| | | | | | | | | | | | | 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-131-3/+23
| | | | | | | 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-243-10/+5
|
* NEWT Screen: Add virtual top-left origin getX()/getY() ; WindowsWindow.c: ↵Sven Gothel2011-12-2412-60/+98
| | | | | | | | | | | | | | | | | | 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