From 6ac1c8c8995458671cf603e46bff89fcaefd8146 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 10 Oct 2012 15:09:09 +0200 Subject: FloatUtil/PMVMatrix/GLUniformData: Move impl. of FloatBuffer matrix toString(..) from PMVMatrix to FloatUtil and make it more generic; GLUniformData toString() also dumps it's matrices. --- .../classes/javax/media/opengl/GLUniformData.java | 36 +++++++++++++++++----- 1 file changed, 29 insertions(+), 7 deletions(-) (limited to 'src/jogl/classes/javax') diff --git a/src/jogl/classes/javax/media/opengl/GLUniformData.java b/src/jogl/classes/javax/media/opengl/GLUniformData.java index 475ff4546..095115ff8 100644 --- a/src/jogl/classes/javax/media/opengl/GLUniformData.java +++ b/src/jogl/classes/javax/media/opengl/GLUniformData.java @@ -3,6 +3,9 @@ package javax.media.opengl; import java.nio.*; +import com.jogamp.common.nio.Buffers; +import com.jogamp.opengl.FloatUtil; + public class GLUniformData { /** @@ -69,14 +72,33 @@ public class GLUniformData { public IntBuffer intBufferValue() { return (IntBuffer)data; }; public FloatBuffer floatBufferValue() { return (FloatBuffer)data; }; + public StringBuilder toString(StringBuilder sb) { + if(null == sb) { + sb = new StringBuilder(); + } + sb.append("GLUniformData[name ").append(name). + append(", location ").append(location). + append(", size ").append(rows).append("x").append(columns). + append(", count ").append(count). + append(", data "); + if(isMatrix() && data instanceof FloatBuffer) { + sb.append("\n"); + final FloatBuffer fb = (FloatBuffer)getBuffer(); + for(int i=0; i