diff options
Diffstat (limited to 'src/demos/texture/TextureConvert.java')
-rwxr-xr-x | src/demos/texture/TextureConvert.java | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/demos/texture/TextureConvert.java b/src/demos/texture/TextureConvert.java index 6287acb..a507bce 100755 --- a/src/demos/texture/TextureConvert.java +++ b/src/demos/texture/TextureConvert.java @@ -1,21 +1,21 @@ /* * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: - * + * * - Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * - Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * + * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. - * + * * This software is provided "AS IS," without a warranty of any kind. ALL * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A @@ -28,29 +28,31 @@ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * + * * You acknowledge that this software is not designed or intended for use * in the design, construction, operation or maintenance of any nuclear * facility. - * + * * Sun gratefully acknowledges that this software was originally authored * and developed by Kenneth Bradley Russell and Christopher John Kline. */ package demos.texture; -import com.jogamp.common.util.IOUtil; -import com.jogamp.opengl.util.texture.Texture; -import com.jogamp.opengl.util.texture.TextureData; -import com.jogamp.opengl.util.texture.TextureIO; import java.io.File; import java.io.IOException; + import javax.media.opengl.GL; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLDrawableFactory; -import javax.media.opengl.GLPbuffer; +import javax.media.opengl.GLOffscreenAutoDrawable; import javax.media.opengl.GLProfile; +import com.jogamp.common.util.IOUtil; +import com.jogamp.opengl.util.texture.Texture; +import com.jogamp.opengl.util.texture.TextureData; +import com.jogamp.opengl.util.texture.TextureIO; + /** Demonstrates how the TextureIO subsystem may be used to convert @@ -79,7 +81,8 @@ public class TextureConvert { System.out.println("Pbuffer support not available (required to run this demo)"); System.exit(1); } - GLPbuffer pbuffer = GLDrawableFactory.getFactory(glp).createGLPbuffer(null, caps, null, 2, 2, null); + GLOffscreenAutoDrawable pbuffer = GLDrawableFactory.getFactory(glp).createOffscreenAutoDrawable(null, caps, null, 2, 2); + pbuffer.display(); // force init pbuffer.getContext().makeCurrent(); GL gl = pbuffer.getGL(); |