A complete 3D game development suite written purely in Java.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
jmonkeyengine/jme3-lwjgl3/src/main/java/com/jme3/util/LWJGLBufferAllocator.java

25 lines
538 B

package com.jme3.util;
import org.lwjgl.system.MemoryUtil;
import java.nio.Buffer;
import java.nio.ByteBuffer;
/**
* The implementation of the {@link BufferAllocator} which use {@link MemoryUtil} to manage memory.
*
* @author JavaSaBr
*/
public class LWJGLBufferAllocator implements BufferAllocator {
@Override
public void destroyDirectBuffer(final Buffer buffer) {
MemoryUtil.memFree(buffer);
}
@Override
public ByteBuffer allocate(final int size) {
return MemoryUtil.memAlloc(size);
}
}