External Publication
Visit Post

jME 3.10.0-beta1

jMonkeyEngine Hub May 31, 2026
Source

jme application has these two methods:

    /**
     * This call will return a list of Monitors that glfwGetMonitors()
     * returns and information about the monitor, like width, height,
     * and refresh rate.
     *
     * @return returns a list of monitors and their information.
     */
    public Displays getDisplays() {
        return context.getDisplays();
    }

    /**
     * Use this to get the positional number of the primary
     * monitor from the glfwGetMonitors() function call.
     *
     * @return the position of the value in the arraylist of
     *         the primary monitor.
     */
    public int getPrimaryDisplay() {
        return context.getPrimaryDisplay();
    }

that i have (hopefully correctly) implemented in SDL3. These are useful if you want in-game settings where you can change the resolution and then the app is restarted (you can use jme’s restart() for this).

Doing it without the app being first initialized doesn’t make a lot of sense in SDL3, because (afaik) it needs a living SDL3 context anyway. But SDL3 is less sensitive than our previous GLFW implementation, regarding fullscreen resolutions, if you ask it for a wrong one it should select the closest one automatically. So in theory there shouldn’t be a state where the app just crashes because of the resolution.

Discussion in the ATmosphere

Loading comments...