aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java')
-rw-r--r--src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java44
1 files changed, 30 insertions, 14 deletions
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
index 2998f3fe1..e5dcfeb84 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
@@ -29,6 +29,8 @@ package jogamp.graph.curve.opengl;
import java.io.PrintStream;
import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.nio.ShortBuffer;
import com.jogamp.opengl.GL2ES2;
import com.jogamp.opengl.GLProfile;
@@ -299,12 +301,15 @@ public class VBORegion2PVBAAES2 extends GLRegion {
// NIO array[3] is much slows than group/single
// gca_VerticesAttr.putf(coords, 0, 3);
// gca_CurveParamsAttr.putf(texParams, 0, 3);
- gca_VerticesAttr.put3f(coords[0], coords[1], coords[2]);
- gca_CurveParamsAttr.put3f(texParams[0], texParams[1], texParams[2]);
+ // gca_VerticesAttr.put3f(coords[0], coords[1], coords[2]);
+ put3f((FloatBuffer)gca_VerticesAttr.getBuffer(), coords[0], coords[1], coords[2]);
+ // gca_CurveParamsAttr.put3f(texParams[0], texParams[1], texParams[2]);
+ put3f((FloatBuffer)gca_CurveParamsAttr.getBuffer(), texParams[0], texParams[1], texParams[2]);
if( null != gca_ColorsAttr ) {
if( null != rgba ) {
// gca_ColorsAttr.putf(rgba, 0, 4);
- gca_ColorsAttr.put4f(rgba[0], rgba[1], rgba[2], rgba[3]);
+ // gca_ColorsAttr.put4f(rgba[0], rgba[1], rgba[2], rgba[3]);
+ put4f((FloatBuffer)gca_ColorsAttr.getBuffer(), rgba[0], rgba[1], rgba[2], rgba[3]);
} else {
throw new IllegalArgumentException("Null color given for COLOR_CHANNEL rendering mode");
}
@@ -314,18 +319,27 @@ public class VBORegion2PVBAAES2 extends GLRegion {
@Override
protected final void pushVertices(final float[] coords1, final float[] coords2, final float[] coords3,
final float[] texParams1, final float[] texParams2, final float[] texParams3, final float[] rgba) {
- gca_VerticesAttr.put3f(coords1[0], coords1[1], coords1[2]);
- gca_VerticesAttr.put3f(coords2[0], coords2[1], coords2[2]);
- gca_VerticesAttr.put3f(coords3[0], coords3[1], coords3[2]);
- gca_CurveParamsAttr.put3f(texParams1[0], texParams1[1], texParams1[2]);
- gca_CurveParamsAttr.put3f(texParams2[0], texParams2[1], texParams2[2]);
- gca_CurveParamsAttr.put3f(texParams3[0], texParams3[1], texParams3[2]);
+ // gca_VerticesAttr.put3f(coords1[0], coords1[1], coords1[2]);
+ // gca_VerticesAttr.put3f(coords2[0], coords2[1], coords2[2]);
+ // gca_VerticesAttr.put3f(coords3[0], coords3[1], coords3[2]);
+ put3f((FloatBuffer)gca_VerticesAttr.getBuffer(), coords1[0], coords1[1], coords1[2]);
+ put3f((FloatBuffer)gca_VerticesAttr.getBuffer(), coords2[0], coords2[1], coords2[2]);
+ put3f((FloatBuffer)gca_VerticesAttr.getBuffer(), coords3[0], coords3[1], coords3[2]);
+ // gca_CurveParamsAttr.put3f(texParams1[0], texParams1[1], texParams1[2]);
+ // gca_CurveParamsAttr.put3f(texParams2[0], texParams2[1], texParams2[2]);
+ // gca_CurveParamsAttr.put3f(texParams3[0], texParams3[1], texParams3[2]);
+ put3f((FloatBuffer)gca_CurveParamsAttr.getBuffer(), texParams1[0], texParams1[1], texParams1[2]);
+ put3f((FloatBuffer)gca_CurveParamsAttr.getBuffer(), texParams2[0], texParams2[1], texParams2[2]);
+ put3f((FloatBuffer)gca_CurveParamsAttr.getBuffer(), texParams3[0], texParams3[1], texParams3[2]);
if( null != gca_ColorsAttr ) {
if( null != rgba ) {
final float r=rgba[0], g=rgba[1], b=rgba[2], a=rgba[3];
- gca_ColorsAttr.put4f(r, g, b, a);
- gca_ColorsAttr.put4f(r, g, b, a);
- gca_ColorsAttr.put4f(r, g, b, a);
+ // gca_ColorsAttr.put4f(r, g, b, a);
+ // gca_ColorsAttr.put4f(r, g, b, a);
+ // gca_ColorsAttr.put4f(r, g, b, a);
+ put4f((FloatBuffer)gca_ColorsAttr.getBuffer(), r, g, b, a);
+ put4f((FloatBuffer)gca_ColorsAttr.getBuffer(), r, g, b, a);
+ put4f((FloatBuffer)gca_ColorsAttr.getBuffer(), r, g, b, a);
} else {
throw new IllegalArgumentException("Null color given for COLOR_CHANNEL rendering mode");
}
@@ -344,9 +358,11 @@ public class VBORegion2PVBAAES2 extends GLRegion {
@Override
protected final void pushIndices(final int idx1, final int idx2, final int idx3) {
if( usesI32Idx() ) {
- indicesBuffer.put3i(idx1, idx2, idx3);
+ // indicesBuffer.put3i(idx1, idx2, idx3);
+ put3i((IntBuffer)indicesBuffer.getBuffer(), idx1, idx2, idx3);
} else {
- indicesBuffer.put3s((short)idx1, (short)idx2, (short)idx3);
+ // indicesBuffer.put3s((short)idx1, (short)idx2, (short)idx3);
+ put3s((ShortBuffer)indicesBuffer.getBuffer(), (short)idx1, (short)idx2, (short)idx3);
}
}