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


Java PointerBuffer.position方法代码示例

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

示例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;
}
 
开发者ID:LWJGLX,项目名称:debug,代码行数:17,代码来源:GL41.java

示例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 + "]";
}
 
开发者ID:LWJGLX,项目名称:debug,代码行数:11,代码来源:MethodCall.java

示例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);
	}
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:18,代码来源:CLPlatform.java

示例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);
	}
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:15,代码来源:CLPlatform.java

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

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


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