From 59a56df1e89076577753e9484e5c2bfb2a5115cd Mon Sep 17 00:00:00 2001 From: Julien Gouesse Date: Sat, 9 Mar 2013 10:09:22 +0100 Subject: Fixes GeneratedTexturesExample (several rewind() calls were missing in the API) --- .../src/main/java/com/ardor3d/image/util/GeneratedImageFactory.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ardor3d-core/src/main/java') diff --git a/ardor3d-core/src/main/java/com/ardor3d/image/util/GeneratedImageFactory.java b/ardor3d-core/src/main/java/com/ardor3d/image/util/GeneratedImageFactory.java index 3591455..6316b57 100644 --- a/ardor3d-core/src/main/java/com/ardor3d/image/util/GeneratedImageFactory.java +++ b/ardor3d-core/src/main/java/com/ardor3d/image/util/GeneratedImageFactory.java @@ -171,6 +171,7 @@ public abstract class GeneratedImageFactory { } final ByteBuffer dataBuf = BufferUtils.createByteBuffer(data.length); dataBuf.put(data); + dataBuf.rewind(); dataList.add(dataBuf); } @@ -216,11 +217,12 @@ public abstract class GeneratedImageFactory { } } out.put(data); + out.rewind(); dataList.add(out); } - return new Image(useAlpha ? ImageDataFormat.RGBA : ImageDataFormat.RGB, PixelDataType.UnsignedByte, lumImage - .getWidth(), lumImage.getHeight(), dataList, null); + return new Image(useAlpha ? ImageDataFormat.RGBA : ImageDataFormat.RGB, PixelDataType.UnsignedByte, + lumImage.getWidth(), lumImage.getHeight(), dataList, null); } /** -- cgit v1.2.3