本文整理汇总了Java中org.lwjgl.LWJGLUtil.toHexString方法的典型用法代码示例。如果您正苦于以下问题:Java LWJGLUtil.toHexString方法的具体用法?Java LWJGLUtil.toHexString怎么用?Java LWJGLUtil.toHexString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.LWJGLUtil
的用法示例。
在下文中一共展示了LWJGLUtil.toHexString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getChannelCount
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
/**
* Returns the number of channels in the specified cl_channel_order.
*
* @param channelOrder the cl_channel_order
*
* @return the number of channels
*/
private static int getChannelCount(final int channelOrder) {
switch ( channelOrder ) {
case CL_R:
case CL_A:
case CL_INTENSITY:
case CL_LUMINANCE:
case CL_Rx:
return 1;
case CL_RG:
case CL_RA:
case CL_RGx:
return 2;
case CL_RGB:
case CL_RGBx:
return 3;
case CL_RGBA:
case CL_BGRA:
case CL_ARGB:
return 4;
default:
throw new IllegalArgumentException("Invalid cl_channel_order specified: " + LWJGLUtil.toHexString(channelOrder));
}
}
示例2: getChannelSize
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
/**
* Returns the number of bytes in the specified cl_channel_type.
*
* @param channelType the cl_channel_type
*
* @return the number of bytes
*/
private static int getChannelSize(final int channelType) {
switch ( channelType ) {
case CL_SNORM_INT8:
case CL_UNORM_INT8:
case CL_SIGNED_INT8:
case CL_UNSIGNED_INT8:
return 1;
case CL_SNORM_INT16:
case CL_UNORM_INT16:
case CL_UNORM_SHORT_565:
case CL_UNORM_SHORT_555:
case CL_SIGNED_INT16:
case CL_UNSIGNED_INT16:
case CL_HALF_FLOAT:
return 2;
case CL_UNORM_INT_101010:
case CL_SIGNED_INT32:
case CL_UNSIGNED_INT32:
case CL_FLOAT:
return 4;
default:
throw new IllegalArgumentException("Invalid cl_channel_type specified: " + LWJGLUtil.toHexString(channelType));
}
}
示例3: getSizeRet
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
protected final int getSizeRet(final T object, final int param_name) {
final PointerBuffer bytes = APIUtil.getBufferPointer();
final int errcode = getInfo(object, param_name, null, bytes);
if ( errcode != CL_SUCCESS )
throw new IllegalArgumentException("Invalid parameter specified: " + LWJGLUtil.toHexString(param_name));
return (int)bytes.get(0);
}
示例4: throwCLError
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
private static void throwCLError(final int errcode) {
String errname = CL_ERROR_TOKENS.get(errcode);
if ( errname == null )
errname = "UNKNOWN";
throw new OpenCLException("Error Code: " + errname + " (" + LWJGLUtil.toHexString(errcode) + ")");
}