diff options
Diffstat (limited to 'src/demos/context/DualContext.java')
-rwxr-xr-x | src/demos/context/DualContext.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/demos/context/DualContext.java b/src/demos/context/DualContext.java index 0f9fea9..6c43f42 100755 --- a/src/demos/context/DualContext.java +++ b/src/demos/context/DualContext.java @@ -62,7 +62,8 @@ public class DualContext extends Canvas { private int repaintNum; public DualContext(GLCapabilities capabilities) { - super(GLDrawableFactory.getFactory().chooseGraphicsConfiguration(capabilities, null, null)); + super(unwrap((AWTGraphicsConfiguration) + GLDrawableFactory.getFactory().chooseGraphicsConfiguration(capabilities, null, null))); drawable = GLDrawableFactory.getFactory().getGLDrawable(this, capabilities, null); context1 = drawable.createContext(null); context2 = drawable.createContext(null); @@ -142,4 +143,11 @@ public class DualContext extends Canvas { frame.setSize(800, 400); frame.setVisible(true); } + + private static GraphicsConfiguration unwrap(AWTGraphicsConfiguration config) { + if (config == null) { + return null; + } + return config.getGraphicsConfiguration(); + } } |