summaryrefslogtreecommitdiffstats
path: root/src/newt/classes/jogamp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2011-08-09 20:19:30 +0200
committerSven Gothel <[email protected]>2011-08-09 20:19:30 +0200
commit113874511f5a897c0faaabbb98fe80ec8f322157 (patch)
tree3c1726bcf8be736894147b40df7cd36bad23882e /src/newt/classes/jogamp
parentda0391975092bbd1adce296477646b004c3562c3 (diff)
Complete Android driver reloc (constructor)
Diffstat (limited to 'src/newt/classes/jogamp')
-rw-r--r--src/newt/classes/jogamp/newt/DisplayImpl.java2
-rw-r--r--src/newt/classes/jogamp/newt/ScreenImpl.java2
-rw-r--r--src/newt/classes/jogamp/newt/WindowImpl.java28
3 files changed, 21 insertions, 11 deletions
diff --git a/src/newt/classes/jogamp/newt/DisplayImpl.java b/src/newt/classes/jogamp/newt/DisplayImpl.java
index d98e55bd8..dc07bd180 100644
--- a/src/newt/classes/jogamp/newt/DisplayImpl.java
+++ b/src/newt/classes/jogamp/newt/DisplayImpl.java
@@ -57,7 +57,7 @@ public abstract class DisplayImpl extends Display {
Class displayClass = NewtFactory.getCustomClass(type, "Display");
if(null==displayClass) {
if (NativeWindowFactory.TYPE_ANDROID.equals(type)) {
- displayClass = Class.forName("jogamp.newt.driver.android.Display");
+ displayClass = Class.forName("jogamp.newt.driver.android.AndroidDisplay");
} else if (NativeWindowFactory.TYPE_EGL.equals(type)) {
displayClass = Class.forName("jogamp.newt.driver.kd.KDDisplay");
} else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) {
diff --git a/src/newt/classes/jogamp/newt/ScreenImpl.java b/src/newt/classes/jogamp/newt/ScreenImpl.java
index d1ed10aaf..45899f08d 100644
--- a/src/newt/classes/jogamp/newt/ScreenImpl.java
+++ b/src/newt/classes/jogamp/newt/ScreenImpl.java
@@ -70,7 +70,7 @@ public abstract class ScreenImpl extends Screen implements ScreenModeListener {
Class screenClass = NewtFactory.getCustomClass(type, "Screen");
if(null==screenClass) {
if (NativeWindowFactory.TYPE_ANDROID.equals(type)) {
- screenClass = Class.forName("jogamp.newt.driver.android.Screen");
+ screenClass = Class.forName("jogamp.newt.driver.android.AndroidScreen");
} else if (NativeWindowFactory.TYPE_EGL.equals(type)) {
screenClass = Class.forName("jogamp.newt.driver.kd.KDScreen");
} else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) {
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 71d36e905..e03c4553e 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -141,7 +141,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
Class windowClass = NewtFactory.getCustomClass(type, "Window");
if(null==windowClass) {
if (NativeWindowFactory.TYPE_ANDROID.equals(type)) {
- windowClass = Class.forName("jogamp.newt.driver.android.Window");
+ windowClass = Class.forName("jogamp.newt.driver.android.AndroidWindow");
} else if (NativeWindowFactory.TYPE_EGL.equals(type)) {
windowClass = Class.forName("jogamp.newt.driver.kd.KDWindow");
} else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) {
@@ -262,12 +262,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(screenReferenceAdded) {
throw new InternalError("XXX");
}
- screen.addReference();
- screenReferenceAdded = true;
- createNativeImpl();
+ if(canCreateNativeImpl()) {
+ screen.addReference();
+ screenReferenceAdded = true;
+ createNativeImpl();
+ screen.addScreenModeListener(screenModeListenerImpl);
+ setTitleImpl(title);
+ }
+ // always flag visible,
+ // allowing to retry if visible && 0 == windowHandle
setVisibleImpl(true, x, y, width, height);
- screen.addScreenModeListener(screenModeListenerImpl);
- setTitleImpl(title);
}
} finally {
if(null!=parentWindow) {
@@ -357,6 +361,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// Window: Native implementation
//
+ protected boolean canCreateNativeImpl() {
+ return true; // default: always able to be created
+ }
+
/**
* The native implementation must set the native windowHandle.<br>
*
@@ -595,8 +603,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(0==windowHandle && visible) {
if( 0<width*height ) {
nativeWindowCreated = createNative();
- WindowImpl.this.waitForVisible(visible, true);
- madeVisible = visible;
+ if(nativeWindowCreated) {
+ WindowImpl.this.waitForVisible(visible, true);
+ madeVisible = visible;
+ }
}
} else if(WindowImpl.this.visible != visible) {
if(0 != windowHandle) {
@@ -2077,7 +2087,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// ee.printStackTrace();
}
- if(isNativeValid()) {
+ if(isValid()) {
if(0>width) {
width=this.width;
}