diff options
author | Sven Gothel <[email protected]> | 2010-04-15 03:46:16 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-04-15 03:46:16 +0200 |
commit | 4ff184fd14376241b5a28b3a93f84a849d33f002 (patch) | |
tree | 10bf9a19fcded63b0132ec9e626a986595985464 /src | |
parent | aa2f05ff1ab182fdb6f724a6aedf91de201efe7e (diff) |
Fixes to match JOGL 2ae28d54858ff684bc2368e0476a7a357dc63432
Diffstat (limited to 'src')
-rwxr-xr-x | src/demos/es1/RedSquare.java | 2 | ||||
-rwxr-xr-x | src/demos/hdr/HDR.java | 2 | ||||
-rw-r--r-- | src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java | 2 | ||||
-rwxr-xr-x | src/demos/misc/TiledRendering.java | 2 | ||||
-rw-r--r-- | src/demos/proceduralTexturePhysics/Water.java | 2 | ||||
-rwxr-xr-x | src/demos/readbuffer/Main.java | 36 | ||||
-rwxr-xr-x | src/demos/texture/TextureConvert.java | 2 |
7 files changed, 35 insertions, 13 deletions
diff --git a/src/demos/es1/RedSquare.java b/src/demos/es1/RedSquare.java index de4f54a..9f810d4 100755 --- a/src/demos/es1/RedSquare.java +++ b/src/demos/es1/RedSquare.java @@ -147,7 +147,7 @@ public class RedSquare extends Thread implements WindowListener, KeyListener, Mo } else { do { display(); - } while (!quit && window.getDuration() < 20000) ; + } while (!quit && window.getDuration() < 11000) ; shutdown(); } } diff --git a/src/demos/hdr/HDR.java b/src/demos/hdr/HDR.java index aca38e9..900d7f3 100755 --- a/src/demos/hdr/HDR.java +++ b/src/demos/hdr/HDR.java @@ -314,7 +314,7 @@ public class HDR extends Demo { caps.setAlphaBits(floatAlphaBits); caps.setDepthBits(floatDepthBits); int[] tmp = new int[1]; - if (!GLDrawableFactory.getFactory(GLProfile.getDefault()).canCreateGLPbuffer()) { + if (!GLDrawableFactory.getFactory(GLProfile.getDefault()).canCreateGLPbuffer(null)) { unavailableExtension("Can not create pbuffer"); } if (pbuffer != null) { diff --git a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java index 6760161..0873d63 100644 --- a/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java +++ b/src/demos/hwShadowmapsSimple/HWShadowmapsSimple.java @@ -272,7 +272,7 @@ public class HWShadowmapsSimple extends Demo { GLCapabilities caps = new GLCapabilities(gl.getGLProfile()); caps.setDoubleBuffered(false); - if (!GLDrawableFactory.getFactory(gl.getGLProfile()).canCreateGLPbuffer()) { + if (!GLDrawableFactory.getFactory(gl.getGLProfile()).canCreateGLPbuffer(null)) { unavailableExtension("Can not create pbuffer"); } if (pbuffer != null) { diff --git a/src/demos/misc/TiledRendering.java b/src/demos/misc/TiledRendering.java index 44035fd..08fd70e 100755 --- a/src/demos/misc/TiledRendering.java +++ b/src/demos/misc/TiledRendering.java @@ -41,7 +41,7 @@ public class TiledRendering { GLCapabilities caps = new GLCapabilities(null); caps.setDoubleBuffered(false); - if (!GLDrawableFactory.getFactory(caps.getGLProfile()).canCreateGLPbuffer()) { + if (!GLDrawableFactory.getFactory(caps.getGLProfile()).canCreateGLPbuffer(null)) { System.out.println("Demo requires pbuffer support"); System.exit(1); } diff --git a/src/demos/proceduralTexturePhysics/Water.java b/src/demos/proceduralTexturePhysics/Water.java index f718604..593c2f0 100644 --- a/src/demos/proceduralTexturePhysics/Water.java +++ b/src/demos/proceduralTexturePhysics/Water.java @@ -214,7 +214,7 @@ public class Water { // create the pbuffer. Will use this as an offscreen rendering buffer. // it allows rendering a texture larger than our window. caps.setDoubleBuffered(false); - if (!GLDrawableFactory.getFactory(caps.getGLProfile()).canCreateGLPbuffer()) { + if (!GLDrawableFactory.getFactory(caps.getGLProfile()).canCreateGLPbuffer(null)) { throw new GLException("Pbuffers not supported with this graphics card"); } pbuffer = GLDrawableFactory.getFactory(caps.getGLProfile()).createGLPbuffer(caps, diff --git a/src/demos/readbuffer/Main.java b/src/demos/readbuffer/Main.java index c6ecefa..67c1b59 100755 --- a/src/demos/readbuffer/Main.java +++ b/src/demos/readbuffer/Main.java @@ -22,6 +22,7 @@ public class Main implements WindowListener, MouseListener, SurfaceUpdatedListen public void windowGainedFocus(WindowEvent e) { } public void windowLostFocus(WindowEvent e) { } public void windowDestroyNotify(WindowEvent e) { + System.err.println("********** quit **************"); quit = true; } @@ -58,7 +59,12 @@ public class Main implements WindowListener, MouseListener, SurfaceUpdatedListen capsOffscreen.setOnscreen(false); capsOffscreen.setPBuffer(pbuffer); capsOffscreen.setDoubleBuffered(false); - GLWindow windowOffscreen = GLWindow.create(capsOffscreen); + + Display nDisplay = NewtFactory.createDisplay(null); // local display + Screen nScreen = NewtFactory.createScreen(nDisplay, 0); // screen 0 + Window nWindow = NewtFactory.createWindow(nScreen, capsOffscreen, false /* undecorated */); + + GLWindow windowOffscreen = GLWindow.create(nWindow); windowOffscreen.enablePerfLog(true); windowOffscreen.setSize(w, h); windowOffscreen.setVisible(true); @@ -85,14 +91,16 @@ public class Main implements WindowListener, MouseListener, SurfaceUpdatedListen if ( TEST_SURFACE2FILE < typeTest ) { System.out.println("readbuffer.Main.run() Using a target onscreen window with read drawable attachment"); // Setup init onscreen window .. - Window nWindow = null; if(0!=(typeNewt&USE_AWT)) { Display nDisplay = NewtFactory.createDisplay(NativeWindowFactory.TYPE_AWT, null); // local display Screen nScreen = NewtFactory.createScreen(NativeWindowFactory.TYPE_AWT, nDisplay, 0); // screen 0 - nWindow = NewtFactory.createWindow(NativeWindowFactory.TYPE_AWT, nScreen, caps); + Window nWindow = NewtFactory.createWindow(NativeWindowFactory.TYPE_AWT, nScreen, caps); window = GLWindow.create(nWindow); } else { - window = GLWindow.create(caps); + Display nDisplay = NewtFactory.createDisplay(null); // local display + Screen nScreen = NewtFactory.createScreen(nDisplay, 0); // screen 0 + Window nWindow = NewtFactory.createWindow(nScreen, caps, false /* undecorated */); + window = GLWindow.create(nWindow); } window.addWindowListener(this); @@ -124,15 +132,29 @@ public class Main implements WindowListener, MouseListener, SurfaceUpdatedListen System.out.println(windowOffscreen); System.out.println("+++++++++++++++++++++++++++"); - while ( !quit && windowOffscreen.getDuration() < 31000) { + while ( !quit ) { // System.out.println("..............................."); windowOffscreen.display(); + if ( TEST_READBUFFER2SCREEN == typeTest ) { + if ( windowOffscreen.getDuration() >= 10000) { + break; + } + } else { + if ( windowOffscreen.getTotalFrames() >= 10) { + break; + } + } } // Shut things down cooperatively - window.destroy(); windowOffscreen.destroy(); - window.getFactory().shutdown(); + if(null!=window) { + window.destroy(); + } + try { + Thread.sleep(2000); + } catch (Exception e) {} + windowOffscreen.getFactory().shutdown(); System.out.println("readbuffer.Main shut down cleanly."); } catch (GLException e) { e.printStackTrace(); diff --git a/src/demos/texture/TextureConvert.java b/src/demos/texture/TextureConvert.java index 03c7357..7cf6993 100755 --- a/src/demos/texture/TextureConvert.java +++ b/src/demos/texture/TextureConvert.java @@ -75,7 +75,7 @@ public class TextureConvert { caps.setDoubleBuffered(false); // Make a pbuffer to get an offscreen context - if (!GLDrawableFactory.getFactory(glp).canCreateGLPbuffer()) { + if (!GLDrawableFactory.getFactory(glp).canCreateGLPbuffer(null)) { System.out.println("Pbuffer support not available (required to run this demo)"); System.exit(1); } |