com.threed.jpct
Class VideoMode

java.lang.Object
  extended bycom.threed.jpct.VideoMode
All Implemented Interfaces:
java.io.Serializable

public class VideoMode
extends java.lang.Object
implements java.io.Serializable

A VideoMode represents a display mode that a device can handle. Useful to set up the OpenGL renderer in a mode that the current hardware supports. The VideoMode is a description of a video-mode only. It doesn't really set the mode.

See Also:
FrameBuffer.getVideoModes(int), Serialized Form

Field Summary
 int bpp
          The colordepth of the framebuffer that this video mode uses in bits
 int depth
          The depth of the depthbuffer in bits
 int height
          The height of the framebuffer that this video mode uses in pixels
 int refresh
          The refresh rate in Hz.
 int width
          The width of the framebuffer that this video mode uses in pixels
 
Constructor Summary
VideoMode(int width, int height, int bpp, int depth, int refresh)
          Creates a new VideoMode.
 
Method Summary
 boolean equalsAlmost(VideoMode vm, boolean adjust)
          Compares two video-modes.
 boolean equalsExactly(VideoMode vm)
          Compares two video-modes.
 java.lang.String toString()
          Displays the video-mode data in a human readable format.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

width

public int width
The width of the framebuffer that this video mode uses in pixels


height

public int height
The height of the framebuffer that this video mode uses in pixels


bpp

public int bpp
The colordepth of the framebuffer that this video mode uses in bits


depth

public int depth
The depth of the depthbuffer in bits


refresh

public int refresh
The refresh rate in Hz.

Constructor Detail

VideoMode

public VideoMode(int width,
                 int height,
                 int bpp,
                 int depth,
                 int refresh)
Creates a new VideoMode. This constructor ignores alpha and stencil (i.e. both will be set to 0)

Parameters:
width - the width
height - the height
bpp - the colordepth
depth - the z-buffer depth
refresh - the refresh rate
Method Detail

toString

public java.lang.String toString()
Displays the video-mode data in a human readable format.

Returns:
the video mode

equalsExactly

public boolean equalsExactly(VideoMode vm)
Compares two video-modes. Does not take the depth-value into account.

Parameters:
vm - the video-mode to compare to
Returns:
true if both modes are exactly equal, otherwise false.

equalsAlmost

public boolean equalsAlmost(VideoMode vm,
                            boolean adjust)
Compares two video-modes. This method takes two modes as equal, if width and height are equal and bpp and refresh are at least as high as they are in vm. Does not take the depth-value into account.

Parameters:
vm - the video-mode to compare to
adjust - if true, vm will be adjusted to match the values of this video-mode, otherwise (=false) it won't be touched.
Returns:
true if both modes are almost equal, otherwise false.