Ok, It's been a couple of weeks, and I finally got a chance to wrap up some stuff I am working on. I have come to an area where I need some info from you all. Here's a sample of what I am doing, and I'll post all of the classes and such here after I finish up documentation and I figure out valid values for some settings.
So, for example, the DepthStepper class allows statically coded values of 16, 24, and 32.
The SamplesStepper class allows all even values from 0 to 32
WidthStepper and HeightStepper classes allow what ever Display.getAvailableDisplayModes(); returns (the resolutionStepper class uses exact resolutions and really renders width and height useless)
FrequencyStepper pulls from returned modes as well (may need another class to join resolutions and frequencies)
But I have no idea where to get values for AlphaBits, StencilBits, and DepthBits. Any advice here?
All of the above classes are extensions of a Stepper class that I've developed which is a class that allows counting through objects arbitrarily. (This will probably confuse everyone because it is hard for me to describe it, but you could create a class chain to count in a base 10 method, or base 16, then base 2 for the second digit and letters only for the 3rd digit, etc… any arbitrary method you can think of). The stepper class is inspired by the Decorator Pattern.
Here's some teaser code intentionally using an invalid limit value for samples so we can see it step all the way through the options. The setNextStepper call builds the chain and the order of stepping.
/** Create display using closest desired settings */
Stepper propDepth = new DepthStepper();
propDepth.setStartValue( 32 );
propDepth.setLimitStepValue( 16 );
Stepper propSamples = new SamplesStepper();
propSamples.setStartValue( 22 );
propSamples.setLimitStepValue( 18 );
propDepth.setNextStepper( propSamples );
Stepper propResolution = new ResolutionStepper();
propResolution.setStartValue( "1024x768" );
propResolution.setLimitStepValue( "640x480" );
propSamples.setNextStepper( propResolution );
display.createWindow( propDepth );
And here's the output (shortened up the text length a bit for readability):
INFO: Trying: DepthStepper = 32; SamplesStepper = 22; ResolutionStepper = 1024x768;
INFO: Trying: DepthStepper = 24; SamplesStepper = 22; ResolutionStepper = 1024x768;
INFO: Trying: DepthStepper = 16; SamplesStepper = 22; ResolutionStepper = 1024x768;
INFO: Trying: DepthStepper = 32; SamplesStepper = 20; ResolutionStepper = 1024x768;
INFO: Trying: DepthStepper = 24; SamplesStepper = 20; ResolutionStepper = 1024x768;
INFO: Trying: DepthStepper = 16; SamplesStepper = 20; ResolutionStepper = 1024x768;
INFO: Trying: DepthStepper = 32; SamplesStepper = 18; ResolutionStepper = 1024x768;
INFO: Trying: DepthStepper = 24; SamplesStepper = 18; ResolutionStepper = 1024x768;
INFO: Trying: DepthStepper = 16; SamplesStepper = 18; ResolutionStepper = 1024x768;
INFO: Trying: DepthStepper = 32; SamplesStepper = 22; ResolutionStepper = 800x600;
INFO: Trying: DepthStepper = 24; SamplesStepper = 22; ResolutionStepper = 800x600;
INFO: Trying: DepthStepper = 16; SamplesStepper = 22; ResolutionStepper = 800x600;
INFO: Trying: DepthStepper = 32; SamplesStepper = 20; ResolutionStepper = 800x600;
INFO: Trying: DepthStepper = 24; SamplesStepper = 20; ResolutionStepper = 800x600;
INFO: Trying: DepthStepper = 16; SamplesStepper = 20; ResolutionStepper = 800x600;
INFO: Trying: DepthStepper = 32; SamplesStepper = 18; ResolutionStepper = 800x600;
INFO: Trying: DepthStepper = 24; SamplesStepper = 18; ResolutionStepper = 800x600;
INFO: Trying: DepthStepper = 16; SamplesStepper = 18; ResolutionStepper = 800x600;
INFO: Trying: DepthStepper = 32; SamplesStepper = 22; ResolutionStepper = 720x576;
INFO: Trying: DepthStepper = 24; SamplesStepper = 22; ResolutionStepper = 720x576;
INFO: Trying: DepthStepper = 16; SamplesStepper = 22; ResolutionStepper = 720x576;
INFO: Trying: DepthStepper = 32; SamplesStepper = 20; ResolutionStepper = 720x576;
INFO: Trying: DepthStepper = 24; SamplesStepper = 20; ResolutionStepper = 720x576;
INFO: Trying: DepthStepper = 16; SamplesStepper = 20; ResolutionStepper = 720x576;
INFO: Trying: DepthStepper = 32; SamplesStepper = 18; ResolutionStepper = 720x576;
INFO: Trying: DepthStepper = 24; SamplesStepper = 18; ResolutionStepper = 720x576;
INFO: Trying: DepthStepper = 16; SamplesStepper = 18; ResolutionStepper = 720x576;
INFO: Trying: DepthStepper = 32; SamplesStepper = 22; ResolutionStepper = 720x480;
INFO: Trying: DepthStepper = 24; SamplesStepper = 22; ResolutionStepper = 720x480;
INFO: Trying: DepthStepper = 16; SamplesStepper = 22; ResolutionStepper = 720x480;
INFO: Trying: DepthStepper = 32; SamplesStepper = 20; ResolutionStepper = 720x480;
INFO: Trying: DepthStepper = 24; SamplesStepper = 20; ResolutionStepper = 720x480;
INFO: Trying: DepthStepper = 16; SamplesStepper = 20; ResolutionStepper = 720x480;
INFO: Trying: DepthStepper = 32; SamplesStepper = 18; ResolutionStepper = 720x480;
INFO: Trying: DepthStepper = 24; SamplesStepper = 18; ResolutionStepper = 720x480;
INFO: Trying: DepthStepper = 16; SamplesStepper = 18; ResolutionStepper = 720x480;
INFO: Trying: DepthStepper = 32; SamplesStepper = 22; ResolutionStepper = 640x480;
INFO: Trying: DepthStepper = 24; SamplesStepper = 22; ResolutionStepper = 640x480;
INFO: Trying: DepthStepper = 16; SamplesStepper = 22; ResolutionStepper = 640x480;
INFO: Trying: DepthStepper = 32; SamplesStepper = 20; ResolutionStepper = 640x480;
INFO: Trying: DepthStepper = 24; SamplesStepper = 20; ResolutionStepper = 640x480;
INFO: Trying: DepthStepper = 16; SamplesStepper = 20; ResolutionStepper = 640x480;
INFO: Trying: DepthStepper = 32; SamplesStepper = 18; ResolutionStepper = 640x480;
INFO: Trying: DepthStepper = 24; SamplesStepper = 18; ResolutionStepper = 640x480;
INFO: Trying: DepthStepper = 16; SamplesStepper = 18; ResolutionStepper = 640x480;
SEVERE: Could not create displaySystem com.jme.system.JmeException: Stepper ran out of options
So, I just need to know where to get AlphaBits, StencilBits, and DepthBits values, and I'll post all of the code after implementing that