• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java EGL类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.lwjgl.opengles.EGL的典型用法代码示例。如果您正苦于以下问题:Java EGL类的具体用法?Java EGL怎么用?Java EGL使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



EGL类属于org.lwjgl.opengles包,在下文中一共展示了EGL类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createWindow

import org.lwjgl.opengles.EGL; //导入依赖的package包/类
public void createWindow(final DrawableLWJGL drawable, DisplayMode mode, Canvas parent, int x, int y) throws LWJGLException {
	lockAWT();
	try {
		incDisplay();
		try {
			if ( drawable instanceof DrawableGLES )
				peer_info = new LinuxDisplayPeerInfo();

			ByteBuffer handle = peer_info.lockAndGetHandle();
			try {
				current_window_mode = getWindowMode(Display.isFullscreen());
				// Try to enable Lecagy FullScreen Support in Compiz, else
				// we may have trouble with stuff overlapping our fullscreen window.
				if ( current_window_mode != WINDOWED )
					Compiz.setLegacyFullscreenSupport(true);
				// Setting _MOTIF_WM_HINTS in fullscreen mode is problematic for certain window
				// managers. We do not set MWM_HINTS_DECORATIONS in fullscreen mode anymore,
				// unless org.lwjgl.opengl.Window.undecorated_fs has been specified.
				// See native/linux/org_lwjgl_opengl_Display.c, createWindow function.
				boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated") || (current_window_mode != WINDOWED && Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated_fs"));
				this.parent = parent;
				parent_window = parent != null ? getHandle(parent) : getRootWindow(getDisplay(), getDefaultScreen());
				resizable = Display.isResizable();
				resized = false;
				window_x = x;
				window_y = y;
				window_width = mode.getWidth();
				window_height = mode.getHeight();
				current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y, undecorated, parent_window, resizable);
				mapRaised(getDisplay(), current_window);
				xembedded = parent != null && isAncestorXEmbedded(parent_window);
				blank_cursor = createBlankCursor();
				current_cursor = None;
				focused = false;
				input_released = false;
				pointer_grabbed = false;
				keyboard_grabbed = false;
				close_requested = false;
				grab = false;
				minimized = false;
				dirty = true;

				if ( drawable instanceof DrawableGLES )
					((DrawableGLES)drawable).initialize(current_window, getDisplay(), EGL.EGL_WINDOW_BIT, (org.lwjgl.opengles.PixelFormat)drawable.getPixelFormat());

				if (parent != null) {
					parent.addFocusListener(focus_listener);
					parent_focused = parent.isFocusOwner();
					parent_focus_changed = true;
				}
			} finally {
				peer_info.unlock();
			}
		} catch (LWJGLException e) {
			decDisplay();
			throw e;
		}
	} finally {
		unlockAWT();
	}
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:62,代码来源:LinuxDisplay.java


示例2: createWindow

