aboutsummaryrefslogtreecommitdiffstats
path: root/src/classes/com/sun/javafx/newt/NewtFactory.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2008-11-26 18:55:09 +0000
committerSven Gothel <[email protected]>2008-11-26 18:55:09 +0000
commit511a3af08936b839218898ec3a3ee4c2cddec10e (patch)
tree7e873935d3d3b2e3a1bd8d7341ba4b34f4090bae /src/classes/com/sun/javafx/newt/NewtFactory.java
parentcc770d96bada835c19a0b38ad9cb49fb8b91d23a (diff)
Newt Window
- Uses GLCapabilities for window creation - Note: This is implemented in the new KDWindow only, for now. - FIXME: Respect GLCapabilities for other implementations (X11, MacOS, Windows) visualID shall be determined by GLCapabilities, and set to 0 if not implemented. - New OpenKODE KDWindow - Compile native code at with 'ant -DuseKD=true' - Use KD in newt with the Java property set newt.ws.name=KD - API change: NewtFactory.createWindow() takes GLCapabilities insteast of a fake visualID git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1804 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/classes/com/sun/javafx/newt/NewtFactory.java')
-rwxr-xr-xsrc/classes/com/sun/javafx/newt/NewtFactory.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/classes/com/sun/javafx/newt/NewtFactory.java b/src/classes/com/sun/javafx/newt/NewtFactory.java
index 4f2ecf569..d277fc65e 100755
--- a/src/classes/com/sun/javafx/newt/NewtFactory.java
+++ b/src/classes/com/sun/javafx/newt/NewtFactory.java
@@ -33,6 +33,7 @@
package com.sun.javafx.newt;
+import javax.media.opengl.GLCapabilities;
import java.util.ArrayList;
import java.util.Iterator;
@@ -54,10 +55,15 @@ public abstract class NewtFactory {
/** Creates a Window of the default type for the current operating system. */
public static String getWindowType() {
- String osName = System.getProperty("os.name");
+ String osName = System.getProperty("newt.ws.name");
+ if(null==osName||osName.length()==0) {
+ osName = System.getProperty("os.name");
+ }
String osNameLowerCase = osName.toLowerCase();
String windowType;
- if (osNameLowerCase.startsWith("wind")) {
+ if (osNameLowerCase.startsWith("kd")) {
+ windowType = KD;
+ } else if (osNameLowerCase.startsWith("wind")) {
windowType = WINDOWS;
} else if (osNameLowerCase.startsWith("mac os x")) {
// For the time being, use the AWT on Mac OS X since
@@ -103,19 +109,19 @@ public abstract class NewtFactory {
/**
* Create a Window entity, incl native creation
*/
- public static Window createWindow(Screen screen, long visualID) {
- return Window.create(getWindowType(), screen, visualID);
+ public static Window createWindow(Screen screen, GLCapabilities caps) {
+ return Window.create(getWindowType(), screen, caps);
}
- public static Window createWindow(Screen screen, long visualID, boolean undecorated) {
- return Window.create(getWindowType(), screen, visualID, undecorated);
+ public static Window createWindow(Screen screen, GLCapabilities caps, boolean undecorated) {
+ return Window.create(getWindowType(), screen, caps, undecorated);
}
/**
* Create a Window entity using the given implementation type, incl native creation
*/
- public static Window createWindow(String type, Screen screen, long visualID) {
- return Window.create(type, screen, visualID);
+ public static Window createWindow(String type, Screen screen, GLCapabilities caps) {
+ return Window.create(type, screen, caps);
}
/**
@@ -135,10 +141,10 @@ public abstract class NewtFactory {
/**
* Instantiate a Window entity using the native handle.
*/
- public static Window wrapWindow(Screen screen, long visualID,
+ public static Window wrapWindow(Screen screen, GLCapabilities caps, long visualID,
long windowHandle, boolean fullscreen, boolean visible,
int x, int y, int width, int height) {
- return Window.wrapHandle(getWindowType(), screen, visualID,
+ return Window.wrapHandle(getWindowType(), screen, caps, visualID,
windowHandle, fullscreen, visible, x, y, width, height);
}