diff options
author | Sven Gothel <[email protected]> | 2010-10-26 04:35:15 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-10-26 04:35:15 +0200 |
commit | a34d04ad4d9a46a30772b3984baf692a59e8b608 (patch) | |
tree | a0c6e9d958554c09479fa078f494001140d3776b /src/newt/native/ScreenMode.h | |
parent | 61e6325eed2337d791479ddcd2eb8da928b4f94c (diff) |
NEWT: ScreenMode changes
- 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.
-
Diffstat (limited to 'src/newt/native/ScreenMode.h')
-rw-r--r-- | src/newt/native/ScreenMode.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/newt/native/ScreenMode.h b/src/newt/native/ScreenMode.h new file mode 100644 index 000000000..0a760d54a --- /dev/null +++ b/src/newt/native/ScreenMode.h @@ -0,0 +1,16 @@ +/** + * WARNING: must be synced with com.jogamp.newt.util.ScreenModeUtil#streamIn*(int[]) + */ + +#ifndef _SCREEN_MODE_H +#define _SCREEN_MODE_H + +#define NUM_RESOLUTION_PROPERTIES 2 /* width, height */ +#define NUM_SURFACE_SIZE_PROPERTIES 1 /* bpp */ +#define NUM_MONITOR_MODE_PROPERTIES 3 /* ScreenSizeMM[width, height], refresh-rate */ +#define NUM_SCREEN_MODE_PROPERTIES 1 /* rotation */ + +#define NUM_SCREEN_MODE_PROPERTIES_ALL 8 /* count + the above */ + +#endif + |