当前位置: 首页>>代码示例>>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;未经允许,请勿转载。