public static FloatBuffer createFloatBuffer(int size) { FloatBuffer buf = ByteBuffer.allocateDirect(4 * size).order(ByteOrder.nativeOrder()).asFloatBuffer(); buf.clear(); return buf;
public static FloatBuffer createFloatBuffer(ColorRGBA[] data) { if (data == null) return null; FloatBuffer buff = createFloatBuffer(4 * data.length); for (int x = 0; x < data.length; x++) { if (data[x] != null) buff.put(data[x].r).put(data[x].g).put(data[x].b).put(data[x].a); else buff.put(0).put(0).put(0).put(0); } buff.flip(); return buff;
    public static FloatBuffer createFloatBuffer(int size) {        FloatBuffer buf = ByteBuffer.allocateDirect(4 * size).order(ByteOrder.nativeOrder()).asFloatBuffer();        buf.clear();        return buf;    }