Java: FloatBuffer to OpenGL - wrap() vs. allocate() vs. BufferUtils.createBuffer()

前端 未结 1 1745
囚心锁ツ
囚心锁ツ 2021-01-23 04:30

Datasource:

float[] v = { ... };

Working example:

FloatBuffer buf = BufferUtils.createFloatBuffer(v.length);
buf.put(v);
buf.fl         


        
1条回答
  •  一整个雨季
    2021-01-23 04:48

    BufferUtils returns a direct buffer whereas the others might not.

    You can check the directness of the wrap and allocate methods using isDirect() method. Wrappers are non direct.

    0 讨论(0)
提交回复
热议问题