I’ve noticed that on older video cards I can a achieve a significant increase in frame rate in window mode if I set the desktop from 32 bits to 16 bits, for example. However, I’m wondering if it’s possible to achieve the same “effect” by enumerating through the GraphicsConfiguration array return by GraphicsDevice.getConfigurations() and then selecting the gc that corresponds to the desired bit depth. The idea is to allow the user the select a “performance” or “quality” mode based upon the speed of their hardware.
However, all of the GraphicsConfigurations returned seem to contain no distinguishing information, but if I watch them in the debugger, I can see that each GC is in fact a sun.awt.Win32GraphicsConfig and that each one contains a variable call “pixel_fmt” that seems to contain the desired bit depth information I’m looking for. However, since this class is not exposed, this is obviously the wrong way to obtain the information. Calling gc.getColorModel().getColorSpace() returns 24 for each one.
So anyway, is there a way to get the supported bit depth for a particular GraphicsConfiguration through the abstraction? Or is my understanding of the purpose of the GraphicsConfiguration wrong? Is there a better way to obtain an accelerated image for n bits of color without forcing the user to change their desktop color space than what I’m trying to do? Or is this not even a possibility technically?
Thanks for any help.