diff options
author | Kenneth Russel <kbrussel@alum.mit.edu> | 2006-04-27 21:19:28 +0000 |
---|---|---|
committer | Kenneth Russel <kbrussel@alum.mit.edu> | 2006-04-27 21:19:28 +0000 |
commit | 97ab9cd1ef50c9e723454c57a1d8e0b24be253e6 (patch) | |
tree | 50336664ade858574a8522684108f0524805cd0e | |
parent | 52df7979c25abf11c43c9c88d4a098d6e2096271 (diff) |
Fixed problem in Java gluScaleImage implementation raised by user
invictus on javagaming.org forums when destination buffer was a
ByteBuffer
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/trunk@742 232f8b59-042b-4e1e-8c03-345bb8c30851
-rw-r--r-- | make/glu-CustomJavaCode.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/make/glu-CustomJavaCode.java b/make/glu-CustomJavaCode.java index 1ea4f20b9..17e1169c1 100644 --- a/make/glu-CustomJavaCode.java +++ b/make/glu-CustomJavaCode.java @@ -1292,14 +1292,16 @@ private int gluScaleImageJava( int format, int widthin, int heightin, widthout, heightout, typeout, out ); if( errno == 0 ) { out.rewind(); - if( dataout instanceof ShortBuffer ) { - ((ShortBuffer) dataout).put(out.asShortBuffer()); - } else if( dataout instanceof IntBuffer ) { - ((IntBuffer) dataout).put(out.asIntBuffer()); - } else if( dataout instanceof FloatBuffer ) { - ((FloatBuffer) dataout).put(out.asFloatBuffer()); - } else { - throw new RuntimeException("Should not reach here"); + if (out != dataout) { + if( dataout instanceof ShortBuffer ) { + ((ShortBuffer) dataout).put(out.asShortBuffer()); + } else if( dataout instanceof IntBuffer ) { + ((IntBuffer) dataout).put(out.asIntBuffer()); + } else if( dataout instanceof FloatBuffer ) { + ((FloatBuffer) dataout).put(out.asFloatBuffer()); + } else { + throw new RuntimeException("Should not reach here"); + } } } return( errno ); |