當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。