de.esw.eengine.device.render
Class AbstractRenderDevice

java.lang.Object
  extended by de.esw.eengine.device.render.AbstractRenderDevice
All Implemented Interfaces:
IRenderDevice
Direct Known Subclasses:
CanvasRenderDevice, FullscreenRenderDevice, WindowRenderDevice

public abstract class AbstractRenderDevice
extends java.lang.Object
implements IRenderDevice

Since:
1.0
Version:
$Id: AbstractRenderDevice.java 129 2005-06-28 13:18:18Z markusw $
Author:
markusw

Method Summary
 void attachInputDevice(IInputDevice inputDevice)
           
 boolean begin()
          Initializes the IRenderDevices render state and renders in world space.
 boolean begin(boolean onScreen)
          Initializes the IRenderDevices render state.
 java.awt.image.BufferedImage caputeScreen()
           
 void clear(java.awt.Color color)
           
 void close()
          Closes the IRenderDevice.
 java.awt.image.BufferedImage createImage(int width, int height, int transparency)
           
 void detatchInputDevice(IInputDevice inputDevice)
           
 void end()
          Clears the IRenderDevices render state.
 java.awt.Rectangle getExtents()
           
 int getHeight()
           
 java.awt.Insets getInsets()
           
 java.awt.Container getPeer()
           
 Viewport getViewport()
           
 int getWidth()
           
 boolean isOpen()
           
 IRenderDevice open(java.awt.DisplayMode displayMode)
          opens the IRenerDevice with the given DisplayMode
 void render(IRenderPrimitive renderPrimitive)
          Renders the given IRenderPrimitive to this device
 void setViewport(Viewport viewport)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.esw.eengine.core.IRenderDevice
flip
 

Method Detail

open

public final IRenderDevice open(java.awt.DisplayMode displayMode)
                         throws EEngineException
Description copied from interface: IRenderDevice
opens the IRenerDevice with the given DisplayMode

Specified by:
open in interface IRenderDevice
Parameters:
displayMode - DisplayMode to set
Returns:
A IRenderDevice instance or null on failure to create
Throws:
EEngineException - Thrown on creation error
See Also:
IRenderDevice.open(java.awt.DisplayMode)

isOpen

public final boolean isOpen()
Specified by:
isOpen in interface IRenderDevice
Returns:
True if this IRenderDevice is open
See Also:
IRenderDevice.isOpen()

close

public final void close()
Description copied from interface: IRenderDevice
Closes the IRenderDevice.

Specified by:
close in interface IRenderDevice
See Also:
IRenderDevice.close()

clear

public void clear(java.awt.Color color)
           throws EEngineException
Specified by:
clear in interface IRenderDevice
Parameters:
color - Color to fill the background with
Throws:
EEngineException - Thrown on closed device or missing begin call
See Also:
IRenderDevice.clear(java.awt.Color)

begin

public boolean begin()
Description copied from interface: IRenderDevice
Initializes the IRenderDevices render state and renders in world space.
Must be called before any rendering operation.

Specified by:
begin in interface IRenderDevice
Returns:
True if render state successful initalized
See Also:
IRenderDevice.begin()

begin

public boolean begin(boolean onScreen)
Description copied from interface: IRenderDevice
Initializes the IRenderDevices render state.
Must be called before any rendering operation.

Specified by:
begin in interface IRenderDevice
Parameters:
onScreen - If true, rendering happens in screen coordinates instead of world coordinates
Returns:
True if render state successful initalized
See Also:
IRenderDevice.begin(boolean)

end

public final void end()
Description copied from interface: IRenderDevice
Clears the IRenderDevices render state. Must be called before any rendering operation.

Specified by:
end in interface IRenderDevice
See Also:
IRenderDevice.end()

render

public final void render(IRenderPrimitive renderPrimitive)
                  throws EEngineException
Description copied from interface: IRenderDevice
Renders the given IRenderPrimitive to this device

Specified by:
render in interface IRenderDevice
Parameters:
renderPrimitive - Primitive to render
Throws:
EEngineException - Thrown on closed device or missing begin call
See Also:
IRenderDevice.render(de.esw.eengine.core.IRenderPrimitive)

attachInputDevice

public void attachInputDevice(IInputDevice inputDevice)
Specified by:
attachInputDevice in interface IRenderDevice
Parameters:
inputDevice - Attaches the inputDevice to this IRenderDevice
See Also:
IRenderDevice.attachInputDevice(de.esw.eengine.core.IInputDevice)

detatchInputDevice

public void detatchInputDevice(IInputDevice inputDevice)
Specified by:
detatchInputDevice in interface IRenderDevice
Parameters:
inputDevice - Detaches the inputDevice from this IRenderDevice
See Also:
IRenderDevice.detatchInputDevice(de.esw.eengine.core.IInputDevice)

getWidth

public final int getWidth()
Specified by:
getWidth in interface IRenderDevice
Returns:
Returns the width.

getHeight

public final int getHeight()
Specified by:
getHeight in interface IRenderDevice
Returns:
Returns the height.

getExtents

public final java.awt.Rectangle getExtents()
Specified by:
getExtents in interface IRenderDevice
Returns:
IRenderDevices extents
See Also:
IRenderDevice.getExtents()

getViewport

public Viewport getViewport()
Specified by:
getViewport in interface IRenderDevice
Returns:
The device Viewport
See Also:
IRenderDevice.getViewport()

setViewport

public void setViewport(Viewport viewport)
Specified by:
setViewport in interface IRenderDevice
Parameters:
viewport - The device Viewport
See Also:
IRenderDevice.setViewport(de.esw.eengine.core.Viewport)

createImage

public java.awt.image.BufferedImage createImage(int width,
                                                int height,
                                                int transparency)
Specified by:
createImage in interface IRenderDevice
Parameters:
width - Width of the image to create
height - Height of the image to create
transparency - Transparency of the image to create
Returns:
RenderDevice compatible image
See Also:
IRenderDevice.createImage(int, int, int)

caputeScreen

public java.awt.image.BufferedImage caputeScreen()
                                          throws EEngineException
Specified by:
caputeScreen in interface IRenderDevice
Returns:
BufferedImage of the screen
Throws:
EEngineException - Thrown on capture error
See Also:
IRenderDevice.caputeScreen()

getPeer

public java.awt.Container getPeer()
Specified by:
getPeer in interface IRenderDevice
Returns:
Component used for rendering. This could be JComponent, JFrame, Component, Frame, etc.
See Also:
IRenderDevice.getPeer()

getInsets

public java.awt.Insets getInsets()
Specified by:
getInsets in interface IRenderDevice
Returns:
Insets to the client area