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


Java LWJGLUtil.isMacOSXEqualsOrBetterThan方法代码示例

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


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

示例1: getNativeCursorCapabilities

import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
public static int getNativeCursorCapabilities() {
	if (LWJGLUtil.getPlatform() != LWJGLUtil.PLATFORM_MACOSX || LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 4)) {
		int cursor_colors = Toolkit.getDefaultToolkit().getMaximumCursorColors();
		boolean supported = cursor_colors >= Short.MAX_VALUE && getMaxCursorSize() > 0;
		int caps = supported ? org.lwjgl.input.Cursor.CURSOR_8_BIT_ALPHA | org.lwjgl.input.Cursor.CURSOR_ONE_BIT_TRANSPARENCY: 0 | org.lwjgl.input.Cursor.CURSOR_ANIMATION;
		return caps;
	} else {
		/* Return no capability in Mac OS X 10.3 and earlier , as there are two unsolved bugs (both reported to apple along with
		   minimal test case):
		   1. When a custom cursor (or some standard) java.awt.Cursor is assigned to a
		   Componennt, it is reset to the default pointer cursor when the window is de-
		   activated and the re-activated. The Cursor can not be reset to the custom cursor,
		   with another setCursor.
		   2. When the cursor is moving in the top pixel row (y = 0 in AWT coordinates) in fullscreen
		   mode, no mouse moved events are reported, even though mouse pressed/released and dragged
		   events are reported
		 */
		return 0;
	}
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:21,代码来源:AWTUtil.java

示例2: MacOSXPeerInfo

import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
MacOSXPeerInfo(PixelFormat pixel_format, ContextAttribs attribs, boolean use_display_bpp, boolean support_window, boolean support_pbuffer, boolean double_buffered) throws LWJGLException {
	super(createHandle());
	
	boolean gl32 = attribs != null && attribs.getMajorVersion() == 3 && attribs.getMinorVersion() == 2 && attribs.isProfileCore();
	if ( gl32 && !LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 7) )
		throw new LWJGLException("OpenGL 3.2 requested, but it requires MacOS X 10.7 or newer");

	choosePixelFormat(pixel_format, gl32, use_display_bpp, support_window, support_pbuffer, double_buffered);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:MacOSXPeerInfo.java

示例3: setCLSharingProperties

import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
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();
	}
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:30,代码来源:ContextGL.java

示例4: createWindow

import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
public void createWindow(final DrawableLWJGL drawable, DisplayMode mode, Canvas parent, int x, int y) throws LWJGLException {
	boolean fullscreen = Display.isFullscreen();
	boolean resizable = Display.isResizable();
	boolean parented = (parent != null) && !fullscreen;
	
	// OS X fullscreen mode API is only available on OS X 10.7+
	boolean enableFullscreenModeAPI = LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 7) && parent == null &&
										!Display.getPrivilegedBoolean("org.lwjgl.opengl.Display.disableOSXFullscreenModeAPI");
	
	// OS X high DPI mode is only available on OS X 10.7+
	enableHighDPI = LWJGLUtil.isMacOSXEqualsOrBetterThan(10, 7) && parent == null &&
										(Display.getPrivilegedBoolean("org.lwjgl.opengl.Display.enableHighDPI") || fullscreen);
	
	if (parented) this.canvas = parent;
	else this.canvas = null;
	
	close_requested = false;
	
	DrawableGL gl_drawable = (DrawableGL)Display.getDrawable();
	PeerInfo peer_info = gl_drawable.peer_info;
	ByteBuffer peer_handle = peer_info.lockAndGetHandle();
	ByteBuffer window_handle = parented ? ((MacOSXCanvasPeerInfo)peer_info).window_handle : window;
	
	try {
		
		window = nCreateWindow(x, y, mode.getWidth(), mode.getHeight(),
				fullscreen, isUndecorated(), resizable,
				parented, enableFullscreenModeAPI, enableHighDPI, peer_handle, window_handle);
           
		if (fullscreen) {
			// when going to fullscreen viewport is set to screen size by Cocoa, ignore this value
			skipViewportValue = true;
			// if starting in fullscreen then set initial viewport to displaymode size
			if (current_viewport.get(2) == 0 && current_viewport.get(3) == 0) {
				current_viewport.put(2, mode.getWidth());
				current_viewport.put(3, mode.getHeight());
			}
		}
		
		native_mode = nIsNativeMode(peer_handle);
		
		if (!native_mode) {
			robot = AWTUtil.createRobot(canvas);
		}
		
	} catch (LWJGLException e) {
		destroyWindow();
		throw e;
	} finally {
		peer_info.unlock();
	}
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:53,代码来源:MacOSXDisplay.java


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