org.lwjgl.glfw.GLFW.nglfwGetWindowSize()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(176)

本文整理了Java中org.lwjgl.glfw.GLFW.nglfwGetWindowSize()方法的一些代码示例,展示了GLFW.nglfwGetWindowSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GLFW.nglfwGetWindowSize()方法的具体详情如下:
包路径:org.lwjgl.glfw.GLFW
类名称:GLFW
方法名:nglfwGetWindowSize

GLFW.nglfwGetWindowSize介绍

[英]Unsafe version of: #glfwGetWindowSize
[中]不安全版本:#GLFWGetWindowsSize

代码示例

代码示例来源:origin: sriharshachilakapati/SilenceEngine

/**
 * This method retrieves the size, in screen coordinates, of the client area of this window. If you wish to retrieve
 * the size of the framebuffer of the window in pixels, see {@link Window#getFramebufferSize()}.
 *
 * @return The size of the client area of this window, in screen coordinates, as a Vector2.
 */
public Vector2 getSize()
{
  IntBuffer size = BufferUtils.createIntBuffer(2);
  nglfwGetWindowSize(handle, memAddress(size), memAddress(size) + Integer.BYTES);
  return this.size.set(size.get(0), size.get(1));
}

代码示例来源:origin: org.lwjgl.osgi/org.lwjgl.glfw

/**
 * Retrieves the size, in screen coordinates, of the client area of the specified window. If you wish to retrieve the size of the framebuffer of the
 * window in pixels, see {@link #glfwGetFramebufferSize GetFramebufferSize}.
 * 
 * <p>Any or all of the size arguments may be {@code NULL}. If an error occurs, all non-{@code NULL} size arguments will be set to zero.</p>
 * 
 * <p>This function must only be called from the main thread.</p>
 *
 * @param window the window whose size to retrieve
 * @param width  where to store the width, in screen coordinates, of the client area, or {@code NULL}
 * @param height where to store the height, in screen coordinates, of the client area, or {@code NULL}
 *
 * @since version 1.0
 */
public static void glfwGetWindowSize(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") IntBuffer width, @Nullable @NativeType("int *") IntBuffer height) {
  if (CHECKS) {
    checkSafe(width, 1);
    checkSafe(height, 1);
  }
  nglfwGetWindowSize(window, memAddressSafe(width), memAddressSafe(height));
}

相关文章

GLFW类方法