org.xith3d.render.config
Class DisplayModeSelector

java.lang.Object
  extended by org.xith3d.render.config.DisplayModeSelector
Direct Known Subclasses:
DisplayModeSelectorAWTImpl, DisplayModeSelectorAWTImpl, DisplayModeSelectorNativeImpl

public abstract class DisplayModeSelector
extends java.lang.Object

DisplayModeSelector base.
If you want to know, which DisplayModes are awailable on your System and for a specific OpenGLLayer, make use of it.

Instantiate it by invoking the static getImplementation() method.

See Also:
getImplementation(org.xith3d.render.config.OpenGLLayer)

Field Summary
static boolean debug
           
 
Constructor Summary
DisplayModeSelector()
           
 
Method Summary
abstract  DisplayMode[] getAvailableModes()
           
 DisplayMode getBestMode(int width, int height)
          Returns the DisplayMode matching best the given parameters.
 DisplayMode getBestMode(int width, int height, int optimalBPP)
          Returns the DisplayMode matching best the given parameters.
 DisplayMode getBestMode(int width, int height, int optimalBPP, int optimalFreq)
          Returns the DisplayMode matching best the given parameters.
 DisplayMode getDesktopMode()
           
static DisplayModeSelector getImplementation(OpenGLLayer layer)
           
protected  void sortModes(DisplayMode[] modes)
          Sorts the DisplayModes in ascending order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static boolean debug
Constructor Detail

DisplayModeSelector

public DisplayModeSelector()
Method Detail

sortModes

protected void sortModes(DisplayMode[] modes)
Sorts the DisplayModes in ascending order.

Parameters:
modes - the array of DisplayModes

getAvailableModes

public abstract DisplayMode[] getAvailableModes()
Returns:
an Array of all available DisplayModes

getDesktopMode

public DisplayMode getDesktopMode()
Returns:
the DisplayMode for the current Desktop setting.

getBestMode

public DisplayMode getBestMode(int width,
                               int height,
                               int optimalBPP,
                               int optimalFreq)
Returns the DisplayMode matching best the given parameters.

Parameters:
width -
height -
optimalBPP -
optimalFreq -
Returns:
the best possible DisplayMode

getBestMode

public DisplayMode getBestMode(int width,
                               int height,
                               int optimalBPP)
Returns the DisplayMode matching best the given parameters.

Parameters:
width -
height -
optimalBPP -
Returns:
the best possible DisplayMode

getBestMode

public DisplayMode getBestMode(int width,
                               int height)
Returns the DisplayMode matching best the given parameters.

Parameters:
width -
height -
Returns:
the best possible DisplayMode

getImplementation

public static DisplayModeSelector getImplementation(OpenGLLayer layer)
Parameters:
layer -
Returns:
the DisplayModeSelector implementation for the given OpenGLLayer.