com.jmex.awt.jogl
Class JOGLAWTCanvas

java.lang.Object
  extended by GLCanvas
      extended by com.jmex.awt.jogl.JOGLAWTCanvas
All Implemented Interfaces:
JMECanvas

public class JOGLAWTCanvas
extends GLCanvas
implements JMECanvas

Author:
Steve Vaughan

Constructor Summary
JOGLAWTCanvas(GLCapabilities caps)
           
 
Method Summary
 void display(GLAutoDrawable drawable)
           
 void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged)
           
 java.awt.Color getBackground()
           
 int getTargetSyncRate()
           
 void init(GLAutoDrawable drawable)
           
 boolean isDrawWhenDirty()
           
 boolean isUpdateInput()
           
 void killGfxContext()
          Destroy GFX context
 void makeDirty()
          Force this canvas to be flagged as dirty.
 void paint(java.awt.Graphics arg0)
           
 void removeNotify()
           
 void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
           
 void setAutoKillGfxContext(boolean shouldAutoKillGfxContext)
           
 void setBackground(java.awt.Color c)
           
 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

JOGLAWTCanvas

public JOGLAWTCanvas(GLCapabilities caps)
Method Detail

setBackground

public void setBackground(java.awt.Color c)

getBackground

public java.awt.Color getBackground()

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.

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".

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".

init

public void init(GLAutoDrawable drawable)

display

public void display(GLAutoDrawable drawable)

displayChanged

public void displayChanged(GLAutoDrawable drawable,
                           boolean modeChanged,
                           boolean deviceChanged)

reshape

public void reshape(GLAutoDrawable drawable,
                    int x,
                    int y,
                    int width,
                    int height)

paint

public void paint(java.awt.Graphics arg0)

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