What is the correct way to create buffer?

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?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.