summaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-11-09 00:31:34 +0100
committerSven Gothel <[email protected]>2011-11-09 00:31:34 +0100
commit7bc4c218b47033cb66f4eb5e707a86a0a4e60cff (patch)
tree1421a42878680a4a1e1772fa05114c50ac70edfb /src/nativewindow/classes/jogamp
parent1055ce051fd7bd3c88724888cf8f46c75535a249 (diff)
NativeWindow: Add accessor interfaces NativeSurfaceHolder and NativeWindowHolder
- NativeSurfaceHolder interface allows access to it's implementation's NativeSurface reference. - NativeWindowHolder interface allows access to it's implementation's NativeWindow reference. Implement or extend interface w/ these accessors whereever it seems fit: - NEWT Window - GLDrawable These accessors allow lower layers to retrieve the NativeSurface/Window instance w/o knowledge of the 'upper' frameworks, ie. NativeWindow/JOGL or JOGL/NEWT. Commited in followups (due to mixed semantical changes in those files): - JAWTWindow - NewtCanvasAWT - Some NEWT impl.
Diffstat (limited to 'src/nativewindow/classes/jogamp')
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java5
-rw-r--r--src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
index 4c2b1c875..0460ccb56 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
@@ -29,6 +29,7 @@
package jogamp.nativewindow;
import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.NativeSurface;
import javax.media.nativewindow.ProxySurface;
import javax.media.nativewindow.SurfaceChangeable;
@@ -49,6 +50,10 @@ public class WrappedSurface extends ProxySurface implements SurfaceChangeable {
surfaceHandle = 0;
}
+ public NativeSurface getNativeSurface() {
+ return this;
+ }
+
public long getSurfaceHandle() {
return surfaceHandle;
}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
index 68cf8af45..bf3b649cf 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
@@ -29,6 +29,7 @@
package jogamp.nativewindow.windows;
import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.NativeSurface;
import javax.media.nativewindow.NativeWindowException;
import javax.media.nativewindow.ProxySurface;
@@ -56,6 +57,10 @@ public class GDISurface extends ProxySurface {
surfaceHandle=0;
}
+ public NativeSurface getNativeSurface() {
+ return this;
+ }
+
protected int lockSurfaceImpl() {
if (0 != surfaceHandle) {
throw new InternalError("surface not released");