Project

General

Profile

« Previous | Next » 

Revision 6acc6481

Added by Leszek Koltunski over 7 years ago

Simplify Transform Feedback App.

View differences:

src/main/java/org/distorted/examples/feedback/FeedbackRenderer.java
73 73

  
74 74
      if (mappedBuffer!=null)
75 75
        {
76
        ByteBuffer bb = ((ByteBuffer) mappedBuffer);
77
        bb.order(ByteOrder.nativeOrder());
78
        FloatBuffer transformedData = bb.asFloatBuffer();
79

  
80
        Log.d( "TransformFeedback", String.format("output values = %f %f %f %f %f %f\n",
81
                  transformedData.get(), transformedData.get(), transformedData.get(),
82
                  transformedData.get(), transformedData.get(), transformedData.get() ));
76
        FloatBuffer fb = ((ByteBuffer) mappedBuffer).order(ByteOrder.nativeOrder()).asFloatBuffer();
77
        Log.d( "Feedback", String.format("values = %.2f %.2f %.2f %.2f %.2f %.2f\n",  fb.get(), fb.get(), fb.get(), fb.get(), fb.get(), fb.get() ));
83 78
        }
84 79

  
85 80
      GLES30.glUnmapBuffer(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER);
81
      GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, 0);
86 82
      }
87 83

  
88 84
///////////////////////////////////////////////////////////////////////////////////////////////////
......
136 132
      GLES30.glGenBuffers(1, mTBO, 0);
137 133
      GLES30.glBindBuffer(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, mTBO[0]);
138 134
      GLES30.glBufferData(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, mBufferLength, null, GLES30.GL_STATIC_READ);
135

  
136
      GLES30.glBindBuffer(GLES30.GL_ARRAY_BUFFER, 0);
139 137
      }
140 138
}

Also available in: Unified diff