本文整理汇总了Java中org.lwjgl.LWJGLUtil.PLATFORM_LINUX属性的典型用法代码示例。如果您正苦于以下问题:Java LWJGLUtil.PLATFORM_LINUX属性的具体用法?Java LWJGLUtil.PLATFORM_LINUX怎么用?Java LWJGLUtil.PLATFORM_LINUX使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.lwjgl.LWJGLUtil
的用法示例。
在下文中一共展示了LWJGLUtil.PLATFORM_LINUX属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createImplementation
static AWTCanvasImplementation createImplementation() {
switch ( LWJGLUtil.getPlatform() ) {
case LWJGLUtil.PLATFORM_LINUX:
return new LinuxCanvasImplementation();
case LWJGLUtil.PLATFORM_WINDOWS:
return new WindowsCanvasImplementation();
case LWJGLUtil.PLATFORM_MACOSX:
return new MacOSXCanvasImplementation();
default:
throw new IllegalStateException("Unsupported platform");
}
}
示例2: getImplementation
private static ContextAttribsImplementation getImplementation() {
switch ( LWJGLUtil.getPlatform() ) {
case LWJGLUtil.PLATFORM_LINUX:
return new LinuxContextAttribs();
case LWJGLUtil.PLATFORM_WINDOWS:
return new WindowsContextAttribs();
default:
throw new IllegalStateException("Unsupported platform");
}
}
示例3: unloadOpenGLLibrary
/** The OpenGL library reference count is decremented, and if it reaches 0, the library is unloaded. */
public static synchronized void unloadOpenGLLibrary() {
gl_ref_count--;
/*
* Unload the native OpenGL library unless we're on linux, since
* some drivers (NVIDIA proprietary) crash on exit when unloading the library.
*/
if ( gl_ref_count == 0 && LWJGLUtil.getPlatform() != LWJGLUtil.PLATFORM_LINUX )
nUnloadOpenGLLibrary();
}
示例4: createDisplayImplementation
private static DisplayImplementation createDisplayImplementation() {
switch ( LWJGLUtil.getPlatform() ) {
case LWJGLUtil.PLATFORM_LINUX:
return new LinuxDisplay();
case LWJGLUtil.PLATFORM_WINDOWS:
return new WindowsDisplay();
case LWJGLUtil.PLATFORM_MACOSX:
return new MacOSXDisplay();
default:
throw new IllegalStateException("Unsupported platform");
}
}
示例5: createImplementation
private static ContextImplementation createImplementation() {
switch ( LWJGLUtil.getPlatform() ) {
case LWJGLUtil.PLATFORM_LINUX:
return new LinuxContextImplementation();
case LWJGLUtil.PLATFORM_WINDOWS:
return new WindowsContextImplementation();
case LWJGLUtil.PLATFORM_MACOSX:
return new MacOSXContextImplementation();
default:
throw new IllegalStateException("Unsupported platform");
}
}
示例6: setCLSharingProperties
public synchronized void setCLSharingProperties(final PointerBuffer properties) throws LWJGLException {
final ByteBuffer peer_handle = peer_info.lockAndGetHandle();
try {
switch ( LWJGLUtil.getPlatform() ) {
case LWJGLUtil.PLATFORM_WINDOWS:
final WindowsContextImplementation implWindows = (WindowsContextImplementation)implementation;
properties.put(KHRGLSharing.CL_GL_CONTEXT_KHR).put(implWindows.getHGLRC(handle));
properties.put(KHRGLSharing.CL_WGL_HDC_KHR).put(implWindows.getHDC(peer_handle));
break;
case LWJGLUtil.PLATFORM_LINUX:
final LinuxContextImplementation implLinux = (LinuxContextImplementation)implementation;
properties.put(KHRGLSharing.CL_GL_CONTEXT_KHR).put(implLinux.getGLXContext(handle));
properties.put(KHRGLSharing.CL_GLX_DISPLAY_KHR).put(implLinux.getDisplay(peer_handle));
break;
case LWJGLUtil.PLATFORM_MACOSX:
if (LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 6)) { // only supported on OS X 10.6+
// http://oscarbg.blogspot.com/2009/10/about-opencl-opengl-interop.html
final MacOSXContextImplementation implMacOSX = (MacOSXContextImplementation)implementation;
final long CGLShareGroup = implMacOSX.getCGLShareGroup(handle);
properties.put(APPLEGLSharing.CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE).put(CGLShareGroup);
break;
}
default:
throw new UnsupportedOperationException("CL/GL context sharing is not supported on this platform.");
}
} finally {
peer_info.unlock();
}
}
示例7: create
/**
* @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.");
}
示例8: create
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.");
}