org.xith3d.render.config
Class DisplayMode

java.lang.Object
  extended by org.xith3d.render.config.DisplayMode
All Implemented Interfaces:
org.openmali.types.twodee.Sized2iRO

public class DisplayMode
extends java.lang.Object
implements org.openmali.types.twodee.Sized2iRO

Represents an abstract display mode.
All available DisplayModes can be retrieved by a DisplayModeSelector implementation.

See Also:
DisplayModeSelector

Nested Class Summary
static class DisplayMode.FullscreenMode
           
 
Field Summary
static DisplayMode.FullscreenMode FULLSCREEN
           
static boolean VSYNC_DISABLED
           
static boolean VSYNC_ENABLED
           
static DisplayMode.FullscreenMode WINDOWED
           
static DisplayMode.FullscreenMode WINDOWED_UNDECORATED
           
 
Constructor Summary
DisplayMode(java.lang.Object nativeMode, int width, int height, int bpp, int freq)
          Creates a new DisplayMode object.
DisplayMode(OpenGLLayer oglLayer, java.lang.Object nativeMode, int width, int height, int bpp, int freq)
          Creates a new DisplayMode object.
 
Method Summary
 boolean equals(java.lang.Object other)
          
 float getAspect()
           
 int getBPP()
           
static int getDefaultBPP()
           
static int getDefaultFrequency()
           
 int getFrequency()
           
 int getHeight()
           
 java.lang.Object getNativeMode()
           
 OpenGLLayer getOpenGLLayer()
           
 org.openmali.vecmath2.Tuple2i getSize()
          
 int getWidth()
           
static DisplayMode parseDisplayMode(OpenGLLayer layer, java.lang.String value)
          Creates a DisplayMode instance from the String, if possible.
 java.lang.String toLightString()
           
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

FULLSCREEN

public static DisplayMode.FullscreenMode FULLSCREEN

WINDOWED

public static DisplayMode.FullscreenMode WINDOWED

WINDOWED_UNDECORATED

public static DisplayMode.FullscreenMode WINDOWED_UNDECORATED

VSYNC_ENABLED

public static boolean VSYNC_ENABLED

VSYNC_DISABLED

public static boolean VSYNC_DISABLED
Constructor Detail

DisplayMode

public DisplayMode(OpenGLLayer oglLayer,
                   java.lang.Object nativeMode,
                   int width,
                   int height,
                   int bpp,
                   int freq)
Creates a new DisplayMode object.

Parameters:
oglLayer -
nativeMode - the OpenGLLayer dependent DisplayMode object
width - the width
height - the height
bpp - the pits per pixel
freq - the frequency

DisplayMode

public DisplayMode(java.lang.Object nativeMode,
                   int width,
                   int height,
                   int bpp,
                   int freq)
Creates a new DisplayMode object.

Parameters:
nativeMode - the OpenGLLayer dependent DisplayMode object
width - the width
height - the height
bpp - the pits per pixel
freq - the frequency
Method Detail

getDefaultBPP

public static int getDefaultBPP()
Returns:
the default bits per pixel (color depth)

getDefaultFrequency

public static int getDefaultFrequency()
Returns:
the default bits per pixel (color depth)

getOpenGLLayer

public final OpenGLLayer getOpenGLLayer()

getNativeMode

public java.lang.Object getNativeMode()
Returns:
the native OpenGLLayer-dependent DisplayMode object used by the CanvasPeer implementations to set the display mode.

getWidth

public final int getWidth()
Specified by:
getWidth in interface org.openmali.types.twodee.Sized2iRO
Returns:
the width of the display mode

getHeight

public final int getHeight()
Specified by:
getHeight in interface org.openmali.types.twodee.Sized2iRO
Returns:
the height of the display mode

getSize

public org.openmali.vecmath2.Tuple2i getSize()


getAspect

public float getAspect()
Specified by:
getAspect in interface org.openmali.types.twodee.Sized2iRO
Returns:
this DisplayMode's aspect ratio

getBPP

public final int getBPP()
Returns:
the bits per pixel of the display mode

getFrequency

public final int getFrequency()
Returns:
the frequency of the display mode

parseDisplayMode

public static DisplayMode parseDisplayMode(OpenGLLayer layer,
                                           java.lang.String value)
                                    throws java.lang.IllegalArgumentException
Creates a DisplayMode instance from the String, if possible.
The String must be of format 800x600x24x85

Parameters:
layer - the OpenGLLayer to use for native mode retieval
value - the String to create a DisplayMode from
Returns:
the created DisplayMode
Throws:
java.lang.IllegalArgumentException - if the String was not of the right format

toLightString

public java.lang.String toLightString()
Returns:
a String in the format 800x600x24x85

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object other)

Overrides:
equals in class java.lang.Object