com.golden.gamedev.engine.graphics
Class FullScreenMode

java.lang.Object
  |
  +--com.golden.gamedev.engine.graphics.FullScreenMode
All Implemented Interfaces:
BaseGraphics

public class FullScreenMode
extends Object
implements BaseGraphics

Graphics frame work for fullscreen exclusive environment, used by GameEngine to create game environment.


Field Summary
protected  Frame frame
           
static GraphicsConfiguration gc
           
 
Constructor Summary
FullScreenMode(Dimension d)
           
FullScreenMode(Dimension d, boolean useBufferStrategy)
           
 
Method Summary
 void cleanup()
          Releases all graphics resources and do finalization.
 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.
 Dimension getSize()
          Returns the dimension of this graphics component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gc

public static final GraphicsConfiguration gc

frame

protected Frame frame
Constructor Detail

FullScreenMode

public FullScreenMode(Dimension d,
                      boolean useBufferStrategy)

FullScreenMode

public FullScreenMode(Dimension d)
Method Detail

getSize

public Dimension getSize()
Description copied from interface: BaseGraphics
Returns the dimension of this graphics component.

Specified by:
getSize in interface BaseGraphics
Returns:
graphics dimension.

cleanup

public void cleanup()
Description copied from interface: BaseGraphics
Releases all graphics resources and do finalization.

Specified by:
cleanup in interface BaseGraphics

getBackBuffer

public Graphics2D getBackBuffer()
Description copied from interface: BaseGraphics
Returns backbuffer where the rendering perform.

Specified by:
getBackBuffer in interface BaseGraphics
Returns:
backbuffer graphics.

flip

public boolean flip()
Description copied from interface: BaseGraphics
Flips backbuffer to screen (primary surface). Since the backbuffer is VolatileImage type, the flipping data could be lost and need to be restored. Therefore, if this method return false, backbuffer needs to be rerendered.

For Example:

    do {
        Graphics2D g = BaseGraphics.getBackBuffer();
        //.... do graphics operation
    } while (BaseGraphics.flip() == false);
 
See VolatileImage for detail information.

Specified by:
flip in interface BaseGraphics
Returns:
true, if the flipping is successfully proceed
See Also:
BaseGraphics.getBackBuffer(), VolatileImage

getComponent

public Component getComponent()
Description copied from interface: BaseGraphics
Returns the component where the rendering perform.

Specified by:
getComponent in interface BaseGraphics
Returns:
graphics component.