本文整理汇总了Java中org.lwjgl.system.MemoryUtil.memCopy方法的典型用法代码示例。如果您正苦于以下问题:Java MemoryUtil.memCopy方法的具体用法?Java MemoryUtil.memCopy怎么用?Java MemoryUtil.memCopy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.system.MemoryUtil
的用法示例。
在下文中一共展示了MemoryUtil.memCopy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: send
import org.lwjgl.system.MemoryUtil; //导入方法依赖的package包/类
public void send(long addr, int size) {
if (lastSend != null && !lastSend.isDone()) {
/* We have to wait for the last send to complete until we can reuse the buffer */
try {
lastSend.get();
} catch (Exception e) {
}
}
MemoryUtil.memCopy(addr, bufferAddr, size);
buffer.rewind();
buffer.limit(size);
lastSend = outbound.getRemote().sendBytesByFuture(buffer);
}
示例2: setRange
import org.lwjgl.system.MemoryUtil; //导入方法依赖的package包/类
/**
* Set a range
* @param buf The buffer
* @param offsetInBytes The offset
* @param lengthInBytes The bytes
*/
public void setRange(ByteBuffer buf, int offsetInBytes, int lengthInBytes) {
setMinSize(offsetInBytes + lengthInBytes);
MemoryUtil.memCopy(MemoryUtil.memAddress(buf), MemoryUtil.memAddress(data) + offsetInBytes, lengthInBytes);
dirtyMin = Math.min(offsetInBytes, dirtyMin);
dirtyMax = Math.max(offsetInBytes + lengthInBytes, dirtyMax);
}
示例3: setRange
import org.lwjgl.system.MemoryUtil; //导入方法依赖的package包/类
/**
* Set a range
* @param buf The buffer
* @param offsetInBytes The offset
* @param lengthInBytes The length
*/
public void setRange(FloatBuffer buf, int offsetInBytes, int lengthInBytes) {
setMinSize(offsetInBytes + lengthInBytes);
MemoryUtil.memCopy(MemoryUtil.memAddress(buf), MemoryUtil.memAddress(data) + offsetInBytes, lengthInBytes);
dirtyMin = Math.min(offsetInBytes, dirtyMin);
dirtyMax = Math.max(offsetInBytes + lengthInBytes, dirtyMax);
}
示例4: setRange
import org.lwjgl.system.MemoryUtil; //导入方法依赖的package包/类
/**
* Set a range
* @param buf The buffer
* @param offsetInBytes The offset
* @param lengthInBytes The length
*/
public void setRange(IntBuffer buf, int offsetInBytes, int lengthInBytes) {
setMinSize(offsetInBytes + lengthInBytes);
MemoryUtil.memCopy(MemoryUtil.memAddress(buf), MemoryUtil.memAddress(data) + offsetInBytes, lengthInBytes);
dirtyMin = Math.min(offsetInBytes, dirtyMin);
dirtyMax = Math.max(offsetInBytes + lengthInBytes, dirtyMax);
}
示例5: get
import org.lwjgl.system.MemoryUtil; //导入方法依赖的package包/类
/**
* Get this buffer
* @param dest The destination buffer
* @return The detination buffer or a new buffer it it was <code>null</code>
*/
public ByteBuffer get(ByteBuffer dest) {
if (dest == null)
dest = BufferUtils.createByteBuffer(size);
bind();
ByteBuffer src = GL15.glMapBuffer(GL21.GL_PIXEL_PACK_BUFFER, GL15.GL_READ_ONLY);
MemoryUtil.memCopy(MemoryUtil.memAddress(src), MemoryUtil.memAddress(dest), size);
GL15.glUnmapBuffer(GL21.GL_PIXEL_PACK_BUFFER);
unbind();
return dest;
}
示例6: copy
import org.lwjgl.system.MemoryUtil; //导入方法依赖的package包/类
/**
* Copies {@code bytes} bytes from {@code in} buffer starting at its current
* position into {@code out} buffer starting at its current position.
* @param in buffer from the data will come from
* @param out buffer where the data will be copied to
* @param bytes number of bytes to copy
*/
public static void copy(ByteBuffer in, ByteBuffer out, int bytes) {
MemoryUtil.memCopy(MemoryUtil.memAddress(in), MemoryUtil.memAddress(out), bytes);
}