本文整理汇总了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);
}
}
示例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);
}