|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmhframework.MHDisplayModeChooser
public abstract class MHDisplayModeChooser
Abstract class for switching full-screen display modes and maintaining references to critical singleton objects.
This class iterates through an internal list of recommended display modes and selects the best one supported by the system on which this program is running.
It contains the objects necessary for full-screen rendering along with accessor methods for retrieving references to them. Included classes of particular interest are:
Field Summary | |
---|---|
static int |
DISPLAY_X
Top-left corner of screen display, to account for insets in windowed mode. |
static int |
DISPLAY_Y
Top-left corner of screen display, to account for insets in windowed mode. |
static int |
NATIVE_DISPLAY_HEIGHT
|
static int |
NATIVE_DISPLAY_WIDTH
|
Constructor Summary | |
---|---|
MHDisplayModeChooser()
|
Method Summary | |
---|---|
static void |
changeScreen(boolean fullScreen)
TODO: Figure out if this method can be fixed. |
static void |
configureGameWindow(javax.swing.JFrame appFrame,
MHVideoSettings settings)
Configures a JFrame object for full-screen or windowed rendering as specified in the MHVideoSettings parameter. |
static java.awt.geom.Rectangle2D |
getBounds()
|
static java.awt.image.BufferStrategy |
getBufferStrategy()
Returns the active BufferStrategy object being used with the current display mode. |
static java.awt.Canvas |
getCanvas()
Returns a reference to the Canvas object which represents the graphics screen. |
static javax.swing.JFrame |
getFrame()
|
static java.awt.Graphics2D |
getGraphics2D()
|
static java.awt.Dimension |
getScreenSize()
|
static boolean |
isFullScreen()
|
void |
setCursor(java.lang.String cursorImageFileName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int DISPLAY_X
public static int DISPLAY_Y
public static int NATIVE_DISPLAY_WIDTH
public static int NATIVE_DISPLAY_HEIGHT
Constructor Detail |
---|
public MHDisplayModeChooser()
Method Detail |
---|
public static java.awt.image.BufferStrategy getBufferStrategy()
public static java.awt.Canvas getCanvas()
public static void configureGameWindow(javax.swing.JFrame appFrame, MHVideoSettings settings)
appFrame
- The JFrame object to be configured. If null, a new
JFrame is created.settings
- A MHVideoSettings object containing guideline
parameters to specify details of the video mode to
configure. If null, default settings are used to
attempt full-screen mode.public static java.awt.Dimension getScreenSize()
public static javax.swing.JFrame getFrame()
public static java.awt.Graphics2D getGraphics2D()
public static boolean isFullScreen()
public void setCursor(java.lang.String cursorImageFileName)
public static void changeScreen(boolean fullScreen)
public static java.awt.geom.Rectangle2D getBounds()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |