aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-01-31 10:59:47 +0100
committerSven Gothel <[email protected]>2014-01-31 10:59:47 +0100
commitd14d319a6c31003f5b07d51474ebfb71e77f8122 (patch)
tree87cdb9c9748d99afa835d2971901bb6faa44f56d /src
parent103939990df5c74ddb813fb03b2dbf6c12d825f5 (diff)
NewtFactory: Cleanup / createWindow(..) w/ parentWindow variant shall fall back to top-level ctor if parentWindow is null
Diffstat (limited to 'src')
-rw-r--r--src/newt/classes/com/jogamp/newt/NewtFactory.java17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java
index fc3716a52..9685200eb 100644
--- a/src/newt/classes/com/jogamp/newt/NewtFactory.java
+++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java
@@ -244,7 +244,7 @@ public class NewtFactory {
* </p>
*/
public static Window createWindow(Screen screen, CapabilitiesImmutable caps) {
- return createWindowImpl(screen, caps);
+ return WindowImpl.create(null, 0, screen, caps);
}
/**
@@ -271,6 +271,9 @@ public class NewtFactory {
*/
public static Window createWindow(NativeWindow parentWindow, CapabilitiesImmutable caps) {
final String type = NativeWindowFactory.getNativeWindowType(true);
+ if( null == parentWindow ) {
+ return createWindowImpl(type, caps);
+ }
Screen screen = null;
Window newtParentWindow = null;
@@ -291,7 +294,7 @@ public class NewtFactory {
screen = NewtFactory.createScreen(display, 0); // screen 0
}
}
- final Window win = createWindowImpl(parentWindow, screen, caps);
+ final Window win = WindowImpl.create(parentWindow, 0, screen, caps);
win.setSize(parentWindow.getWidth(), parentWindow.getHeight());
if ( null != newtParentWindow ) {
@@ -301,15 +304,7 @@ public class NewtFactory {
return win;
}
- protected static Window createWindowImpl(NativeWindow parentNativeWindow, Screen screen, CapabilitiesImmutable caps) {
- return WindowImpl.create(parentNativeWindow, 0, screen, caps);
- }
-
- protected static Window createWindowImpl(Screen screen, CapabilitiesImmutable caps) {
- return WindowImpl.create(null, 0, screen, caps);
- }
-
- protected static Window createWindowImpl(String type, CapabilitiesImmutable caps) {
+ private static Window createWindowImpl(String type, CapabilitiesImmutable caps) {
Display display = NewtFactory.createDisplay(type, null, true); // local display
Screen screen = NewtFactory.createScreen(display, 0); // screen 0
return WindowImpl.create(null, 0, screen, caps);