Search in sources :

Example 1 with Lwjgl3Monitor

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);
}
Also used : IntBuffer(java.nio.IntBuffer) Lwjgl3Monitor(com.badlogic.gdx.backends.lwjgl3.Lwjgl3Graphics.Lwjgl3Monitor)

Example 2 with Lwjgl3Monitor

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;
}
Also used : Buffer(org.lwjgl.glfw.GLFWVidMode.Buffer) PointerBuffer(org.lwjgl.PointerBuffer) IntBuffer(java.nio.IntBuffer) DisplayMode(com.badlogic.gdx.Graphics.DisplayMode) Lwjgl3Monitor(com.badlogic.gdx.backends.lwjgl3.Lwjgl3Graphics.Lwjgl3Monitor) GLFWVidMode(org.lwjgl.glfw.GLFWVidMode)

Aggregations

Lwjgl3Monitor (com.badlogic.gdx.backends.lwjgl3.Lwjgl3Graphics.Lwjgl3Monitor)2 IntBuffer (java.nio.IntBuffer)2 DisplayMode (com.badlogic.gdx.Graphics.DisplayMode)1 PointerBuffer (org.lwjgl.PointerBuffer)1 GLFWVidMode (org.lwjgl.glfw.GLFWVidMode)1 Buffer (org.lwjgl.glfw.GLFWVidMode.Buffer)1