From d1dfb4a367b3fa2350122a9623e3f1b56210a86e Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 26 Mar 2010 20:00:46 +0100 Subject: Adapted JOGL TextureData API changes (138a5b057e39a4738a2e82f370424a9a21aceea9) --- src/demos/proceduralTexturePhysics/Water.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/demos/proceduralTexturePhysics/Water.java') diff --git a/src/demos/proceduralTexturePhysics/Water.java b/src/demos/proceduralTexturePhysics/Water.java index 89c1495..3a5d1a8 100644 --- a/src/demos/proceduralTexturePhysics/Water.java +++ b/src/demos/proceduralTexturePhysics/Water.java @@ -45,6 +45,7 @@ import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import javax.media.opengl.GLProfile; import javax.media.opengl.GL; import javax.media.opengl.GL2ES1; import javax.media.opengl.GL2; @@ -205,7 +206,9 @@ public class Water { String cubeMapFilenamePrefix, String cubeMapFilenameSuffix, GLAutoDrawable parentWindow) { - loadInitialTexture(initialMapFilename); + GLCapabilities caps = parentWindow.getChosenGLCapabilities(); + + loadInitialTexture(caps.getGLProfile(), initialMapFilename); tmpSpinFilename = spinFilename; tmpDropletFilename = dropletFilename; tmpCubeMapFilenamePrefix = cubeMapFilenamePrefix; @@ -213,7 +216,6 @@ public class Water { // create the pbuffer. Will use this as an offscreen rendering buffer. // it allows rendering a texture larger than our window. - GLCapabilities caps = parentWindow.getChosenGLCapabilities(); caps.setDoubleBuffered(false); if (!GLDrawableFactory.getFactory(caps.getGLProfile()).canCreateGLPbuffer()) { throw new GLException("Pbuffers not supported with this graphics card"); @@ -493,9 +495,10 @@ public class Water { // We need to load the initial texture file early to get the width // and height for the pbuffer - private void loadInitialTexture(String initialMapFilename) { + private void loadInitialTexture(GLProfile glp, String initialMapFilename) { try { - initialMapData = TextureIO.newTextureData(getClass().getClassLoader().getResourceAsStream(initialMapFilename), + initialMapData = TextureIO.newTextureData(glp, + getClass().getClassLoader().getResourceAsStream(initialMapFilename), false, FileUtil.getFileSuffix(initialMapFilename)); } catch (IOException e) { -- cgit v1.2.3