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


Java Drawable.setCLSharingProperties方法代码示例

本文整理汇总了Java中org.lwjgl.opengl.Drawable.setCLSharingProperties方法的典型用法代码示例。如果您正苦于以下问题:Java Drawable.setCLSharingProperties方法的具体用法?Java Drawable.setCLSharingProperties怎么用?Java Drawable.setCLSharingProperties使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.opengl.Drawable的用法示例。


在下文中一共展示了Drawable.setCLSharingProperties方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import org.lwjgl.opengl.Drawable; //导入方法依赖的package包/类
/** Custom clCreateContext implementation (reuses APIUtil.getBufferPointer) */
public CLContext create(final CLPlatform platform, final List<CLDevice> devices, final CLContextCallback pfn_notify, final Drawable share_drawable, IntBuffer errcode_ret) throws LWJGLException {
	final int propertyCount = 2 + (share_drawable == null ? 0 : 4) + 1;

	final PointerBuffer properties = APIUtil.getBufferPointer(propertyCount + devices.size());
	properties.put(CL_CONTEXT_PLATFORM).put(platform);
	if ( share_drawable != null )
		share_drawable.setCLSharingProperties(properties);
	properties.put(0);

	properties.position(propertyCount); // Make sure we're at the right offset, setCLSharingProperties might not use all 4 positions.
	for ( CLDevice device : devices )
		properties.put(device);

	final long function_pointer = CLCapabilities.clCreateContext;
	BufferChecks.checkFunctionAddress(function_pointer);
	if ( errcode_ret != null )
		BufferChecks.checkBuffer(errcode_ret, 1);
	else if ( LWJGLUtil.DEBUG )
		errcode_ret = APIUtil.getBufferInt();
	final long user_data = pfn_notify == null || pfn_notify.isCustom() ? 0 : CallbackUtil.createGlobalRef(pfn_notify);
	CLContext __result = null;
	try {
		__result = new CLContext(nclCreateContext(MemoryUtil.getAddress0(properties.getBuffer()), devices.size(), MemoryUtil.getAddress(properties, propertyCount), pfn_notify == null ? 0 : pfn_notify.getPointer(), user_data, MemoryUtil.getAddressSafe(errcode_ret), function_pointer), platform);
		if ( LWJGLUtil.DEBUG )
			Util.checkCLError(errcode_ret.get(0));
		return __result;
	} finally {
		if ( __result != null ) __result.setContextCallback(user_data);
	}
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:32,代码来源:InfoUtilFactory.java

示例2: createFromType

import org.lwjgl.opengl.Drawable; //导入方法依赖的package包/类
public CLContext createFromType(final CLPlatform platform, final long device_type, final CLContextCallback pfn_notify, final Drawable share_drawable, final IntBuffer errcode_ret) throws LWJGLException {
	final int propertyCount = 2 + (share_drawable == null ? 0 : 4) + 1;

	final PointerBuffer properties = APIUtil.getBufferPointer(propertyCount);
	properties.put(CL_CONTEXT_PLATFORM).put(platform);
	if ( share_drawable != null )
		share_drawable.setCLSharingProperties(properties);
	properties.put(0);
	properties.flip();

	return clCreateContextFromType(properties, device_type, pfn_notify, errcode_ret);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:13,代码来源:InfoUtilFactory.java


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