de.esw.eengine.core
Interface IRenderDevice

All Known Implementing Classes:
AbstractRenderDevice, CanvasRenderDevice, FullscreenRenderDevice, WindowRenderDevice

public interface IRenderDevice

Since:
1.0
Version:
$Id: IRenderDevice.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.
 void flip()
          Flips front- and backbuffer
 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)
           
 

Method Detail

open

IRenderDevice open(java.awt.DisplayMode displayMode)
                   throws EEngineException
opens the IRenerDevice with the given DisplayMode

Parameters:
displayMode - DisplayMode to set
Returns:
A IRenderDevice instance or null on failure to create
Throws:
EEngineException - Thrown on creation error

isOpen

boolean isOpen()
Returns:
True if this IRenderDevice is open

close

void close()
Closes the IRenderDevice.


clear

void clear(java.awt.Color color)
           throws EEngineException
Parameters:
color - Color to fill the background with
Throws:
EEngineException - Thrown on closed device or missing begin call

begin

boolean begin()
Initializes the IRenderDevices render state and renders in world space.
Must be called before any rendering operation.

Returns:
True if render state successful initalized

begin

boolean begin(boolean onScreen)
Initializes the IRenderDevices render state.
Must be called before any rendering operation.

Parameters:
onScreen - If true, rendering happens in screen coordinates instead of world coordinates
Returns:
True if render state successful initalized

end

void end()
Clears the IRenderDevices render state. Must be called before any rendering operation.


render

void render(IRenderPrimitive renderPrimitive)
            throws EEngineException
Renders the given IRenderPrimitive to this device

Parameters:
renderPrimitive - Primitive to render
Throws:
EEngineException - Thrown on closed device or missing begin call

flip

void flip()
Flips front- and backbuffer


attachInputDevice

void attachInputDevice(IInputDevice inputDevice)
Parameters:
inputDevice - Attaches the inputDevice to this IRenderDevice

detatchInputDevice

void detatchInputDevice(IInputDevice inputDevice)
Parameters:
inputDevice - Detaches the inputDevice from this IRenderDevice

getWidth

int getWidth()
Returns:
Width of this IRenderDevice

getHeight

int getHeight()
Returns:
Height of this IRenderDevice

getExtents

java.awt.Rectangle getExtents()
Returns:
IRenderDevices extents

getViewport

Viewport getViewport()
Returns:
The device Viewport

setViewport

void setViewport(Viewport viewport)
Parameters:
viewport - The device Viewport

createImage

java.awt.image.BufferedImage createImage(int width,
                                         int height,
                                         int transparency)
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

caputeScreen

java.awt.image.BufferedImage caputeScreen()
                                          throws EEngineException
Returns:
BufferedImage of the screen
Throws:
EEngineException - Thrown on capture error

getPeer

java.awt.Container getPeer()
Returns:
Component used for rendering. This could be JComponent, JFrame, Component, Frame, etc.

getInsets

java.awt.Insets getInsets()
Returns:
Insets to the client area (e.g. Window border and titlebar)