SHARE
TWEET

problems

a guest Dec 4th, 2014 144 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Fill buffers
  2. {      
  3.         ByteBuffer bb = ByteBuffer.allocateDirect(4*(vertexPositionArray.length+vertexNormalArray.length));
  4.         bb.order(ByteOrder.nativeOrder());
  5.         buffer = bb.asFloatBuffer();
  6.         buffer.put(vertexPositionArray);
  7.         buffer.put(vertexNormalArray);
  8.         buffer.rewind();
  9. }
  10. //fill vbos
  11. {
  12.         int buffers[] = new int[1];
  13.         GLES20.glGenBuffers(1, buffers, 0);
  14.         currentDatas.vboID = buffers[0];
  15.         GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, currentDatas.vboID);
  16.         {
  17.                 GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, (vertexPositionArray.length + vertexNormalArray.length) * 4, buffer, GLES20.GL_DYNAMIC_DRAW);
  18.         }
  19.         GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
  20. }
  21.  
  22. //Set buffers' currentDatas length
  23. {
  24.         currentDatas.vertexPositionLength = vertexPositionArray.length;
  25.         currentDatas.vertexNormalLength   = vertexNormalArray.length;
  26. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top