SHARE
TWEET
problems
a guest
Dec 4th, 2014
144
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- //Fill buffers
- {
- ByteBuffer bb = ByteBuffer.allocateDirect(4*(vertexPositionArray.length+vertexNormalArray.length));
- bb.order(ByteOrder.nativeOrder());
- buffer = bb.asFloatBuffer();
- buffer.put(vertexPositionArray);
- buffer.put(vertexNormalArray);
- buffer.rewind();
- }
- //fill vbos
- {
- int buffers[] = new int[1];
- GLES20.glGenBuffers(1, buffers, 0);
- currentDatas.vboID = buffers[0];
- GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, currentDatas.vboID);
- {
- GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, (vertexPositionArray.length + vertexNormalArray.length) * 4, buffer, GLES20.GL_DYNAMIC_DRAW);
- }
- GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, 0);
- }
- //Set buffers' currentDatas length
- {
- currentDatas.vertexPositionLength = vertexPositionArray.length;
- currentDatas.vertexNormalLength = vertexNormalArray.length;
- }
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.

