com.jme.system.canvas
Interface JMECanvas

All Known Implementing Classes:
JOGLAWTCanvas, LWJGLCanvas, LWJGLSWTCanvas

public interface JMECanvas

JMECanvas is an interface to classes allowing jME generated graphics to be displayed in an AWT/Swing/SWT or other such UI framework.

Author:
Joshua Slack

Method Summary
 int getTargetSyncRate()
           
 boolean isDrawWhenDirty()
           
 boolean isUpdateInput()
           
 void killGfxContext()
          Destroy GFX context
 void makeDirty()
          Force this canvas to be flagged as dirty.
 void setAutoKillGfxContext(boolean shouldAutoKillGfxContext)
           
 void setDrawWhenDirty(boolean whenDirty)
           
 void setImplementor(JMECanvasImplementor impl)
          Sets the logic/gameplay implementation for this JMECanvas
 void setTargetRate(int fps)
          Set the desired update/redraw frequency of this canvas.
 void setUpdateInput(boolean doUpdate)
           
 boolean shouldAutoKillGfxContext()
           
 

Method Detail

setImplementor

void setImplementor(JMECanvasImplementor impl)
Sets the logic/gameplay implementation for this JMECanvas

Parameters:
impl - the implementor object that will provide rendering/update logic.

isUpdateInput

boolean isUpdateInput()
Returns:
true if the logic loop of this canvas should ask jME's input system to "poll".

setUpdateInput

void setUpdateInput(boolean doUpdate)
Parameters:
doUpdate - true if the logic loop of this canvas should ask jME's input system to "poll".

setAutoKillGfxContext

void setAutoKillGfxContext(boolean shouldAutoKillGfxContext)
Parameters:
shouldAutoKillGfxContext - true(default) if the GFX Context should be destroyed as soon as the canvas is removed from it's parent container

shouldAutoKillGfxContext

boolean shouldAutoKillGfxContext()
Returns:
true(default) if the GFX Context should be destroyed as soon as the canvas is removed from it's parent container

killGfxContext

void killGfxContext()
Destroy GFX context


setTargetRate

void setTargetRate(int fps)
Set the desired update/redraw frequency of this canvas. If setDrawWhenDirty was called with true, this frequency is just a cap to possible redraw rate.

Parameters:
fps - the desired target rate in frames per second

getTargetSyncRate

int getTargetSyncRate()
Returns:
the desired target rate in frames per second
See Also:
setTargetRate(int)

setDrawWhenDirty

void setDrawWhenDirty(boolean whenDirty)
Parameters:
whenDirty - true if we should only draw if the canvas is flagged as dirty. false if we should draw on every loop regardless of dirty state.

isDrawWhenDirty

boolean isDrawWhenDirty()
Returns:
true if we should only draw if the canvas is flagged as dirty. false if we should draw on every loop regardless of dirty state.

makeDirty

void makeDirty()
Force this canvas to be flagged as dirty. See setDrawWhenDirty(boolean).