本文整理汇总了Java中org.lwjgl.PointerBuffer.limit方法的典型用法代码示例。如果您正苦于以下问题:Java PointerBuffer.limit方法的具体用法?Java PointerBuffer.limit怎么用?Java PointerBuffer.limit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.PointerBuffer
的用法示例。
在下文中一共展示了PointerBuffer.limit方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printBuffer
import org.lwjgl.PointerBuffer; //导入方法依赖的package包/类
private String printBuffer(PointerBuffer buffer) {
long address = MemoryUtil.memAddress0(buffer);
int pos = buffer.position();
int lim = buffer.limit();
int cap = buffer.capacity();
if (pos == 0 && lim == cap)
return "PointerBuffer[0x" + Long.toString(address, 16) + ", " + lim + "]";
else
return "PointerBuffer[0x" + Long.toString(address, 16) + ", " + pos + ", " + lim + ", " + cap + "]";
}
示例2: create
import org.lwjgl.PointerBuffer; //导入方法依赖的package包/类
public static void create()
{
PointerBuffer displayPointers = glfwGetMonitors();
Display.displays = new ArrayList<>();
for(int i = 0; i < displayPointers.limit(); i++)
{
long id = displayPointers.get(i);
Display.displays.add(new Display(id));
}
glfwSetMonitorCallback(new DisplayCallback());
}
示例3: registerCLKernels
import org.lwjgl.PointerBuffer; //导入方法依赖的package包/类
/**
* Called from clCreateKernelsInProgram to register new CLKernels.
*
* @param kernels a buffer containing CLKernel pointers.
*/
void registerCLKernels(final PointerBuffer kernels) {
for ( int i = kernels.position(); i < kernels.limit(); i++ ) {
final long pointer = kernels.get(i);
if ( pointer != 0 )
new CLKernel(pointer, this);
}
}
示例4: registerSubCLDevices
import org.lwjgl.PointerBuffer; //导入方法依赖的package包/类
/**
* Called from clCreateSubDevicesEXT to register new sub-devices.
*
* @param devices a buffer containing CLDevice pointers.
*/
void registerSubCLDevices(final PointerBuffer devices) {
for ( int i = devices.position(); i < devices.limit(); i++ ) {
final long pointer = devices.get(i);
if ( pointer != 0 )
new CLDevice(pointer, this);
}
}
示例5: getMonitors
import org.lwjgl.PointerBuffer; //导入方法依赖的package包/类
@Override
public IMonitor[] getMonitors() {
PointerBuffer monitors = GLFW.glfwGetMonitors();
IMonitor[] result = new IMonitor[monitors.limit()];
for(int i = 0; i < result.length; i++)
result[i] = new GLFWMonitor(monitors.get(i), i);
return result;
}
示例6: getSizesBuffer
import org.lwjgl.PointerBuffer; //导入方法依赖的package包/类
protected PointerBuffer getSizesBuffer(final T object, final int param_name) {
final int size = getInfoSizeArraySize(object, param_name);
final PointerBuffer buffer = APIUtil.getBufferPointer(size);
buffer.limit(size);
getInfo(object, param_name, buffer.getBuffer(), null);
return buffer;
}