import org.lwjgl.opengles.EGL; //导入依赖的package包/类
public void createWindow(DrawableLWJGL drawable, DisplayMode mode, Canvas parent, int x, int y) throws LWJGLException {
	close_requested = false;
	is_dirty = false;
	isMinimized = false;
	isFocused = false;
	redoMakeContextCurrent = false;
	maximized = false;
	this.parent = parent;
	hasParent = parent != null;
	long parent_hwnd = parent != null ? getHwnd(parent) : 0;
	this.hwnd = nCreateWindow(x, y, mode.getWidth(), mode.getHeight(), Display.isFullscreen() || isUndecorated(), parent != null, parent_hwnd);
	this.resizable=false;
	if (hwnd == 0) {
		throw new LWJGLException("Failed to create window");
	}
	this.hdc = getDC(hwnd);
	if (hdc == 0) {
		nDestroyWindow(hwnd);
		throw new LWJGLException("Failed to get dc");
	}

	try {
		if ( drawable instanceof DrawableGL ) {
			int format = WindowsPeerInfo.choosePixelFormat(getHdc(), 0, 0, (PixelFormat)drawable.getPixelFormat(), null, true, true, false, true);
			WindowsPeerInfo.setPixelFormat(getHdc(), format);
		} else {
			peer_info = new WindowsDisplayPeerInfo(true);
			((DrawableGLES)drawable).initialize(hwnd, hdc, EGL.EGL_WINDOW_BIT, (org.lwjgl.opengles.PixelFormat)drawable.getPixelFormat());
		}
		peer_info.initDC(getHwnd(), getHdc());
		showWindow(getHwnd(), SW_SHOWDEFAULT);

		updateWidthAndHeight();

		if ( parent == null ) {
			if(Display.isResizable()) {
				setResizable(true);
			}
			setForegroundWindow(getHwnd());
		}
		grabFocus();
	} catch (LWJGLException e) {
		nReleaseDC(hwnd, hdc);
		nDestroyWindow(hwnd);
		throw e;
	}
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:48,代码来源:WindowsDisplay.java


示例3: createWindow

import org.lwjgl.opengles.EGL; //导入依赖的package包/类
public void createWindow(final DrawableLWJGL drawable, DisplayMode mode, Canvas parent, int x, int y) throws LWJGLException {
	lockAWT();
	try {
		incDisplay();
		try {
			if ( drawable instanceof DrawableGLES )
				peer_info = new LinuxDisplayPeerInfo();

			ByteBuffer handle = peer_info.lockAndGetHandle();
			try {
				current_window_mode = getWindowMode(Display.isFullscreen());
				
				// Try to enable Lecagy FullScreen Support in Compiz, else
				// we may have trouble with stuff overlapping our fullscreen window.
				if ( current_window_mode != WINDOWED )
					Compiz.setLegacyFullscreenSupport(true);
				
				// Setting _MOTIF_WM_HINTS in fullscreen mode is problematic for certain window
				// managers. We do not set MWM_HINTS_DECORATIONS in fullscreen mode anymore,
				// unless org.lwjgl.opengl.Window.undecorated_fs has been specified.
				// See native/linux/org_lwjgl_opengl_Display.c, createWindow function.
				boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated") || (current_window_mode != WINDOWED && Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated_fs"));
				
				this.parent = parent;
				parent_window = parent != null ? getHandle(parent) : getRootWindow(getDisplay(), getDefaultScreen());
				resizable = Display.isResizable();
				resized = false;
				window_x = x;
				window_y = y;
				window_width = mode.getWidth();
				window_height = mode.getHeight();
				
				current_window = nCreateWindow(getDisplay(), getDefaultScreen(), handle, mode, current_window_mode, x, y, undecorated, parent_window, resizable);
				
				// Set the WM_CLASS hint which is needed by some WM's e.g. Gnome Shell
				wm_class = Display.getPrivilegedString("LWJGL_WM_CLASS");
				if (wm_class == null) wm_class = Display.getTitle();
				setClassHint(Display.getTitle(), wm_class);
				
				mapRaised(getDisplay(), current_window);
				xembedded = parent != null && isAncestorXEmbedded(parent_window);
				blank_cursor = createBlankCursor();
				current_cursor = None;
				focused = false;
				input_released = false;
				pointer_grabbed = false;
				keyboard_grabbed = false;
				close_requested = false;
				grab = false;
				minimized = false;
				dirty = true;

				if ( drawable instanceof DrawableGLES )
					((DrawableGLES)drawable).initialize(current_window, getDisplay(), EGL.EGL_WINDOW_BIT, (org.lwjgl.opengles.PixelFormat)drawable.getPixelFormat());

				if (parent != null) {
					parent.addFocusListener(focus_listener);
					parent_focused = parent.isFocusOwner();
					parent_focus_changed = true;
				}
			} finally {
				peer_info.unlock();
			}
		} catch (LWJGLException e) {
			decDisplay();
			throw e;
		}
	} finally {
		unlockAWT();
	}
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:72,代码来源:LinuxDisplay.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ConstantTransformer类代码示例发布时间:2022-05-22
下一篇:
Java InfobrightLoaderMeta类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap