当前位置: 首页>>代码示例>>Java>>正文


Java MemoryUtil.memCopy方法代码示例

本文整理汇总了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);
}
 
开发者ID:LWJGLX,项目名称:debug,代码行数:14,代码来源:Profiling.java

示例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);
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:13,代码来源:GraphicsBuffer.java

示例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);
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:13,代码来源:VertexBuffer.java

示例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);
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:13,代码来源:IndexBuffer.java

示例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;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:16,代码来源:PixelPackBuffer.java

示例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);
}
 
开发者ID:melchor629,项目名称:Java-GLEngine,代码行数:11,代码来源:MemoryUtils.java


注:本文中的org.lwjgl.system.MemoryUtil.memCopy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。