Detect available fullscreen resolutions without needing access to LWJGL

Started by CodeBunny, August 02, 2011, 21:57:54

Previous topic - Next topic

CodeBunny

Basically, what it says in the title. I'm in the process of building a "configuration editor" for a game; it's a Swing application that allows the user to change the game's configuration settings without needing to start up the entire game.

One of the settings I'm letting the user modify is the Display resolution for the game to run at. However, I'm not quite sure how to detect the available resolutions without using LWJGL calls (which require me to initialize the libraries, which seems a bit unnecessary for a single call).

So: How does LWJGL figure out what resolutions will work? Can I do the same with just native Java?

jediTofu

Probably something like GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayModes().  There might be a better way, not sure.

Also has some multi-screen information:
http://download.oracle.com/javase/6/docs/api/java/awt/GraphicsDevice.html
cool story, bro

princec


CodeBunny


jediTofu

Quote from: princec on August 03, 2011, 11:54:20
Loading LWJGL is really no big deal at all. Just do it.

Cas :)

Right, and you'll find out if LWJGL even works for them very quickly.
cool story, bro