例からソースコードをコピーして貼り付けるのは1つのことですが、例がそのようになっている理由について、いくつかの答えを探しています。
私が答えられない1つの質問は、三角形のByteBufferが座標ごとに4バイトを必要とする理由です。
Googleが提示した例では、ByteBufferは三角形の座標ごとに4バイトでインスタンス化されます。
// initialize vertex byte buffer for shape coordinates
// (number of coordinate values * 4 bytes per float)
ByteBuffer bb = ByteBuffer.allocateDirect(triangleCoords.length * 4);
// use the device hardware's native byte order
bb.order(ByteOrder.nativeOrder());
- なぜそれは2または8ではなく座標ごとに4バイトなのですか?
- nativeOrder()呼び出しの目的は何ですか?