本文整理汇总了Java中org.lwjgl.PointerBuffer.position方法的典型用法代码示例。如果您正苦于以下问题:Java PointerBuffer.position方法的具体用法?Java PointerBuffer.position怎么用?Java PointerBuffer.position使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.PointerBuffer
的用法示例。
在下文中一共展示了PointerBuffer.position方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: glCreateShaderProgramv
import org.lwjgl.PointerBuffer; //导入方法依赖的package包/类
public static int glCreateShaderProgramv(int type, PointerBuffer strings) {
int shader = org.lwjgl.opengl.ARBSeparateShaderObjects.glCreateShaderProgramv(type, strings);
if (TRACE.enabled) {
/* Log the shader source */
StringBuilder sb = new StringBuilder();
if (strings != null) {
int stringsPos = strings.position();
for (int i = 0; i < strings.remaining(); i++) {
String source = org.lwjgl.system.MemoryUtil.memASCII(strings.get(stringsPos + i));
sb.append(source);
}
}
trace("Shader source for shader [" + shader + "]:\n" + sb.toString());
}
return shader;
}
示例2: glCreateShaderProgramv
import org.lwjgl.PointerBuffer; //导入方法依赖的package包/类
public static int glCreateShaderProgramv(int type, PointerBuffer strings) {
int shader = org.lwjgl.opengl.GL41.glCreateShaderProgramv(type, strings);
if (TRACE.enabled) {
/* Log the shader source */
StringBuilder sb = new StringBuilder();
if (strings != null) {
int stringsPos = strings.position();
for (int i = 0; i < strings.remaining(); i++) {
String source = org.lwjgl.system.MemoryUtil.memASCII(strings.get(stringsPos + i));
sb.append(source);
}
}
trace("Shader source for shader [" + shader + "]:\n" + sb.toString());
}
return shader;
}
示例3: 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 + "]";
}
示例4: registerCLPlatforms
import org.lwjgl.PointerBuffer; //导入方法依赖的package包/类
/**
* Called from clGetPlatformIDs to register new platforms.
*
* @param platforms a buffer containing CLPlatform pointers.
*/
static void registerCLPlatforms(final PointerBuffer platforms, final IntBuffer num_platforms) {
if ( platforms == null )
return;
final int pos = platforms.position();
final int count = min(num_platforms.get(0), platforms.remaining()); // We can't depend on .remaining()
for ( int i = 0; i < count; i++ ) {
final long id = platforms.get(pos + i);
if ( !clPlatforms.containsKey(id) )
new CLPlatform(id);
}
}
示例5: registerCLDevices
import org.lwjgl.PointerBuffer; //导入方法依赖的package包/类
/**
* Called from <code>clGetDeviceIDs</code> to register new devices.
*
* @param devices a buffer containing CLDevice pointers.
*/
void registerCLDevices(final PointerBuffer devices, final IntBuffer num_devices) {
final int pos = devices.position();
final int count = min(num_devices.get(num_devices.position()), devices.remaining()); // We can't depend on .remaining()
for ( int i = 0; i < count; i++ ) {
final long id = devices.get(pos + i);
if ( !clDevices.hasObject(id) )
new CLDevice(id, this);
}
}
示例6: 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);
}
}
示例7: 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);
}
}