diff options
author | Sven Gothel <[email protected]> | 2010-03-26 20:00:46 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-03-26 20:00:46 +0100 |
commit | d1dfb4a367b3fa2350122a9623e3f1b56210a86e (patch) | |
tree | 9d3b4bc39d8cb7ff8c9dadeb291e435d9ad6cdd0 /src/demos/texture/TextureConvert.java | |
parent | 08d7de9c49d6bd778d0a915731ae9edbafdf646c (diff) |
Adapted JOGL TextureData API changes (138a5b057e39a4738a2e82f370424a9a21aceea9)
Diffstat (limited to 'src/demos/texture/TextureConvert.java')
-rwxr-xr-x | src/demos/texture/TextureConvert.java | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/demos/texture/TextureConvert.java b/src/demos/texture/TextureConvert.java index aaf75a2..df15fc2 100755 --- a/src/demos/texture/TextureConvert.java +++ b/src/demos/texture/TextureConvert.java @@ -49,6 +49,7 @@ import javax.media.opengl.GL; import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLDrawableFactory; import javax.media.opengl.GLPbuffer; +import javax.media.opengl.GLProfile; @@ -69,15 +70,16 @@ public class TextureConvert { String inputFile = args[0]; String outputFile = args[1]; - GLCapabilities caps = new GLCapabilities(null); + GLProfile glp = GLProfile.getDefault(); + GLCapabilities caps = new GLCapabilities(glp); caps.setDoubleBuffered(false); // Make a pbuffer to get an offscreen context - if (!GLDrawableFactory.getFactory(caps.getGLProfile()).canCreateGLPbuffer()) { + if (!GLDrawableFactory.getFactory(glp).canCreateGLPbuffer()) { System.out.println("Pbuffer support not available (required to run this demo)"); System.exit(1); } - GLPbuffer pbuffer = GLDrawableFactory.getFactory(caps.getGLProfile()).createGLPbuffer(caps, null, 2, 2, null); + GLPbuffer pbuffer = GLDrawableFactory.getFactory(glp).createGLPbuffer(caps, null, 2, 2, null); pbuffer.getContext().makeCurrent(); GL gl = pbuffer.getGL(); @@ -89,7 +91,7 @@ public class TextureConvert { } } - TextureData inputData = TextureIO.newTextureData(new File(inputFile), false, null); + TextureData inputData = TextureIO.newTextureData(glp, new File(inputFile), false, null); if (attemptCompression && !inputData.isDataCompressed()) { inputData.setInternalFormat(GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT); } |