| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
to simplify usage.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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()
|
| |
|
|
|
|
| |
resource at recreation or it's possible other drawables
|
|
|
|
| |
AnimatorControl to pause rendering.
|
| |
|
|
|
|
| |
made references created in double checked locks volatile.
|
| |
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| | |
and getChosenCapabilities() return immutable instances. Add cloneCapabilities() to create a mutable clone of an immutable set of capabilities.
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
NEWTEventConsumer and AWTTreeLock
The unit test for NEWTEventConsumer and AWTTreeLock,
tests previous commit 'JAWTWindow: Avoid AWTTreeLock' b0b1e3fb9c0f915cdf8d237c0f61a9d08ca83b01
|
| |
| |
| |
| |
| |
| |
| | |
Use native implementation for getLocationOnScreen() if available.
If unavailable call AWT's implementation only in case the AWT TreeLock is hold by this thread.
Finalize methods ..
|
| |
| |
| |
| | |
NativeWindow X11.
|
|/
|
|
| |
NEWT WindowsWindow GetRelativeLocation() native implementation to GDI as well.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NEWT's removed:
Window: destoy(boolean unrecoverable)
Display/Screen: get/set DestroyWhenUnused(boolean)
We behave as follows:
- Window.destroy() always decr Screen's reference counter,
which issues destruction when reached zero.
Then Screen does the same for Display ..
- Window.destroy() keeps alive all references,
hence it can be always recreated via setVisible(true).
- Window.destroy() ensures Display's EDT is stopped
if display is destroyed.
- Window.invalidate() actually removes all Object reference,
hence it cannot be recreated or used after it.
This method exist to support a way to cleanup memory, GC.
All test passed on Linux/X11 and Windows
|
|
|
|
| |
AWT wait period.
|
|
|
|
|
|
|
|
|
|
| |
Preparation to support multiple devices on one machine,
hence adding the unitID a unique ID/index of the associated GPU, or GPU affinity.
Adding getUniqueID() to return a cached semantic unique string id for the device.
This was removed from the temp. impl in JOGL's GLContext, added unitID.
All other changes just adapt to the above.
|
|
|
|
|
|
|
| |
(visibility, displayed)
Ensure that at least one frame has been rendered after returning from the functions.
This removes the hack of polling a while for a rendered frame.
|
|
|
|
|
|
|
|
|
|
| |
NEWT: Add optional eager native initialization
of Display and Screen to overcome a possible chicken/egg situation.
This is useful to be able to request the AbstractGraphicsDevice, via getGraphicsDevice().
Otherwise the abstract device won't be available before
the dependent components (Screen and Window) are realized.
Throw NativeWindowException in case native creation failed.
|
| |
|
|
|
|
|
|
|
|
|
| |
and NewtVersion.
Adapt to GlueGen Version changes:
b735755815312b5fe2c003642de60711be1cd645 .. 556c7e70d3d57aa99b5787b1e4d8a7b1c299ed3f
Show information of all subcomponenet.
|
|
|
|
|
|
|
|
|
|
| |
support multi devices & displays.
Currently only the X11 Display connection is implemented to support multiple device connections.
Other platforms may follow.
This allows correct mapping and caching of higher level resources,
eg. ProcAddressTable, GL version mapping etc with respect to the display device.
|
|
|
|
| |
verification
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
comments
Seperated unit tests (newt/awt/headless)
- no more *CORE* tests
- junit.run.newt.headless: all NEWT headless (no-AWT) tests,
without any AWT classes and with -Djava.awt.headless=true.
Disabled for 'isOSX'.
- junit.run.newt: all NEWT non AWT tests (same as above),
but with full AWT. This test is not enabled via junit.run.
Disabled for 'isOSX'.
- junit.run.awt: all AWT tests without NEWT
- using newt.event.jar to add AWT agnostic NEWT event adapter
- junit.run.newt.awt: all NEWT + AWT tests
- junit.run: junit.run.newt.headless,junit.run.awt,junit.run.newt.awt
- swizzling around a few tests to achieve the above:
TEST rules:
- A runnable unit test must start with 'Test'
- Only pure NEWT tests must have 'NEWT' in their name
- AWT tests must have 'AWT' in their name.
- AWT + NEWT tests must have '.newt.' in their package name, hence
- Pure AWT tests (without NEWT) must not have '.newt.' in their package name
|
|
|
|
|
|
|
|
|
|
| |
Lifecycle.reparentActionPre()/reparentActionPost() -> pauseRenderingAction()/resumeRenderingAction()
for a more generic use, ie reparenting and screen mode change.
ScreenMode change: No more visibility/fullscreen changes, no more locking,
just pause/resume animation.
X11 ScreenMode set: move from thread/wait to simple polling over time (timeout)
|
|
|
|
|
|
|
|
| |
ScreenModeUtil fix:
- return 'null' for an empty list, check if list is null or empty.
- remove 'validate'
Window: TIMEOUT_NATIVEWINDOW 500 -> 1000 ms
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Fix ScreenMode
- Avoid NPE/Out-of-memory: Return zero sized NewIntArrays instead of NULL.
Fix Windows Build
- ScreenMode still has a regression
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--------------------------------------------------
Per default, creating a NEWT Display tries to reuse an existing one
to match the native platform display semantics closer.
The 'key' for a Display reuse is it's FQN.
The difference with the old 'reusage' is the removal of the TLS binding,
hence we use a global pool.
The user is able to 'override' this 'reuse' behavior with
'NewtFactory.createDisplay(String name, boolean reuse)'.
However, it is not recommended for AMD drivers (see above).
Screen's are always reused if possible.
The 'key' for a Screen reuse is it's FQN,
hence it's reuse depends on the Display reuse.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
X11Util:
Removed TLS semantics, since TLS name -> dpy mapping is erroneous at this point.
Added lists for open connections (for optional later shutdown).
AbstractGraphicsDevice interface and implementations:
Adding 'close()' method allowing native implementations the ability
to close the native resource, ie X11GraphicsDevice.
This becomes necessary for 'on the fly' created X11 Display connections,
ie in X11AWTGLXGraphicsConfigurationFactory, which enables closing.
Utilize 'close' call in use cases: GLCanvas, GLJPanel and AWTCanvas.
Remove active X11 Display creation in X11JAWTWindow,
as a last resort, use the X11SunJDKReflection method.
Used for reference only, not active rendering etc,
mostly for on the fly AWT parenting in NewtFactoryAWT.
However, these 'on the fly' references are erroneous and should be remodelled,
ie passice and active X11GraphicsDevice's ..
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Fix AnimatorBase: Finally using 'com.jogamp.opengl.util.AWTAnimatorImpl',
wrong FQN lead to never use it, hence deadlock in case of AWT usage (AWT-EDT).
- Animator
- remove volatile for synced state isAnimated
- new state isPaused, since shouldPause give the wrong answer for isPaused()
- Cleanup wait condition for lifecycle tasks (start/stop/pause/resume)
- 'AnimatorImpl' -> 'DefaultAnimatorImpl implements AnimatorBase.AnimatorImpl'
- 'AWTAnimatorImpl implements AnimatorBase.AnimatorImpl',
hence no derivation of a complete overwritten AnimatorImpl needed.
- GLWindow.destroyActionPreLock()
- Stop animator if unrecoverable, else pause only.
Tests:
- No explicit animator stop, hence tests implicit stop/pause
by GLDrawableHelper and/or GLWindow.
|
|
|
|
|
|
|
|
|
|
|
| |
- 'destroyAction' -> 'destroyActionPreLock' 'destroyActionInLock',
to be able to stop animation before locking.
GLDrawableHelper.invokeGL() dispose case (initAction == null):
- pause animator if animating before makeCurrent (locking)
GLCanvas/GLJPanel dispose: recreate case
- resume animator if was animating
|
|
|
|
| |
NativeWindowFactory added nonAWT ToolkitLock create method
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- New type definition:
ScreenMode { MonitorMode { SurfaceSize { Resolution, bpp }, ScreenSizeMM, refreshRate }, rotation },
where Resolution and ScreenSizeMM are of type DimensionReadOnly
- ScreenMute instance is
- immutable
- hashable
- cloneable
The above allows fast query and storage w/o redundancies.
More than 300 modes via permutation could be expected.
ScreenMode impl. changes:
ScreenImpl:
To be implemented methods by native specialization:
- protected int[] getScreenModeFirstImpl()
- protected int[] getScreenModeNextImpl()
- protected ScreenMode getCurrentScreenModeImpl()
- protected boolean setCurrentScreenModeImpl(ScreenMode screenMode)
The data unification etc is implemented generic using ScreenModeUtil
and the 'int[]' streaming.
ScreenModeStatus holds all ScreenMode related data
and provides a locking strategy.
ScreenModeListener provides a callback facility for ScreenMode change events.
- Screens listen to ScreenModeStatus, so all FQN referenced Screen's receive the change.
- Windows listen to Screen, to take appropriate action for the event (fullscreen, reshape).
Misc:
- Screen/Display: promoting 'addReference'/'removeReference' to public interface,
so a user may trigger construction/destruction (-> junit tests, plus other clients than WindowImpl).
- Gears: 'setSwapInterval' at 'reshape' instead of 'init',
so it's reset when ScreenMode is changing.
-
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
18bf27fa86da1f26fd085565f501736816d2f2e9
Conflicts resolved:
src/newt/classes/com/jogamp/newt/impl/WindowImpl.java
src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java
src/newt/classes/com/jogamp/newt/impl/x11/X11Window.java
src/newt/native/WindowsWindow.c
src/newt/native/X11Window.c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- setSizeImpl/setPositionImpl/reparent -> reconfigureWindowImpl
- setVisible(boolean) is state checked (500ms) for better reliability
on resource creation. Guarantees valid surface.
- reparentWindow: start pos of child -> top is current position on screen
- reparentWindow: Recheck success (setVisible), if failed fall back to recreate,
which gets rid of a lost child windows (1/20) ..
- reparentWindow: if size failed, reconfigure for size again
- add toggle decoration
- unify nfs_ size/pos state
- WindowsWindow.c/X11Window.c: Unify size/pos settings
- X11Window.c:
- NewtWindows_setFullscreen: use 'root of screen' instead of 'default root of display'
- Adding SubstructureNotifyMask incl event semantics
- Parse ReparentNotify (debugging of reparenting)
Misc:
- Add native getLocationOnScreen() impl to avoid possible AWT deadlock
- setSize/setPosition/setFullScreen -> EDT
- More documentation on expected native implementation semantics
|
| |\ |
|
| | |
| | |
| | |
| | |
| | | |
when true the request is send after configuring the window
otherwize before decoration. needs tweeking to ensure that the fullscreen is on-off
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Added windows implemenation for screen mode change lifecycle and screen rotation
screen modes.
+++++++++++
Added getHighestAvailableRate() to Screen mode as a helper function
which loops over the available rates of this screen mode and returns the
highest available.
Added toString impl to ScreenMode.
+++++++++++
Unit Tests: TestScreenMode01NEWT,TestScreenMode02NEWT are modified adding the gears as GL
event listeners.
+++++++++++
Notes:
1- Screen modes with bits per pixel values not same as current are currently filtered out.
2- Since windows stores the Display settings differently you will see some duplicate values
which the documentation says is usual. These modes are not filtered out in getScreenModes().
Keeping values same as provided from windows enum.
3- BitsPerPixel is currently natively read on windows only.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Added screen rotation change capability with impl for X11 (using Xrandr)
com.jogamp.newt.Screen: added 2 methods which cover screen roation lifecycle
setScreenRotation(int rot): Change the Screen Rotation to
one of the rotations defined in ScreenMode, namely:
ROTATE_0, ROTATE_90, ROTATE_180, ROTATE_270
int getCurrentScreenRotation(): Get the Current screen rotation
returns -1 if not implemented natively.
+++++++++++++++++++++++++
Notes:
1- At init the original rotation is called natively and cached,
when screen is destroyed the rotation is reverted.
2- On X11 with Nvidia: you need to edit /etc/X11/xorg.conf:
Add the following line:
Option "RandRRotation" "on"
in Section "Device" after BoardName.
+++++++++++++++
Added TestScreenMode02NEWT which includes 4 tests
1- Rotate 90
2- Rotate 180
3- Rotate 270
4- Rotate with screen mode change
should fail if screen rotation not implemented natively.
(4) withh fail if screen mode not impl natively as well.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Added screen mode change capability with impl for X11 (using Xrandr)
com.jogamp.newt.Screen: added 4 methods which cover screen mode lifecycle
ScreenMode[] getScreenModes(): Get list of available screen modes
returns null if not natively implemented. On first call
will fetch the list thru a set of native calls and stores them
in the ScreenModeState. Consequent calls will retreive the data
from the ScreenModeStatus object. Native calls are done on creation stage,
so subsequent API calls will return cached data.
int getDesktopScreenModeIndex(): Get the Current Desktop Screen mode index
returns -1 if functionality not natively implemented. The index
returned refers to the screen mode location in the ScreenMode array.
Used to get initial mode for reverting back. Initial call will retreive the
mode thru a native call (done on initialization), subsequent API calls will retreive it
from the ScreenModeStatus object.
Note: If Window is closed without reverting back and screen is set to unreachable.
The api will revert the screen. A call to destoy(unreachable) is needed
for revert to take place on close
windowDestroyNotify(WindowEvent e) {
...
window.destroy(true);
}
short getCurrentScreenRate(): Get the current screen rate
returns -1 if not natively implemented. Used along with getDesktopScreenModeIndex
You can identify the current screen mode (w x h) and the rate. Initial call will retreive the
mode thru a native call (done on initialization), subsequent API calls will retreive it
from the ScreenModeStatus object.
void setScreenMode(int modeIndex, short rate): change the screen mode
to the mode index which refers to one of the screen modes retreived by getScreenModes()
and a rate which can be one of screenModes.getRates(). If the rate provided doesnt belong
to the list of available rates the first rate is chosen.
build-newt.xml: Added header files generation for Screen and Display
Added Xrandr syslink to x11 based builds.
+++++++++++++
Fullscreen for X11Window:
Added Fullscreen WM Hint for X11Window. Event of Fullscreen is
sent to the display root. When changing to fullscreen the request is send
after configuring the window otherwize before decoration.
Not Stable yet, needs tweeking on other Linux dist. Window looses focus
after switching to fullscreen mode.
+++++++++++++++
Added TestScreenMode01NEWT which includes 4 tests
1- Fullscreen change mode
2- Screen mode change
3- Screen change with fullscreen (revert screenmode then revert fullscreen)
4- Screen change with fullscreen (revert fullscreen then revert screenmode)
should fail if not screenmode not implemented on platform.
+++++++++++++++
Cleaned up some unused imports
|