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

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

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

GLFW.glfwGetMonitors介绍

[英]Returns an array of handles for all currently connected monitors. The primary monitor is always first in the returned array. If no monitors were found, this function returns NULL.

The returned array is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the monitor configuration changes or the library is terminated.

This function must only be called from the main thread.
[中]返回当前连接的所有监视器的句柄数组。主监视器始终是返回数组中的第一个监视器。如果未找到监视器,此函数将返回NULL。
返回的数组由GLFW分配和释放。你不应该自己把它放出来。只有在监视器配置更改或库终止之前,它才保证有效。
只能从主线程调用此函数。

代码示例

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

@Override
public Monitor[] getMonitors() {
  PointerBuffer glfwMonitors = GLFW.glfwGetMonitors();
  Monitor[] monitors = new Monitor[glfwMonitors.limit()];
  for (int i = 0; i < glfwMonitors.limit(); i++) {
    monitors[i] = Lwjgl3ApplicationConfiguration.toLwjgl3Monitor(glfwMonitors.get(i));
  }
  return monitors;
}

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

@Override
public Monitor[] getMonitors() {
  PointerBuffer glfwMonitors = GLFW.glfwGetMonitors();
  Monitor[] monitors = new Monitor[glfwMonitors.limit()];
  for (int i = 0; i < glfwMonitors.limit(); i++) {
    monitors[i] = Lwjgl3ApplicationConfiguration.toLwjgl3Monitor(glfwMonitors.get(i));
  }
  return monitors;
}

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

/**
 * @return the connected {@link Monitor}s
 */
public static Monitor[] getMonitors() {
  Lwjgl3Application.initializeGlfw();
  PointerBuffer glfwMonitors = GLFW.glfwGetMonitors();
  Monitor[] monitors = new Monitor[glfwMonitors.limit()];
  for (int i = 0; i < glfwMonitors.limit(); i++) {
    monitors[i] = toLwjgl3Monitor(glfwMonitors.get(i));
  }
  return monitors;
}

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

/**
 * @return the connected {@link Monitor}s
 */
public static Monitor[] getMonitors() {
  Lwjgl3Application.initializeGlfw();
  PointerBuffer glfwMonitors = GLFW.glfwGetMonitors();
  Monitor[] monitors = new Monitor[glfwMonitors.limit()];
  for (int i = 0; i < glfwMonitors.limit(); i++) {
    monitors[i] = toLwjgl3Monitor(glfwMonitors.get(i));
  }
  return monitors;
}

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

/**
 * This function returns a list of Monitor objects for all currently connected monitors. This list is unmodifiable.
 *
 * @return The list of all connected Monitor objects.
 */
public static List<Monitor> getMonitors()
{
  if (monitors == null)
  {
    monitors = new ArrayList<>();
    PointerBuffer buffer = glfwGetMonitors();
    while (buffer.hasRemaining())
      monitors.add(new Monitor(buffer.get()));
    monitors = Collections.unmodifiableList(monitors);
  }
  return monitors;
}

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

@Override
public Monitor[] getMonitors() {
  PointerBuffer glfwMonitors = GLFW.glfwGetMonitors();
  Monitor[] monitors = new Monitor[glfwMonitors.limit()];
  for (int i = 0; i < glfwMonitors.limit(); i++) {
    monitors[i] = Lwjgl3ApplicationConfiguration.toLwjgl3Monitor(glfwMonitors.get(i));
  }
  return monitors;
}

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

/**
 * @return the connected {@link Monitor}s
 */
public static Monitor[] getMonitors() {
  Lwjgl3Application.initializeGlfw();
  PointerBuffer glfwMonitors = GLFW.glfwGetMonitors();
  Monitor[] monitors = new Monitor[glfwMonitors.limit()];
  for (int i = 0; i < glfwMonitors.limit(); i++) {
    monitors[i] = toLwjgl3Monitor(glfwMonitors.get(i));
  }
  return monitors;
}

相关文章

GLFW类方法