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


Java GLFW.glfwInit方法代码示例

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


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

示例1: initialize

import org.lwjgl.glfw.GLFW; //导入方法依赖的package包/类
@Override
public boolean initialize()
{
	System.out.println("OS " + System.getProperty("os.name"));
	System.out.println("JAVA " + System.getProperty("java.version"));
	System.out.println("LWJGL " + Version.getVersion());
	System.out.println("GLFW " + GLFW.glfwGetVersionString());
	System.out.println("JOML 1.9.2");

	// Setup an error callback. The default implementation
	// will print the error message in System.err.
	GLFWErrorCallback.createPrint(System.err).set();

	// Initialize GLFW. Most GLFW functions will not work before doing this.
	if (!GLFW.glfwInit())
	{
		throw new IllegalStateException("Unable to initialize GLFW");
	}

	return true;
}
 
开发者ID:andykuo1,项目名称:candlelight,代码行数:22,代码来源:GLEngine.java

示例2: initGLFW

import org.lwjgl.glfw.GLFW; //导入方法依赖的package包/类
/**
    * Initialize GLFW. Stops application if error occurs
    */
   private void initGLFW() throws IllegalStateException {
// If there is an error in initialization
if(GLFW.glfwInit() == 0) {
    throw new IllegalStateException("GLFW failed to initialize");
}
   }
 
开发者ID:camilne,项目名称:open-world,代码行数:10,代码来源:Application.java

示例3: initializeGLFW

import org.lwjgl.glfw.GLFW; //导入方法依赖的package包/类
public static void initializeGLFW()
{
	if (initGLFW)
	{
		return;
	}
	else
	{
		initGLFW = true;
	}

	System.out.println("OS " + System.getProperty("os.name"));
	System.out.println("JAVA " + System.getProperty("java.version"));
	System.out.println("LWJGL " + Version.getVersion());
	System.out.println("GLFW " + GLFW.glfwGetVersionString());
	System.out.println("JOML 1.9.2");

	// Setup an error callback. The default implementation
	// will print the error message in System.err.
	GLFWErrorCallback.createPrint(System.err).set();

	// Initialize GLFW. Most GLFW functions will not work before doing this.
	if (!GLFW.glfwInit())
	{
		throw new IllegalStateException("Unable to initialize GLFW");
	}
}
 
开发者ID:andykuo1,项目名称:candlelight,代码行数:28,代码来源:Window.java

示例4: createWindow

import org.lwjgl.glfw.GLFW; //导入方法依赖的package包/类
public static Window createWindow(Scene scene, String title) {
	if (!GLFW.glfwInit()) {
		throw new IllegalStateException();
	}
	
	errorCallback = new GLFWErrorCallback() {
		public void invoke(int error, long description) {
			System.err.println("["+ error + "] " + description);
		}
	};
	GLFW.glfwSetErrorCallback(errorCallback);

	long window = GLFW.glfwCreateWindow(scene.getWidth(), scene.getHeight(), title, MemoryUtil.NULL, MemoryUtil.NULL);

	if (window == MemoryUtil.NULL) {
		System.err.println("Window returned NULL");
		System.exit(-1);
	}

	GLFW.glfwMakeContextCurrent(window);

	GLFW.glfwShowWindow(window);
	GL.createCapabilities();
	GLFW.glfwSwapInterval(1);

	scene.setGLinitilized();
	return new Window(window);
}
 
开发者ID:ComunityEngine,项目名称:CommunityEngine-Java,代码行数:29,代码来源:Window.java


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