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

x33g5p2x  于2022-01-19 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(154)

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

GLFW.glfwGetFramebufferSize介绍

[英]Retrieves the size, in pixels, of the framebuffer of the specified window. If you wish to retrieve the size of the window in screen coordinates, see #glfwGetWindowSize.

Any or all of the size arguments may be NULL. If an error occurs, all non- NULL size arguments will be set to zero.

This function must only be called from the main thread.
[中]检索指定窗口的帧缓冲区的大小(以像素为单位)。如果要检索屏幕坐标中的窗口大小,请参阅#GLFWGetWindowsSize。
任何或所有大小参数都可能为空。如果发生错误,所有非NULL大小的参数都将设置为零。
只能从主线程调用此函数。

代码示例

代码示例来源:origin: libgdx/libgdx

private void updateFramebufferInfo() {
  GLFW.glfwGetFramebufferSize(window.getWindowHandle(), tmpBuffer, tmpBuffer2);
  this.backBufferWidth = tmpBuffer.get(0);
  this.backBufferHeight = tmpBuffer2.get(0);
  GLFW.glfwGetWindowSize(window.getWindowHandle(), tmpBuffer, tmpBuffer2);
  Lwjgl3Graphics.this.logicalWidth = tmpBuffer.get(0);
  Lwjgl3Graphics.this.logicalHeight = tmpBuffer2.get(0);
  Lwjgl3ApplicationConfiguration config = window.getConfig();
  bufferFormat = new BufferFormat(config.r, config.g, config.b, config.a, config.depth, config.stencil,
      config.samples, false);
}

代码示例来源:origin: libgdx/libgdx

private void updateFramebufferInfo() {
  GLFW.glfwGetFramebufferSize(window.getWindowHandle(), tmpBuffer, tmpBuffer2);
  this.backBufferWidth = tmpBuffer.get(0);
  this.backBufferHeight = tmpBuffer2.get(0);
  GLFW.glfwGetWindowSize(window.getWindowHandle(), tmpBuffer, tmpBuffer2);
  Lwjgl3Graphics.this.logicalWidth = tmpBuffer.get(0);
  Lwjgl3Graphics.this.logicalHeight = tmpBuffer2.get(0);
  Lwjgl3ApplicationConfiguration config = window.getConfig();
  bufferFormat = new BufferFormat(config.r, config.g, config.b, config.a, config.depth, config.stencil,
      config.samples, false);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl3

private void updateFramebufferInfo() {
  GLFW.glfwGetFramebufferSize(window.getWindowHandle(), tmpBuffer, tmpBuffer2);
  this.backBufferWidth = tmpBuffer.get(0);
  this.backBufferHeight = tmpBuffer2.get(0);
  GLFW.glfwGetWindowSize(window.getWindowHandle(), tmpBuffer, tmpBuffer2);
  Lwjgl3Graphics.this.logicalWidth = tmpBuffer.get(0);
  Lwjgl3Graphics.this.logicalHeight = tmpBuffer2.get(0);
  Lwjgl3ApplicationConfiguration config = window.getConfig();
  bufferFormat = new BufferFormat(config.r, config.g, config.b, config.a, config.depth, config.stencil,
      config.samples, false);
}

代码示例来源:origin: Renanse/Ardor3D

private void updateContentSize() {
  try (MemoryStack stack = MemoryStack.stackPush()) {
    final IntBuffer width = stack.mallocInt(1);
    final IntBuffer height = stack.mallocInt(1);
    GLFW.glfwGetFramebufferSize(_windowId, width, height);
    _contentWidth = width.get();
    _contentHeight = height.get();
  }
  for (final ICanvasListener l : _listeners) {
    l.onResize(_contentWidth, _contentHeight);
  }
}

代码示例来源:origin: SpinyOwl/legui

/**
 * Update glfw window.
 */
public void updateGlfwWindow() {
  int[] windowWidth = {0},
    windowHeight = {0};
  int[] frameBufferWidth = {0},
    frameBufferHeight = {0};
  int[] xpos = {0},
    ypos = {0};
  glfwGetWindowSize(glfwWindow, windowWidth, windowHeight);
  glfwGetFramebufferSize(glfwWindow, frameBufferWidth, frameBufferHeight);
  glfwGetWindowPos(glfwWindow, xpos, ypos);
  update(windowWidth[0], windowHeight[0],
      frameBufferWidth[0], frameBufferHeight[0],
      xpos[0], ypos[0],
      glfwGetWindowAttrib(glfwWindow, GLFW_ICONIFIED) == GLFW_TRUE
     );
}

相关文章

GLFW类方法