|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Panel | +--java.applet.Applet | +--com.golden.gamedev.engine.graphics.HybridMode
Graphics frame work supports Applet, Window, and Fullscreen Environment,
parent class of Game
.
Field Summary | |
static int |
APPLET_MODE
|
static int |
FULLSCREEN_MODE
|
static GraphicsConfiguration |
gc
|
static int |
WINDOW_MODE
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
HybridMode()
Creates new instance of HybridMode, please see note below. |
Method Summary | |
void |
cleanup()
Releases all graphics resources and do finalization. |
protected void |
createEnvironment(boolean fullscreen,
boolean bufferstrategy)
|
boolean |
flip()
Flips backbuffer to screen (primary surface). |
Graphics2D |
getBackBuffer()
Returns backbuffer where the rendering perform. |
Component |
getComponent()
Returns the component where the rendering perform. |
int |
getEnvironment()
|
String |
getEnvironmentString()
|
Frame |
getFrame()
|
Dimension |
getSize()
Returns the dimension of this graphics component. |
void |
setup(Dimension d,
boolean fullscreen)
|
void |
setup(Dimension d,
boolean fullscreen,
boolean bufferstrategy)
|
void |
start()
|
Methods inherited from class java.applet.Applet |
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, stop |
Methods inherited from class java.awt.Panel |
addNotify |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int APPLET_MODE
public static final int WINDOW_MODE
public static final int FULLSCREEN_MODE
public static final GraphicsConfiguration gc
Constructor Detail |
public HybridMode()
Note:
Do not make any overloading constructors for this class.
Setup should be the first to call after object creation,
setup(Dimension, fullscreen)
and
setup(Dimension, fullscreen, bufferstrategy)
.
(for Window and FullScreen mode only)
For example:
public class TestMode extends HybridMode { // writes only empty constructor, // or simply don't write any constructor public TestMode() { } // do not use both of these // public TestMode(boolean fullscreen) { // setup(new Dimension(640,480), fullscreen); // } // public TestMode() { // setup(new Dimension(640,480), true); // } public static void main(String[] args) { HybridMode frame = new TestMode(); // sets fullscreen mode, with 640 x 480 display mode frame.setup(new Dimension(640,480), true); } }
setup(Dimension, boolean)
,
setup(Dimension, boolean, boolean)
Method Detail |
protected void createEnvironment(boolean fullscreen, boolean bufferstrategy)
public void setup(Dimension d, boolean fullscreen, boolean bufferstrategy)
public final void setup(Dimension d, boolean fullscreen)
public void start()
start
in class Applet
public int getEnvironment()
public String getEnvironmentString()
public void cleanup()
BaseGraphics
cleanup
in interface BaseGraphics
public Graphics2D getBackBuffer()
BaseGraphics
getBackBuffer
in interface BaseGraphics
public boolean flip()
BaseGraphics
For Example:
do { Graphics2D g = BaseGraphics.getBackBuffer(); //.... do graphics operation } while (BaseGraphics.flip() == false);See VolatileImage for detail information.
flip
in interface BaseGraphics
BaseGraphics.getBackBuffer()
,
VolatileImage
public Dimension getSize()
BaseGraphics
getSize
in interface BaseGraphics
getSize
in class Component
public Component getComponent()
BaseGraphics
getComponent
in interface BaseGraphics
public Frame getFrame()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |