use of com.badlogic.gdx.backends.lwjgl3.Lwjgl3Graphics.Lwjgl3Monitor in project libgdx by libgdx.
the class Lwjgl3ApplicationConfiguration method toLwjgl3Monitor.
static Lwjgl3Monitor toLwjgl3Monitor(long glfwMonitor) {
IntBuffer tmp = BufferUtils.createIntBuffer(1);
IntBuffer tmp2 = BufferUtils.createIntBuffer(1);
GLFW.glfwGetMonitorPos(glfwMonitor, tmp, tmp2);
int virtualX = tmp.get(0);
int virtualY = tmp2.get(0);
String name = GLFW.glfwGetMonitorName(glfwMonitor);
return new Lwjgl3Monitor(glfwMonitor, virtualX, virtualY, name);
}
use of com.badlogic.gdx.backends.lwjgl3.Lwjgl3Graphics.Lwjgl3Monitor in project libgdx by libgdx.
the class Lwjgl3ApplicationConfiguration method getDisplayModes.
/**
* @return the available {@link DisplayMode}s of the given {@link Monitor}
*/
public static DisplayMode[] getDisplayModes(Monitor monitor) {
Lwjgl3Application.initializeGlfw();
Buffer videoModes = GLFW.glfwGetVideoModes(((Lwjgl3Monitor) monitor).monitorHandle);
DisplayMode[] result = new DisplayMode[videoModes.limit()];
for (int i = 0; i < result.length; i++) {
GLFWVidMode videoMode = videoModes.get(i);
result[i] = new Lwjgl3Graphics.Lwjgl3DisplayMode(((Lwjgl3Monitor) monitor).monitorHandle, videoMode.width(), videoMode.height(), videoMode.refreshRate(), videoMode.redBits() + videoMode.greenBits() + videoMode.blueBits());
}
return result;
}
Aggregations