當前位置: 首頁>>代碼示例>>Java>>正文


Java GLFW.glfwGetFramebufferSize方法代碼示例

本文整理匯總了Java中org.lwjgl.glfw.GLFW.glfwGetFramebufferSize方法的典型用法代碼示例。如果您正苦於以下問題:Java GLFW.glfwGetFramebufferSize方法的具體用法?Java GLFW.glfwGetFramebufferSize怎麽用?Java GLFW.glfwGetFramebufferSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.lwjgl.glfw.GLFW的用法示例。


在下文中一共展示了GLFW.glfwGetFramebufferSize方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateViewPort

import org.lwjgl.glfw.GLFW; //導入方法依賴的package包/類
private void updateViewPort(ViewPort viewport)
{
	if (viewport == this.defaultViewPort)
	{
		//FIXME: This is a fix (hack?) for Mac's weird hack to scale windows for compatibility
		try (MemoryStack stack = MemoryStack.stackPush())
		{
			IntBuffer pWidth = stack.mallocInt(1);
			IntBuffer pHeight = stack.mallocInt(1);

			GLFW.glfwGetFramebufferSize(this.window.handle(), pWidth, pHeight);
			GL11.glViewport(0, 0, pWidth.get(0), pHeight.get(0));
		}
	}
	else
	{
		GL11.glViewport(viewport.getX(), viewport.getY(),
				viewport.getWidth(), viewport.getHeight());
	}
}
 
開發者ID:andykuo1,項目名稱:candlelight,代碼行數:21,代碼來源:View.java

示例2: generate

import org.lwjgl.glfw.GLFW; //導入方法依賴的package包/類
public static Window generate(WindowHandle handle) {
	long windowID = GLFW.glfwCreateWindow(handle.width, handle.height, handle.title, NULL, NULL);
	if (windowID == NULL)
		throw new GLFWException("Failed to create GLFW Window '" + handle.title + "'");
	Window window = new Window(windowID, handle.width, handle.height);
	GLFW.glfwSetWindowPos(windowID, Variables.X, Variables.Y);
	int[] h = new int[1];
	int[] w = new int[1];

	GLFW.glfwGetFramebufferSize(windowID, w, h);
	window.framebufferHeight = h[0];
	window.framebufferWidth = w[0];
	GLFW.glfwGetWindowSize(windowID, w, h);
	window.height = h[0];
	window.width = w[0];
	window.pixelRatio = (float) window.framebufferWidth / (float) window.width;
	return window;
}
 
開發者ID:Guerra24,項目名稱:NanoUI,代碼行數:19,代碼來源:WindowManager.java


注:本文中的org.lwjgl.glfw.GLFW.glfwGetFramebufferSize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。