本文整理汇总了Java中org.lwjgl.LWJGLUtil.getLibraryPaths方法的典型用法代码示例。如果您正苦于以下问题:Java LWJGLUtil.getLibraryPaths方法的具体用法?Java LWJGLUtil.getLibraryPaths怎么用?Java LWJGLUtil.getLibraryPaths使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.LWJGLUtil
的用法示例。
在下文中一共展示了LWJGLUtil.getLibraryPaths方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
/**
* @param openDevice Whether to automatically open the device
* @see #create(String, int, int, boolean)
*/
public static void create(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized, boolean openDevice)
throws LWJGLException {
if (created)
throw new IllegalStateException("Only one OpenAL context may be instantiated at any one time.");
String libname;
String[] library_names;
switch (LWJGLUtil.getPlatform()) {
case LWJGLUtil.PLATFORM_WINDOWS:
libname = "OpenAL32";
library_names = new String[]{"OpenAL64.dll", "OpenAL32.dll"};
break;
case LWJGLUtil.PLATFORM_LINUX:
libname = "openal";
library_names = new String[]{"libopenal64.so", "libopenal.so", "libopenal.so.0"};
break;
case LWJGLUtil.PLATFORM_MACOSX:
libname = "openal";
library_names = new String[]{"openal.dylib"};
break;
default:
throw new LWJGLException("Unknown platform: " + LWJGLUtil.getPlatform());
}
String[] oalPaths = LWJGLUtil.getLibraryPaths(libname, library_names, AL.class.getClassLoader());
LWJGLUtil.log("Found " + oalPaths.length + " OpenAL paths");
for ( String oalPath : oalPaths ) {
try {
nCreate(oalPath);
created = true;
init(deviceArguments, contextFrequency, contextRefresh, contextSynchronized, openDevice);
break;
} catch (LWJGLException e) {
LWJGLUtil.log("Failed to load " + oalPath + ": " + e.getMessage());
}
}
if (!created && LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) {
// Try to load OpenAL from the framework instead
nCreateDefault();
created = true;
init(deviceArguments, contextFrequency, contextRefresh, contextSynchronized, openDevice);
}
if (!created)
throw new LWJGLException("Could not locate OpenAL library.");
}
示例2: create
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
public static void create() throws LWJGLException {
if ( created )
return;
//throw new IllegalStateException("OpenCL has already been created.");
final String libname;
final String[] library_names;
switch ( LWJGLUtil.getPlatform() ) {
case LWJGLUtil.PLATFORM_WINDOWS:
libname = "OpenCL";
library_names = new String[] { "OpenCL.dll" };
break;
case LWJGLUtil.PLATFORM_LINUX:
libname = "OpenCL";
library_names = new String[] { "libOpenCL64.so", "libOpenCL.so" }; // TODO: Fix this
break;
case LWJGLUtil.PLATFORM_MACOSX:
libname = "OpenCL";
library_names = new String[] { "OpenCL.dylib" }; // TODO: Fix this
break;
default:
throw new LWJGLException("Unknown platform: " + LWJGLUtil.getPlatform());
}
final String[] oclPaths = LWJGLUtil.getLibraryPaths(libname, library_names, CL.class.getClassLoader());
LWJGLUtil.log("Found " + oclPaths.length + " OpenCL paths");
for ( String oclPath : oclPaths ) {
try {
nCreate(oclPath);
created = true;
break;
} catch (LWJGLException e) {
LWJGLUtil.log("Failed to load " + oclPath + ": " + e.getMessage());
}
}
if ( !created && LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX ) {
// Try to load OpenCL from the framework instead
nCreateDefault();
created = true;
}
if ( !created )
throw new LWJGLException("Could not locate OpenCL library.");
if ( !CLCapabilities.OpenCL10 )
throw new RuntimeException("OpenCL 1.0 not supported.");
}