LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: CodeBunny on August 02, 2011, 21:57:54

Title: Detect available fullscreen resolutions without needing access to LWJGL
Post by: CodeBunny on August 02, 2011, 21:57:54
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?
Title: Re: Detect available fullscreen resolutions without needing access to LWJGL
Post by: jediTofu on August 03, 2011, 05:09:31
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
Title: Re: Detect available fullscreen resolutions without needing access to LWJGL
Post by: princec on August 03, 2011, 11:54:20
Loading LWJGL is really no big deal at all. Just do it.

Cas :)
Title: Re: Detect available fullscreen resolutions without needing access to LWJGL
Post by: CodeBunny on August 03, 2011, 15:14:59
Okay, fine.  ::)
Title: Re: Detect available fullscreen resolutions without needing access to LWJGL
Post by: jediTofu on August 04, 2011, 02:28:03
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.