com.jmex.awt.lwjgl
Class LWJGLCanvas

java.lang.Object
  extended by AWTGLCanvas
      extended by com.jmex.awt.lwjgl.LWJGLCanvas
All Implemented Interfaces:
JMECanvas

public class LWJGLCanvas
extends AWTGLCanvas
implements JMECanvas

LWJGLCanvas

Version:
$Id: LWJGLCanvas.java 4133 2009-03-19 20:40:11Z blaine.dev $
Author:
Joshua Slack

Constructor Summary
LWJGLCanvas()
           
 
Method Summary
 int getTargetSyncRate()
           
protected  void initGL()
           
 boolean isDrawWhenDirty()
           
 boolean isUpdateInput()
           
 void killGfxContext()
          Destroy GFX context
protected  ColorRGBA makeColorRGBA(java.awt.Color color)
           
 void makeDirty()
          Force this canvas to be flagged as dirty.
protected  void paintGL()
           
 void removeNotify()
           
 void setAutoKillGfxContext(boolean shouldAutoKillGfxContext)
           
 void setBackground(java.awt.Color bgColor)
           
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LWJGLCanvas

public LWJGLCanvas()
            throws LWJGLException
Throws:
LWJGLException
Method Detail

setImplementor

public void setImplementor(JMECanvasImplementor impl)
Description copied from interface: JMECanvas
Sets the logic/gameplay implementation for this JMECanvas

Specified by:
setImplementor in interface JMECanvas
Parameters:
impl - the implementor object that will provide rendering/update logic.

initGL

protected void initGL()

paintGL

protected void paintGL()

setBackground

public void setBackground(java.awt.Color bgColor)

makeColorRGBA

protected ColorRGBA makeColorRGBA(java.awt.Color color)

isUpdateInput

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

setUpdateInput

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

setTargetRate

public void setTargetRate(int fps)
Description copied from interface: JMECanvas
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.

Specified by:
setTargetRate in interface JMECanvas
Parameters:
fps - the desired target rate in frames per second

getTargetSyncRate

public int getTargetSyncRate()
Specified by:
getTargetSyncRate in interface JMECanvas
Returns:
the desired target rate in frames per second
See Also:
JMECanvas.setTargetRate(int)

setDrawWhenDirty

public void setDrawWhenDirty(boolean whenDirty)
Specified by:
setDrawWhenDirty in interface JMECanvas
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

public boolean isDrawWhenDirty()
Specified by:
isDrawWhenDirty in interface JMECanvas
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

public void makeDirty()
Description copied from interface: JMECanvas
Force this canvas to be flagged as dirty. See JMECanvas.setDrawWhenDirty(boolean).

Specified by:
makeDirty in interface JMECanvas

removeNotify

public void removeNotify()

setAutoKillGfxContext

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

shouldAutoKillGfxContext

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

killGfxContext

public void killGfxContext()
Description copied from interface: JMECanvas
Destroy GFX context

Specified by:
killGfxContext in interface JMECanvas