summaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-11-17 21:53:16 +0100
committerSven Gothel <[email protected]>2010-11-17 21:53:16 +0100
commit29e3b223eae9f5775d1dd34f2aaeeb3db6d9233c (patch)
treeeae2c7d60a4cdbcdacd4057b020044bd42fb30b8 /src/newt
parent64aa219406c1aa1d6022fedce7a52c8c19d0e35d (diff)
Finishing Immutable changes including GLCapabiltiesImmutable.
Diffstat (limited to 'src/newt')
-rw-r--r--src/newt/classes/com/jogamp/newt/NewtFactory.java20
-rw-r--r--src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java3
-rw-r--r--src/newt/classes/com/jogamp/newt/awt/NewtFactoryAWT.java7
-rw-r--r--src/newt/classes/com/jogamp/newt/impl/OffscreenWindow.java5
-rw-r--r--src/newt/classes/com/jogamp/newt/impl/WindowImpl.java15
-rw-r--r--src/newt/classes/com/jogamp/newt/impl/awt/AWTCanvas.java16
-rw-r--r--src/newt/classes/com/jogamp/newt/impl/awt/AWTWindow.java2
-rw-r--r--src/newt/classes/com/jogamp/newt/impl/intel/gdl/Window.java2
-rw-r--r--src/newt/classes/com/jogamp/newt/impl/macosx/MacWindow.java3
-rw-r--r--src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Window.java7
-rw-r--r--src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDWindow.java10
-rw-r--r--src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java3
-rw-r--r--src/newt/classes/com/jogamp/newt/impl/x11/X11Window.java3
-rw-r--r--src/newt/classes/com/jogamp/newt/opengl/GLWindow.java13
14 files changed, 54 insertions, 55 deletions
diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java
index 892a2426e..3b836787e 100644
--- a/src/newt/classes/com/jogamp/newt/NewtFactory.java
+++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java
@@ -112,14 +112,14 @@ public class NewtFactory {
* The Display/Screen is created and owned, ie destructed atomatically.<br>
* A new Display is only created if no preexisting one could be found via {@link Display#getLastDisplayOf(java.lang.String, java.lang.String, int)}.
*/
- public static Window createWindow(Capabilities caps) {
+ public static Window createWindow(CapabilitiesImmutable caps) {
return createWindowImpl(NativeWindowFactory.getNativeWindowType(true), caps);
}
/**
* Create a top level Window entity, incl native creation
*/
- public static Window createWindow(Screen screen, Capabilities caps) {
+ public static Window createWindow(Screen screen, CapabilitiesImmutable caps) {
return createWindowImpl(screen, caps);
}
@@ -140,7 +140,7 @@ public class NewtFactory {
*
* @param parentWindowObject either a NativeWindow instance
*/
- public static Window createWindow(NativeWindow nParentWindow, Capabilities caps) {
+ public static Window createWindow(NativeWindow nParentWindow, CapabilitiesImmutable caps) {
final String type = NativeWindowFactory.getNativeWindowType(true);
Screen screen = null;
@@ -173,19 +173,19 @@ public class NewtFactory {
return win;
}
- protected static Window createWindowImpl(NativeWindow parentNativeWindow, Screen screen, Capabilities caps) {
+ protected static Window createWindowImpl(NativeWindow parentNativeWindow, Screen screen, CapabilitiesImmutable caps) {
return WindowImpl.create(parentNativeWindow, 0, screen, caps);
}
- protected static Window createWindowImpl(long parentWindowHandle, Screen screen, Capabilities caps) {
+ protected static Window createWindowImpl(long parentWindowHandle, Screen screen, CapabilitiesImmutable caps) {
return WindowImpl.create(null, parentWindowHandle, screen, caps);
}
- protected static Window createWindowImpl(Screen screen, Capabilities caps) {
+ protected static Window createWindowImpl(Screen screen, CapabilitiesImmutable caps) {
return WindowImpl.create(null, 0, screen, caps);
}
- protected static Window createWindowImpl(String type, Capabilities caps) {
+ protected 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);
@@ -197,7 +197,7 @@ public class NewtFactory {
* @param parentWindowObject the native parent window handle
* @param undecorated only impacts if the window is in top-level state, while attached to a parent window it's rendered undecorated always
*/
- public static Window createWindow(long parentWindowHandle, Screen screen, Capabilities caps) {
+ public static Window createWindow(long parentWindowHandle, Screen screen, CapabilitiesImmutable caps) {
return createWindowImpl(parentWindowHandle, screen, caps);
}
@@ -208,7 +208,7 @@ public class NewtFactory {
*
* @param undecorated only impacts if the window is in top-level state, while attached to a parent window it's rendered undecorated always
*/
- public static Window createWindow(Object[] cstrArguments, Screen screen, Capabilities caps) {
+ public static Window createWindow(Object[] cstrArguments, Screen screen, CapabilitiesImmutable caps) {
return WindowImpl.create(cstrArguments, screen, caps);
}
@@ -219,7 +219,7 @@ public class NewtFactory {
return DisplayImpl.create(type, null, handle, false);
}
- private static final boolean instanceOf(Object obj, String clazzName) {
+ private static boolean instanceOf(Object obj, String clazzName) {
Class clazz = obj.getClass();
do {
if(clazz.getName().equals(clazzName)) {
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
index 29e8c91b4..a0ab5f9f6 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
@@ -168,8 +168,7 @@ public class NewtCanvasAWT extends java.awt.Canvas {
newtChild.setFocusAction(null); // no AWT focus traversal ..
if(add) {
- nativeWindow = NewtFactoryAWT.getNativeWindow(this,
- newtChild.getRequestedCapabilities().cloneCapabilites());
+ nativeWindow = NewtFactoryAWT.getNativeWindow(this, newtChild.getRequestedCapabilities());
if(null!=nativeWindow) {
if(DEBUG) {
System.err.println("NewtCanvasAWT.reparentWindow: "+newtChild);
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtFactoryAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtFactoryAWT.java
index 7b9130188..cd03454c8 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtFactoryAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtFactoryAWT.java
@@ -51,7 +51,7 @@ public class NewtFactoryAWT extends NewtFactory {
*
* @param awtCompObject must be of type java.awt.Component
*/
- public static NativeWindow getNativeWindow(Object awtCompObject, Capabilities capsRequested) {
+ public static NativeWindow getNativeWindow(Object awtCompObject, CapabilitiesImmutable capsRequested) {
if(null==awtCompObject) {
throw new NativeWindowException("Null AWT Component");
}
@@ -61,9 +61,8 @@ public class NewtFactoryAWT extends NewtFactory {
return getNativeWindow( (java.awt.Component) awtCompObject, capsRequested );
}
- public static NativeWindow getNativeWindow(java.awt.Component awtComp, Capabilities capsRequested) {
- DefaultGraphicsConfiguration config =
- AWTGraphicsConfiguration.create(awtComp, (Capabilities) capsRequested.clone(), capsRequested);
+ public static NativeWindow getNativeWindow(java.awt.Component awtComp, CapabilitiesImmutable capsRequested) {
+ DefaultGraphicsConfiguration config = AWTGraphicsConfiguration.create(awtComp, capsRequested, capsRequested);
NativeWindow awtNative = NativeWindowFactory.getNativeWindow(awtComp, config); // a JAWTWindow
if(DEBUG_IMPLEMENTATION) {
System.err.println("NewtFactoryAWT.getNativeWindow: "+awtComp+" -> "+awtNative);
diff --git a/src/newt/classes/com/jogamp/newt/impl/OffscreenWindow.java b/src/newt/classes/com/jogamp/newt/impl/OffscreenWindow.java
index 30dc945db..6e827dd77 100644
--- a/src/newt/classes/com/jogamp/newt/impl/OffscreenWindow.java
+++ b/src/newt/classes/com/jogamp/newt/impl/OffscreenWindow.java
@@ -50,11 +50,12 @@ public class OffscreenWindow extends WindowImpl implements SurfaceChangeable {
if(0!=getParentWindowHandle()) {
throw new NativeWindowException("OffscreenWindow does not support window parenting");
}
- if(caps.isOnscreen()) {
+ if(capsRequested.isOnscreen()) {
throw new NativeWindowException("Capabilities is onscreen");
}
AbstractGraphicsScreen aScreen = getScreen().getGraphicsScreen();
- config = GraphicsConfigurationFactory.getFactory(aScreen.getDevice()).chooseGraphicsConfiguration(caps, null, aScreen);
+ config = GraphicsConfigurationFactory.getFactory(aScreen.getDevice()).chooseGraphicsConfiguration(
+ capsRequested, capsRequested, null, aScreen);
if (config == null) {
throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
}
diff --git a/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java b/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java
index 572ed5bb7..30b17c575 100644
--- a/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java
+++ b/src/newt/classes/com/jogamp/newt/impl/WindowImpl.java
@@ -56,7 +56,6 @@ import java.util.ArrayList;
import java.lang.reflect.Method;
import javax.media.nativewindow.AbstractGraphicsConfiguration;
import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.Capabilities;
import javax.media.nativewindow.CapabilitiesImmutable;
import javax.media.nativewindow.NativeSurface;
import javax.media.nativewindow.NativeWindow;
@@ -79,7 +78,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer, ScreenMod
private NativeWindow parentWindow;
private long parentWindowHandle;
protected AbstractGraphicsConfiguration config;
- protected Capabilities caps;
+ protected CapabilitiesImmutable capsRequested;
protected boolean fullscreen, visible, hasFocus;
protected int width, height, x, y;
protected int nfs_width, nfs_height, nfs_x, nfs_y; // non fullscreen dimensions ..
@@ -165,7 +164,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer, ScreenMod
return windowClass;
}
- public static WindowImpl create(NativeWindow parentWindow, long parentWindowHandle, Screen screen, Capabilities caps) {
+ public static WindowImpl create(NativeWindow parentWindow, long parentWindowHandle, Screen screen, CapabilitiesImmutable caps) {
try {
Class windowClass;
if(caps.isOnscreen()) {
@@ -178,7 +177,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer, ScreenMod
window.parentWindow = parentWindow;
window.parentWindowHandle = parentWindowHandle;
window.screen = (ScreenImpl) screen;
- window.caps = (Capabilities)caps.clone();
+ window.capsRequested = (CapabilitiesImmutable) caps.cloneMutable();
window.setUndecorated(0!=parentWindowHandle);
return window;
} catch (Throwable t) {
@@ -187,7 +186,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer, ScreenMod
}
}
- public static WindowImpl create(Object[] cstrArguments, Screen screen, Capabilities caps) {
+ public static WindowImpl create(Object[] cstrArguments, Screen screen, CapabilitiesImmutable caps) {
try {
Class windowClass = getWindowClass(screen.getDisplay().getType());
Class[] cstrArgumentTypes = getCustomConstructorArgumentTypes(windowClass);
@@ -201,7 +200,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer, ScreenMod
WindowImpl window = (WindowImpl) ReflectionUtil.createInstance( windowClass, cstrArgumentTypes, cstrArguments ) ;
window.initializeStates();
window.screen = (ScreenImpl) screen;
- window.caps = (Capabilities)caps.clone();
+ window.capsRequested = (CapabilitiesImmutable) caps.cloneMutable();
return window;
} catch (Throwable t) {
throw new NativeWindowException(t);
@@ -825,7 +824,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer, ScreenMod
parentWindowHandle = 0;
parentWindow = null;
- caps = null;
+ capsRequested = null;
lifecycleHook = null;
// Default position and dimension will be re-set immediately by user
@@ -1151,7 +1150,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer, ScreenMod
}
public final CapabilitiesImmutable getRequestedCapabilities() {
- return caps;
+ return capsRequested;
}
public String getTitle() {
diff --git a/src/newt/classes/com/jogamp/newt/impl/awt/AWTCanvas.java b/src/newt/classes/com/jogamp/newt/impl/awt/AWTCanvas.java
index 4b30e10b6..169b7bc3a 100644
--- a/src/newt/classes/com/jogamp/newt/impl/awt/AWTCanvas.java
+++ b/src/newt/classes/com/jogamp/newt/impl/awt/AWTCanvas.java
@@ -50,11 +50,11 @@ public class AWTCanvas extends Canvas {
private GraphicsConfiguration chosen;
private AWTGraphicsConfiguration awtConfig;
- private Capabilities capabilities;
+ private CapabilitiesImmutable capabilities;
private boolean displayConfigChanged=false;
- public AWTCanvas(Capabilities capabilities) {
+ public AWTCanvas(CapabilitiesImmutable capabilities) {
super();
if(null==capabilities) {
@@ -86,7 +86,7 @@ public class AWTCanvas extends Canvas {
/*
* Save the chosen capabilities for use in getGraphicsConfiguration().
*/
- awtConfig = chooseGraphicsConfiguration(capabilities, device);
+ awtConfig = chooseGraphicsConfiguration(capabilities, capabilities, device);
if(Window.DEBUG_IMPLEMENTATION) {
Exception e = new Exception("Info: Created Config: "+awtConfig);
e.printStackTrace();
@@ -174,7 +174,7 @@ public class AWTCanvas extends Canvas {
* block, both devices should have the same visual list, and the
* same configuration should be selected here.
*/
- AWTGraphicsConfiguration config = chooseGraphicsConfiguration((Capabilities)awtConfig.getRequestedCapabilities(), gc.getDevice());
+ AWTGraphicsConfiguration config = chooseGraphicsConfiguration(awtConfig.getChosenCapabilities(), awtConfig.getRequestedCapabilities(), gc.getDevice());
final GraphicsConfiguration compatible = (null!=config)?config.getGraphicsConfiguration():null;
if(Window.DEBUG_IMPLEMENTATION) {
Exception e = new Exception("Info: Call Stack: "+Thread.currentThread().getName());
@@ -225,13 +225,13 @@ public class AWTCanvas extends Canvas {
return gc;
}
- private static AWTGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities,
+ private static AWTGraphicsConfiguration chooseGraphicsConfiguration(CapabilitiesImmutable capsChosen,
+ CapabilitiesImmutable capsRequested,
GraphicsDevice device) {
AbstractGraphicsScreen aScreen = AWTGraphicsScreen.createScreenDevice(device, AbstractGraphicsDevice.DEFAULT_UNIT);
AWTGraphicsConfiguration config = (AWTGraphicsConfiguration)
- GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(capabilities,
- null,
- aScreen);
+ GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(capsChosen, capsRequested,
+ null, aScreen);
if (config == null) {
throw new NativeWindowException("Error: Couldn't fetch AWTGraphicsConfiguration");
}
diff --git a/src/newt/classes/com/jogamp/newt/impl/awt/AWTWindow.java b/src/newt/classes/com/jogamp/newt/impl/awt/AWTWindow.java
index edd851451..7aa5874c4 100644
--- a/src/newt/classes/com/jogamp/newt/impl/awt/AWTWindow.java
+++ b/src/newt/classes/com/jogamp/newt/impl/awt/AWTWindow.java
@@ -119,7 +119,7 @@ public class AWTWindow extends WindowImpl {
frame.setTitle(getTitle());
}
container.setLayout(new BorderLayout());
- canvas = new AWTCanvas(caps);
+ canvas = new AWTCanvas(capsRequested);
addWindowListener(new LocalWindowListener());
diff --git a/src/newt/classes/com/jogamp/newt/impl/intel/gdl/Window.java b/src/newt/classes/com/jogamp/newt/impl/intel/gdl/Window.java
index 749be8506..613d9eb02 100644
--- a/src/newt/classes/com/jogamp/newt/impl/intel/gdl/Window.java
+++ b/src/newt/classes/com/jogamp/newt/impl/intel/gdl/Window.java
@@ -53,7 +53,7 @@ public class Window extends com.jogamp.newt.impl.WindowImpl {
AbstractGraphicsScreen aScreen = getScreen().getGraphicsScreen();
AbstractGraphicsDevice aDevice = getScreen().getDisplay().getGraphicsDevice();
- config = GraphicsConfigurationFactory.getFactory(aDevice).chooseGraphicsConfiguration(caps, null, aScreen);
+ config = GraphicsConfigurationFactory.getFactory(aDevice).chooseGraphicsConfiguration(capsRequested, capsRequested, null, aScreen);
if (config == null) {
throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
}
diff --git a/src/newt/classes/com/jogamp/newt/impl/macosx/MacWindow.java b/src/newt/classes/com/jogamp/newt/impl/macosx/MacWindow.java
index 59b41c2aa..3d1f52eed 100644
--- a/src/newt/classes/com/jogamp/newt/impl/macosx/MacWindow.java
+++ b/src/newt/classes/com/jogamp/newt/impl/macosx/MacWindow.java
@@ -143,7 +143,8 @@ public class MacWindow extends WindowImpl {
}
protected void createNativeImpl() {
- config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(caps, null, getScreen().getGraphicsScreen());
+ config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(
+ capsRequested, capsRequested, null, getScreen().getGraphicsScreen());
if (config == null) {
throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
}
diff --git a/src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Window.java b/src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Window.java
index ad903731b..6548cf6c4 100644
--- a/src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Window.java
+++ b/src/newt/classes/com/jogamp/newt/impl/opengl/broadcom/egl/Window.java
@@ -35,9 +35,9 @@ package com.jogamp.newt.impl.opengl.broadcom.egl;
import com.jogamp.opengl.impl.egl.*;
import javax.media.nativewindow.*;
-import javax.media.opengl.GLCapabilities;
import javax.media.nativewindow.NativeWindowException;
import javax.media.nativewindow.util.Point;
+import javax.media.opengl.GLCapabilitiesImmutable;
public class Window extends com.jogamp.newt.impl.WindowImpl {
static {
@@ -53,7 +53,8 @@ public class Window extends com.jogamp.newt.impl.WindowImpl {
}
// query a good configuration .. even thought we drop this one
// and reuse the EGLUtil choosen one later.
- config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(caps, null, getScreen().getGraphicsScreen());
+ config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(
+ capsRequested, capsRequested, null, getScreen().getGraphicsScreen());
if (config == null) {
throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
}
@@ -149,7 +150,7 @@ public class Window extends com.jogamp.newt.impl.WindowImpl {
private void windowCreated(int cfgID, int width, int height) {
this.width = width;
this.height = height;
- GLCapabilities capsReq = (GLCapabilities) config.getRequestedCapabilities();
+ GLCapabilitiesImmutable capsReq = (GLCapabilitiesImmutable) config.getRequestedCapabilities();
config = EGLGraphicsConfiguration.create(capsReq, getScreen().getGraphicsScreen(), cfgID);
if (config == null) {
throw new NativeWindowException("Error creating EGLGraphicsConfiguration from id: "+cfgID+", "+this);
diff --git a/src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDWindow.java b/src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDWindow.java
index f0bc8587b..eb03dc9dc 100644
--- a/src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDWindow.java
+++ b/src/newt/classes/com/jogamp/newt/impl/opengl/kd/KDWindow.java
@@ -33,15 +33,12 @@
package com.jogamp.newt.impl.opengl.kd;
-import com.jogamp.newt.*;
-import com.jogamp.newt.event.*;
import com.jogamp.newt.impl.*;
import com.jogamp.opengl.impl.egl.*;
import javax.media.nativewindow.*;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
import javax.media.nativewindow.NativeWindowException;
import javax.media.nativewindow.util.Point;
+import javax.media.opengl.GLCapabilitiesImmutable;
public class KDWindow extends WindowImpl {
private static final String WINDOW_CLASS_NAME = "NewtWindow";
@@ -57,12 +54,13 @@ public class KDWindow extends WindowImpl {
if(0!=getParentWindowHandle()) {
throw new RuntimeException("Window parenting not supported (yet)");
}
- config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(caps, null, getScreen().getGraphicsScreen());
+ config = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice()).chooseGraphicsConfiguration(
+ capsRequested, capsRequested, null, getScreen().getGraphicsScreen());
if (config == null) {
throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
}
- GLCapabilities eglCaps = (GLCapabilities)config.getChosenCapabilities();
+ GLCapabilitiesImmutable eglCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
int[] eglAttribs = EGLGraphicsConfiguration.GLCapabilities2AttribList(eglCaps);
eglWindowHandle = CreateWindow(getDisplayHandle(), eglAttribs);
diff --git a/src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java b/src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java
index 2c3ffc3cc..b188a580e 100644
--- a/src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java
+++ b/src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java
@@ -92,7 +92,8 @@ public class WindowsWindow extends WindowImpl {
protected void createNativeImpl() {
WindowsScreen screen = (WindowsScreen) getScreen();
WindowsDisplay display = (WindowsDisplay) screen.getDisplay();
- config = GraphicsConfigurationFactory.getFactory(display.getGraphicsDevice()).chooseGraphicsConfiguration(caps, null, screen.getGraphicsScreen());
+ config = GraphicsConfigurationFactory.getFactory(display.getGraphicsDevice()).chooseGraphicsConfiguration(
+ capsRequested, capsRequested, null, screen.getGraphicsScreen());
if (config == null) {
throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
}
diff --git a/src/newt/classes/com/jogamp/newt/impl/x11/X11Window.java b/src/newt/classes/com/jogamp/newt/impl/x11/X11Window.java
index 91143923d..e81acee3e 100644
--- a/src/newt/classes/com/jogamp/newt/impl/x11/X11Window.java
+++ b/src/newt/classes/com/jogamp/newt/impl/x11/X11Window.java
@@ -52,7 +52,8 @@ public class X11Window extends WindowImpl {
protected void createNativeImpl() {
X11Screen screen = (X11Screen) getScreen();
X11Display display = (X11Display) screen.getDisplay();
- config = GraphicsConfigurationFactory.getFactory(display.getGraphicsDevice()).chooseGraphicsConfiguration(caps, null, screen.getGraphicsScreen());
+ config = GraphicsConfigurationFactory.getFactory(display.getGraphicsDevice()).chooseGraphicsConfiguration(
+ capsRequested, capsRequested, null, screen.getGraphicsScreen());
if (config == null) {
throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
}
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index 967836cf6..d6da09bec 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -35,7 +35,6 @@
package com.jogamp.newt.opengl;
import com.jogamp.common.GlueGenVersion;
-import com.jogamp.common.util.VersionUtil;
import com.jogamp.nativewindow.NativeWindowVersion;
import com.jogamp.newt.*;
import com.jogamp.newt.event.*;
@@ -101,7 +100,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
* <P>
* The resulting GLWindow owns the Window, Screen and Device, ie it will be destructed.
*/
- public static GLWindow create(GLCapabilities caps) {
+ public static GLWindow create(GLCapabilitiesImmutable caps) {
return new GLWindow(NewtFactory.createWindow(caps));
}
@@ -111,7 +110,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
* <P>
* The resulting GLWindow owns the Window, ie it will be destructed.
*/
- public static GLWindow create(Screen screen, GLCapabilities caps) {
+ public static GLWindow create(Screen screen, GLCapabilitiesImmutable caps) {
return new GLWindow(NewtFactory.createWindow(screen, caps));
}
@@ -133,7 +132,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
* <P>
* The resulting GLWindow owns the Window, ie it will be destructed.
*/
- public static GLWindow create(NativeWindow parentNativeWindow, GLCapabilities caps) {
+ public static GLWindow create(NativeWindow parentNativeWindow, GLCapabilitiesImmutable caps) {
return new GLWindow(NewtFactory.createWindow(parentNativeWindow, caps));
}
@@ -359,7 +358,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
} else {
nw = window;
}
- GLCapabilities glCaps = (GLCapabilities) nw.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
+ GLCapabilitiesImmutable glCaps = (GLCapabilitiesImmutable) nw.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities();
if(null==factory) {
factory = GLDrawableFactory.getFactory(glCaps.getGLProfile());
}
@@ -670,7 +669,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
return ( null != drawable ) ? drawable.isRealized() : false;
}
- public final GLCapabilities getChosenGLCapabilities() {
+ public final GLCapabilitiesImmutable getChosenGLCapabilities() {
if (drawable == null) {
throw new GLException("No drawable yet");
}
@@ -863,7 +862,7 @@ public class GLWindow implements GLAutoDrawable, Window, NEWTEventConsumer {
System.err.println(NativeWindowVersion.getInstance());
System.err.print(JoglVersion.getInstance());
System.err.println(NewtVersion.getInstance());
- GLCapabilities caps = new GLCapabilities( GLProfile.getDefault() );
+ GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault() );
GLWindow glWindow = GLWindow.create(caps);
glWindow.setSize(128, 128);