aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/opengl/swt
diff options
context:
space:
mode:
authorDan Krisher <[email protected]>2011-11-14 12:51:23 -0500
committerDan Krisher <[email protected]>2011-11-14 12:51:23 -0500
commit78c45f888d831c700227c4f6f3bf6aa0b30aa247 (patch)
tree7e4de4719eb778b4012d1fb7b3460c166d6915f8 /src/jogl/classes/jogamp/opengl/swt
parenteca59450698e832b329169ba12fa5953f6052bce (diff)
Hopefully fixed use of GLCapabilitiesChooser (I didn't realize that this was already handled via the proxy surface factory). Needs testing
Diffstat (limited to 'src/jogl/classes/jogamp/opengl/swt')
-rw-r--r--src/jogl/classes/jogamp/opengl/swt/GLCanvas.java27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/jogl/classes/jogamp/opengl/swt/GLCanvas.java b/src/jogl/classes/jogamp/opengl/swt/GLCanvas.java
index 88c8d4d94..d8c1f33d1 100644
--- a/src/jogl/classes/jogamp/opengl/swt/GLCanvas.java
+++ b/src/jogl/classes/jogamp/opengl/swt/GLCanvas.java
@@ -3,10 +3,7 @@
*/
package jogamp.opengl.swt;
-import javax.media.nativewindow.AbstractGraphicsConfiguration;
import javax.media.nativewindow.AbstractGraphicsDevice;
-import javax.media.nativewindow.AbstractGraphicsScreen;
-import javax.media.nativewindow.GraphicsConfigurationFactory;
import javax.media.nativewindow.NativeSurface;
import javax.media.nativewindow.ProxySurface;
import javax.media.opengl.GL;
@@ -72,7 +69,6 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
/* Construction parameters stored for GLAutoDrawable accessor methods */
private int ctxCreationFlags = 0;
-// private final AbstractGraphicsConfiguration graphicsConfiguration;
private final GLCapabilitiesImmutable glCapsRequested;
/*
@@ -206,12 +202,10 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
: (GLCapabilitiesImmutable) caps.cloneMutable();
glCapsRequested = fixedCaps;
-// this.graphicsConfiguration = chooseGraphicsConfiguration(fixedCaps, fixedCaps, chooser);
-
final GLDrawableFactory glFactory = GLDrawableFactory.getFactory(fixedCaps.getGLProfile());
/* Create a NativeWindow proxy for the SWT canvas */
- proxySurface = glFactory.createProxySurface(device, nativeWindowHandle, fixedCaps, null);
+ proxySurface = glFactory.createProxySurface(device, nativeWindowHandle, fixedCaps, chooser);
/* Associate a GL surface with the proxy */
drawable = glFactory.createGLDrawable(proxySurface);
@@ -239,17 +233,6 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
}
});
}
-
- private AbstractGraphicsConfiguration chooseGraphicsConfiguration(final GLCapabilitiesImmutable capsChosen,
- final GLCapabilitiesImmutable capsRequested,
- final GLCapabilitiesChooser chooser) {
- //FIXME: Need to get platform specific screen implementation...
- //TODO: is this safe to run in any thread? Probably should be run in SWT thread.
- final AbstractGraphicsScreen screen = null;
- return GraphicsConfigurationFactory.getFactory(device.getClass()).chooseGraphicsConfiguration(capsChosen,
- capsRequested,
- chooser, screen);
- }
/*
* @see javax.media.opengl.GLAutoDrawable#addGLEventListener(javax.media.opengl.GLEventListener)
@@ -411,9 +394,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
*/
@Override
public GLCapabilitiesImmutable getChosenGLCapabilities() {
- return glCapsRequested;
- /* FIXME: once the chooseGraphicsConfiguration method is correct, then do the following instead: */
-// return (GLCapabilitiesImmutable)graphicsConfiguration.getChosenCapabilities();
+ return (GLCapabilitiesImmutable)proxySurface.getGraphicsConfiguration().getChosenCapabilities();
}
/**
@@ -422,9 +403,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable {
* @return Non-null GLCapabilities.
*/
public GLCapabilitiesImmutable getRequestedGLCapabilities() {
- return glCapsRequested;
- /* FIXME: once the chooseGraphicsConfiguration method is correct, then do the following instead: */
- //return (GLCapabilitiesImmutable)graphicsConfiguration.getRequestedCapabilities();
+ return (GLCapabilitiesImmutable)proxySurface.getGraphicsConfiguration().getRequestedCapabilities();
}
/*