diff options
author | Sven Gothel <[email protected]> | 2008-11-26 18:55:09 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2008-11-26 18:55:09 +0000 |
commit | 511a3af08936b839218898ec3a3ee4c2cddec10e (patch) | |
tree | 7e873935d3d3b2e3a1bd8d7341ba4b34f4090bae /src/classes/com/sun/javafx/newt/GLWindow.java | |
parent | cc770d96bada835c19a0b38ad9cb49fb8b91d23a (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/GLWindow.java')
-rw-r--r-- | src/classes/com/sun/javafx/newt/GLWindow.java | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/classes/com/sun/javafx/newt/GLWindow.java b/src/classes/com/sun/javafx/newt/GLWindow.java index d66de7149..89886c24f 100644 --- a/src/classes/com/sun/javafx/newt/GLWindow.java +++ b/src/classes/com/sun/javafx/newt/GLWindow.java @@ -70,9 +70,8 @@ public class GLWindow extends Window implements GLAutoDrawable { /** Constructor. Do not call this directly -- use {@link create()} instead. */ - protected GLWindow(Window window, GLCapabilities caps) { + protected GLWindow(Window window) { this.window = window; - this.caps = caps; window.addWindowListener(new WindowListener() { public void windowResized(WindowEvent e) { sendReshape = true; @@ -115,16 +114,16 @@ public class GLWindow extends Window implements GLAutoDrawable { public static GLWindow create(Window window, GLCapabilities caps, boolean undecorated) { + if (caps == null) { + caps = new GLCapabilities(); + } if (window == null) { Display display = NewtFactory.createDisplay(null); // local display Screen screen = NewtFactory.createScreen(display, 0); // screen 0 - window = NewtFactory.createWindow(screen, 0, undecorated); // dummy VisualID - } - if (caps == null) { - caps = new GLCapabilities(); + window = NewtFactory.createWindow(screen, caps, undecorated); } - return new GLWindow(window, caps); + return new GLWindow(window); } public boolean isTerminalObject() { @@ -132,7 +131,7 @@ public class GLWindow extends Window implements GLAutoDrawable { return false; } - protected void createNative() { + protected void createNative(GLCapabilities caps) { shouldNotCallThis(); } @@ -236,7 +235,7 @@ public class GLWindow extends Window implements GLAutoDrawable { window.setVisible(visible); if (visible && context == null) { factory = GLDrawableFactory.getFactory(window); - drawable = factory.createGLDrawable(window, caps, null); + drawable = factory.createGLDrawable(window, window.getChosenCapabilities(), null); window.setVisible(true); drawable.setRealized(true); context = drawable.createContext(null); @@ -337,7 +336,6 @@ public class GLWindow extends Window implements GLAutoDrawable { private int eventHandlerMode = EVENT_HANDLER_GL_CURRENT; private GLDrawableFactory factory; - private GLCapabilities caps; private GLDrawable drawable; private GLContext context; private GLDrawableHelper helper = new GLDrawableHelper(); |