mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-05 14:35:58 +00:00
Added missing include.
This commit is contained in:
parent
ce777ef350
commit
d53afc0b4d
2 changed files with 13 additions and 7 deletions
|
|
@ -80,12 +80,8 @@ public class PointerBuffer implements Comparable {
|
|||
* @param source the source buffer
|
||||
*/
|
||||
public PointerBuffer(final ByteBuffer source) {
|
||||
if ( !source.isDirect() )
|
||||
throw new IllegalArgumentException("ByteBuffer is not direct");
|
||||
|
||||
final int alignment = is64Bit ? 8 : 4;
|
||||
if ( (BufferUtils.getBufferAddress(source) + source.position()) % alignment != 0 || source.remaining() % alignment != 0 )
|
||||
throw new IllegalArgumentException("The source buffer is not aligned to " + alignment + " bytes.");
|
||||
if ( LWJGLUtil.CHECKS )
|
||||
checkSource(source);
|
||||
|
||||
pointers = source.slice().order(source.order());
|
||||
|
||||
|
|
@ -98,6 +94,15 @@ public class PointerBuffer implements Comparable {
|
|||
}
|
||||
}
|
||||
|
||||
private static void checkSource(final ByteBuffer source) {
|
||||
if ( !source.isDirect() )
|
||||
throw new IllegalArgumentException("The source buffer is not direct.");
|
||||
|
||||
final int alignment = is64Bit ? 8 : 4;
|
||||
if ( (BufferUtils.getBufferAddress(source) + source.position()) % alignment != 0 || source.remaining() % alignment != 0 )
|
||||
throw new IllegalArgumentException("The source buffer is not aligned to " + alignment + " bytes.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the ByteBuffer that backs this PointerBuffer.
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue