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

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

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

GLFW.glfwGetMonitorPhysicalSize介绍

[英]Returns the size, in millimetres, of the display area of the specified monitor.

Some systems do not provide accurate monitor size information, either because the monitor EDID data is incorrect or because the driver does not report it accurately.

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

Note
  • This function must only be called from the main thread.
  • Windows: The OS calculates the returned physical size from the current resolution and system DPI instead of querying the monitor EDID data.
    [中]返回指定监视器显示区域的大小(以毫米为单位)。
    有些系统不提供准确的监视器大小信息,这可能是因为监视器EDID数据不正确,或者是因为驱动程序没有准确地报告它。
    任何或所有大小参数都可能为空。如果发生错误,所有非NULL大小的参数都将设置为零。
    #####注
    *只能从主线程调用此函数。
    *Windows:操作系统根据当前分辨率和系统DPI计算返回的物理大小,而不是查询监视器EDID数据。

代码示例

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

@Override
public float getPpcY() {
  Lwjgl3Monitor monitor = (Lwjgl3Monitor) getMonitor();
  GLFW.glfwGetMonitorPhysicalSize(monitor.monitorHandle, tmpBuffer, tmpBuffer2);
  int sizeY = tmpBuffer2.get(0);
  DisplayMode mode = getDisplayMode();
  return mode.height / (float) sizeY * 10;
}

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

@Override
public float getPpcX() {
  Lwjgl3Monitor monitor = (Lwjgl3Monitor) getMonitor();
  GLFW.glfwGetMonitorPhysicalSize(monitor.monitorHandle, tmpBuffer, tmpBuffer2);
  int sizeX = tmpBuffer.get(0);
  DisplayMode mode = getDisplayMode();
  return mode.width / (float) sizeX * 10;
}

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

@Override
public float getPpcY() {
  Lwjgl3Monitor monitor = (Lwjgl3Monitor) getMonitor();
  GLFW.glfwGetMonitorPhysicalSize(monitor.monitorHandle, tmpBuffer, tmpBuffer2);
  int sizeY = tmpBuffer2.get(0);
  DisplayMode mode = getDisplayMode();
  return mode.height / (float) sizeY * 10;
}

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

@Override
public float getPpcX() {
  Lwjgl3Monitor monitor = (Lwjgl3Monitor) getMonitor();
  GLFW.glfwGetMonitorPhysicalSize(monitor.monitorHandle, tmpBuffer, tmpBuffer2);
  int sizeX = tmpBuffer.get(0);
  DisplayMode mode = getDisplayMode();
  return mode.width / (float) sizeX * 10;
}

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

@Override
public float getPpcX() {
  Lwjgl3Monitor monitor = (Lwjgl3Monitor) getMonitor();
  GLFW.glfwGetMonitorPhysicalSize(monitor.monitorHandle, tmpBuffer, tmpBuffer2);
  int sizeX = tmpBuffer.get(0);
  DisplayMode mode = getDisplayMode();
  return mode.width / (float) sizeX * 10;
}

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

@Override
public float getPpcY() {
  Lwjgl3Monitor monitor = (Lwjgl3Monitor) getMonitor();
  GLFW.glfwGetMonitorPhysicalSize(monitor.monitorHandle, tmpBuffer, tmpBuffer2);
  int sizeY = tmpBuffer2.get(0);
  DisplayMode mode = getDisplayMode();
  return mode.height / (float) sizeY * 10;
}

相关文章

GLFW类方法