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/proceduralTexturePhysics | |
parent | 08d7de9c49d6bd778d0a915731ae9edbafdf646c (diff) |
Adapted JOGL TextureData API changes (138a5b057e39a4738a2e82f370424a9a21aceea9)
Diffstat (limited to 'src/demos/proceduralTexturePhysics')
-rw-r--r-- | src/demos/proceduralTexturePhysics/Water.java | 11 |
1 files changed, 7 insertions, 4 deletions
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) { |