diff options
Diffstat (limited to 'src/demos')
-rwxr-xr-x | src/demos/context/DualContext.java | 10 | ||||
-rwxr-xr-x | src/demos/fullscreen/GearsFullscreen.java | 2 | ||||
-rwxr-xr-x | src/demos/fullscreen/GearsFullscreen2.java | 2 | ||||
-rw-r--r-- | src/demos/gears/Gears.java | 2 | ||||
-rwxr-xr-x | src/demos/hdr/HDR.java | 2 | ||||
-rw-r--r-- | src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java | 2 | ||||
-rw-r--r-- | src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java | 2 | ||||
-rwxr-xr-x | src/demos/jrefract/JRefract.java | 2 | ||||
-rwxr-xr-x | src/demos/multisample/Multisample.java | 4 | ||||
-rwxr-xr-x | src/demos/printext/PrintExt.java | 2 | ||||
-rw-r--r-- | src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java | 2 | ||||
-rw-r--r-- | src/demos/tess/Tess.java | 2 | ||||
-rwxr-xr-x | src/demos/testContextDestruction/TestContextDestruction.java | 2 | ||||
-rw-r--r-- | src/demos/testContextSharing/TestContextSharing.java | 4 | ||||
-rw-r--r-- | src/demos/vertexArrayRange/VertexArrayRange.java | 2 | ||||
-rw-r--r-- | src/demos/vertexBufferObject/VertexBufferObject.java | 2 | ||||
-rw-r--r-- | src/demos/vertexProgRefract/VertexProgRefract.java | 2 | ||||
-rw-r--r-- | src/demos/vertexProgWarp/VertexProgWarp.java | 2 |
18 files changed, 28 insertions, 20 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(); + } } diff --git a/src/demos/fullscreen/GearsFullscreen.java b/src/demos/fullscreen/GearsFullscreen.java index c0a1345..3293250 100755 --- a/src/demos/fullscreen/GearsFullscreen.java +++ b/src/demos/fullscreen/GearsFullscreen.java @@ -52,7 +52,7 @@ public class GearsFullscreen { if (newMode != null) { frame.setUndecorated(true); } - final GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + final GLCanvas canvas = new GLCanvas(); canvas.addGLEventListener(new Gears()); canvas.addGLEventListener(new FullscreenWorkaround(initWidth, initHeight)); diff --git a/src/demos/fullscreen/GearsFullscreen2.java b/src/demos/fullscreen/GearsFullscreen2.java index 1a5086c..902b3bc 100755 --- a/src/demos/fullscreen/GearsFullscreen2.java +++ b/src/demos/fullscreen/GearsFullscreen2.java @@ -53,7 +53,7 @@ public class GearsFullscreen2 { if (newMode != null) { frame.setUndecorated(true); } - GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + GLCanvas canvas = new GLCanvas(); canvas.addGLEventListener(new Gears()); canvas.addGLEventListener(new FullscreenWorkaround(initWidth, initHeight)); diff --git a/src/demos/gears/Gears.java b/src/demos/gears/Gears.java index 9382e40..666cb64 100644 --- a/src/demos/gears/Gears.java +++ b/src/demos/gears/Gears.java @@ -16,7 +16,7 @@ import com.sun.opengl.utils.*; public class Gears implements GLEventListener, MouseListener, MouseMotionListener { public static void main(String[] args) { Frame frame = new Frame("Gear Demo"); - GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + GLCanvas canvas = new GLCanvas(); canvas.addGLEventListener(new Gears()); frame.add(canvas); diff --git a/src/demos/hdr/HDR.java b/src/demos/hdr/HDR.java index 5cdf56b..07d036b 100755 --- a/src/demos/hdr/HDR.java +++ b/src/demos/hdr/HDR.java @@ -105,7 +105,7 @@ public class HDR extends Demo { 0.0f, 0.0f, 0.0f, 1.0f }; public static void main(String[] args) { - GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + GLCanvas canvas = new GLCanvas(); HDR demo = new HDR(); canvas.addGLEventListener(demo); diff --git a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java index 0078df1..48167e9 100644 --- a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java +++ b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java @@ -61,7 +61,7 @@ import gleem.linalg.*; public class HWShadowmapsSimple extends Demo { public static void main(String[] args) { - final GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + final GLCanvas canvas = new GLCanvas(); HWShadowmapsSimple demo = new HWShadowmapsSimple(); canvas.addGLEventListener(demo); diff --git a/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java b/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java index e35bdf0..5f4ce75 100644 --- a/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java +++ b/src/demos/infiniteShadowVolumes/InfiniteShadowVolumes.java @@ -71,7 +71,7 @@ public class InfiniteShadowVolumes extends Demo { public static void main(String[] args) { GLCapabilities caps = new GLCapabilities(); caps.setStencilBits(16); - final GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(caps); + final GLCanvas canvas = new GLCanvas(caps); InfiniteShadowVolumes demo = new InfiniteShadowVolumes(); canvas.addGLEventListener(demo); diff --git a/src/demos/jrefract/JRefract.java b/src/demos/jrefract/JRefract.java index 60361e0..01fe9f7 100755 --- a/src/demos/jrefract/JRefract.java +++ b/src/demos/jrefract/JRefract.java @@ -120,7 +120,7 @@ public class JRefract { final GLJPanel canvas = (which == GEARS) ? new JGears() : - GLDrawableFactory.getFactory().createGLJPanel(caps); + new GLJPanel(caps); final DemoListener demoListener = new DemoListener() { public void shutdownDemo() { removeJPanel(canvas); diff --git a/src/demos/multisample/Multisample.java b/src/demos/multisample/Multisample.java index ff7d7ca..ed6ef62 100755 --- a/src/demos/multisample/Multisample.java +++ b/src/demos/multisample/Multisample.java @@ -84,7 +84,7 @@ public class Multisample { caps.setSampleBuffers(true); caps.setNumSamples(4); - canvas = GLDrawableFactory.getFactory().createGLCanvas(caps, chooser, null, null); + canvas = new GLCanvas(caps, chooser, null, null); canvas.addGLEventListener(new Listener()); Frame frame = new Frame("Full-scene antialiasing"); @@ -104,7 +104,7 @@ public class Multisample { // No antialiasing (for comparison) caps.setSampleBuffers(false); - canvas = GLDrawableFactory.getFactory().createGLCanvas(caps); + canvas = new GLCanvas(caps); canvas.addGLEventListener(new Listener()); frame = new Frame("No antialiasing"); diff --git a/src/demos/printext/PrintExt.java b/src/demos/printext/PrintExt.java index 4d21ee9..d73981a 100755 --- a/src/demos/printext/PrintExt.java +++ b/src/demos/printext/PrintExt.java @@ -12,7 +12,7 @@ import com.sun.opengl.utils.*; public class PrintExt { public static void main(String[] args) { Frame frame = new Frame(); - GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + GLCanvas canvas = new GLCanvas(); canvas.addGLEventListener(new Listener()); frame.setUndecorated(true); frame.add(canvas); diff --git a/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java b/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java index 7599778..6fe2369 100644 --- a/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java +++ b/src/demos/proceduralTexturePhysics/ProceduralTexturePhysics.java @@ -60,7 +60,7 @@ import gleem.linalg.*; public class ProceduralTexturePhysics extends Demo { public static void main(String[] args) { - GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + GLCanvas canvas = new GLCanvas(); ProceduralTexturePhysics demo = new ProceduralTexturePhysics(); canvas.addGLEventListener(demo); diff --git a/src/demos/tess/Tess.java b/src/demos/tess/Tess.java index d4c9729..5c587c2 100644 --- a/src/demos/tess/Tess.java +++ b/src/demos/tess/Tess.java @@ -72,7 +72,7 @@ public class Tess { Frame frame = new Frame("Tess Demo"); frame.setSize(500, 500); - GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + GLCanvas canvas = new GLCanvas(); frame.add(canvas); canvas.addGLEventListener(new TessRenderer()); diff --git a/src/demos/testContextDestruction/TestContextDestruction.java b/src/demos/testContextDestruction/TestContextDestruction.java index 86652bb..7f5fd64 100755 --- a/src/demos/testContextDestruction/TestContextDestruction.java +++ b/src/demos/testContextDestruction/TestContextDestruction.java @@ -68,7 +68,7 @@ public class TestContextDestruction { } public void run(String[] args) { - GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + GLCanvas canvas = new GLCanvas(); canvas.addGLEventListener(new Listener()); canvas.setSize(256, 256); diff --git a/src/demos/testContextSharing/TestContextSharing.java b/src/demos/testContextSharing/TestContextSharing.java index c6d7552..e63b3ad 100644 --- a/src/demos/testContextSharing/TestContextSharing.java +++ b/src/demos/testContextSharing/TestContextSharing.java @@ -56,14 +56,14 @@ public class TestContextSharing { } public void run(String[] args) { - GLCanvas canvas1 = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + GLCanvas canvas1 = new GLCanvas(); canvas1.addGLEventListener(new Listener()); canvas1.setSize(256, 256); Frame frame1 = new Frame("Canvas 1"); frame1.setLayout(new BorderLayout()); frame1.add(canvas1, BorderLayout.CENTER); - GLCanvas canvas2 = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities(), null, canvas1.getContext(), null); + GLCanvas canvas2 = new GLCanvas(null, null, canvas1.getContext(), null); canvas2.addGLEventListener(new Listener()); canvas2.setSize(256, 256); Frame frame2 = new Frame("Canvas 2"); diff --git a/src/demos/vertexArrayRange/VertexArrayRange.java b/src/demos/vertexArrayRange/VertexArrayRange.java index 60d2ba8..dcf6df4 100644 --- a/src/demos/vertexArrayRange/VertexArrayRange.java +++ b/src/demos/vertexArrayRange/VertexArrayRange.java @@ -93,7 +93,7 @@ public class VertexArrayRange extends Demo { } } - GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + GLCanvas canvas = new GLCanvas(); VertexArrayRange demo = new VertexArrayRange(); if (startSlow) { demo.setFlag('v', false); // VAR off diff --git a/src/demos/vertexBufferObject/VertexBufferObject.java b/src/demos/vertexBufferObject/VertexBufferObject.java index ef485bd..6d5224d 100644 --- a/src/demos/vertexBufferObject/VertexBufferObject.java +++ b/src/demos/vertexBufferObject/VertexBufferObject.java @@ -85,7 +85,7 @@ public class VertexBufferObject extends Demo { } } - GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + GLCanvas canvas = new GLCanvas(); VertexBufferObject demo = new VertexBufferObject(); demo.vboEnabled = vboEnabled; canvas.addGLEventListener(demo); diff --git a/src/demos/vertexProgRefract/VertexProgRefract.java b/src/demos/vertexProgRefract/VertexProgRefract.java index 63b4a59..8663d39 100644 --- a/src/demos/vertexProgRefract/VertexProgRefract.java +++ b/src/demos/vertexProgRefract/VertexProgRefract.java @@ -66,7 +66,7 @@ import gleem.linalg.*; public class VertexProgRefract extends Demo { public static void main(String[] args) { - GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + GLCanvas canvas = new GLCanvas(); VertexProgRefract demo = new VertexProgRefract(); canvas.addGLEventListener(demo); diff --git a/src/demos/vertexProgWarp/VertexProgWarp.java b/src/demos/vertexProgWarp/VertexProgWarp.java index cd39a01..07605e8 100644 --- a/src/demos/vertexProgWarp/VertexProgWarp.java +++ b/src/demos/vertexProgWarp/VertexProgWarp.java @@ -72,7 +72,7 @@ public class VertexProgWarp extends Demo { } public void run(String[] args) { - GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); + GLCanvas canvas = new GLCanvas(); VertexProgWarp demo = new VertexProgWarp(); canvas.addGLEventListener(demo); |