What’s a GraphicsConfiguration?

Yesterday I asked on 2d-dev about how the classes GraphicsEnvironment, GraphicsDevice, GraphicsConfiguration and DisplayMode relate to each other, as nobody really seems to have a clear idea how those map to the real world. Dmitri took some time to answer and enlighten me. I think it makes sense to summarize, could be useful for a broader audience:

  • GraphicsEnvironment represents your particular environment, X11, Win32 or whatever. There is only one instance of this ever.
  • Each GE can have one or more GraphicsDevices. Those usually represent a screen. If you have more than one, you’ll most likely have one GD per screen. Printers can also be GDs.
  • Each GD can have one or more GraphicsConfigurations. This represents all the different configurations in which windows can be displayed simultaneously. It does not represent different resolutions/color modes that the graphics card can be switched to. Confusingly, GC are also used to distinguish screens in Xinerama mode, hence the getBounds() method, which otherwise would belong into GD.
  • DisplayMode now represents different configurations that your graphics card can be switched to.

Look up the discussion on the mailing list for more details and some examples.


About Roman Kennke
JVM Hacker, Principal Software Engineer at Red Hat's OpenJDK team, Shenandoah GC project lead, Java Champion

2 Responses to What’s a GraphicsConfiguration?

  1. Clemens Eisserer says:

    Cool, good to know exactly what everything was ment for πŸ™‚

  2. Mario Torre says:

    yeah, and we have to rework some code now πŸ™‚

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: