diff options
author | Julien Gouesse <[email protected]> | 2013-03-09 10:09:22 +0100 |
---|---|---|
committer | Julien Gouesse <[email protected]> | 2013-03-09 10:09:22 +0100 |
commit | 59a56df1e89076577753e9484e5c2bfb2a5115cd (patch) | |
tree | 651b6c92b480068725e0d69970759cb64cd31a3f /ardor3d-jogl/src/main/java/com | |
parent | a4614dc6c745ab9eaa4065713e014154783feb4c (diff) |
Fixes GeneratedTexturesExample (several rewind() calls were missing in the API)
Diffstat (limited to 'ardor3d-jogl/src/main/java/com')
-rw-r--r-- | ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java index 9ebc82d..e2bff71 100644 --- a/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java +++ b/ardor3d-jogl/src/main/java/com/ardor3d/scene/state/jogl/JoglTextureStateUtil.java @@ -186,6 +186,8 @@ public class JoglTextureStateUtil { final int pixDataType = JoglTextureUtil.getGLPixelDataType(image.getDataType()); final int bpp = ImageUtils.getPixelByteSize(image.getDataFormat(), image.getDataType()); final ByteBuffer scaledImage = BufferUtils.createByteBuffer((w + 4) * h * bpp); + // ensure the buffer is ready for reading + image.getData(0).rewind(); final int error = glu.gluScaleImage(pixFormat, actualWidth, actualHeight, pixDataType, image.getData(0), w, h, pixDataType, scaledImage); if (error != 0) { @@ -353,6 +355,7 @@ public class JoglTextureStateUtil { for (int x = 0; x < image.getData().size(); x++) { if (image.getData(x) != null) { data.put(image.getData(x)); + image.getData(x).rewind(); } } // ensure the buffer is ready for reading |