PDA

View Full Version : What is the correct way to create buffer?



EdwardComb
05-11-2011, 10:02 PM
What is the correct way to create buffer?





ByteBuffer floatBuf = ByteBuffer.allocateDirect(vertex.length * 4);
floatBuf.order(ByteOrder.ntaiveOrder());
vBuf = floatBuf.asFloatBuffer();
vBuf.put(vertex);
vBuf.position(0);




Some tutorials also do like this




cubeVertexBfr[i]=FloatBuffer.wrap(vertices);




What's the difference?