unc.cdva.renderingengine
Class RenderingEngine

java.lang.Object
  extended by unc.cdva.renderingengine.RenderingEngine
All Implemented Interfaces:
java.util.EventListener, javax.media.opengl.GLEventListener, ClickEventListener

public class RenderingEngine
extends java.lang.Object
implements javax.media.opengl.GLEventListener, ClickEventListener

Heart of the rendering pipeline. The RenderingEngine class implements the GLEventListener interface and is responsible for setting up OpenGL and the display list on the screen. All what is done in that class in done in a separate thread. And you can't get the value of the OpengGL matrices outside of the display method

Author:
Guillaume Conte

Constructor Summary
RenderingEngine(org.fenggui.Display display, UIManager uiManager, GraphicsManager graphicsManager)
          Init a rendering engine object with the right values
 
Method Summary
 void display(javax.media.opengl.GLAutoDrawable arg0)
           
 void displayChanged(javax.media.opengl.GLAutoDrawable arg0, boolean arg1, boolean arg2)
          Do absolutely nothing...
 GraphicsManager getGraphicsManager()
           
 UIManager getUIManager()
           
 void init(javax.media.opengl.GLAutoDrawable arg0)
           
 void initExtension(java.lang.String glExtensionName)
          Check if an OpenGL extension is available
 void initOpenGL()
          Initialiaze OpenGL (set the perspective, viewport, enable features, etc...)
 boolean isReady()
           
 void reshape(javax.media.opengl.GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4)
           
 void setReady(boolean ready)
           
 void transformToWorldCoordinates(ClickEvent event)
          Invoked when the screen coordinates are transformed to world coordinates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderingEngine

public RenderingEngine(org.fenggui.Display display,
                       UIManager uiManager,
                       GraphicsManager graphicsManager)
Init a rendering engine object with the right values

Parameters:
display - root of FengGUI, has to be instanciated outside
uiManager - UI Manager, instanciated before
graphicsManager - graphics manager
Method Detail

init

public void init(javax.media.opengl.GLAutoDrawable arg0)
Specified by:
init in interface javax.media.opengl.GLEventListener
See Also:
GLEventListener.init(javax.media.opengl.GLAutoDrawable)

display

public void display(javax.media.opengl.GLAutoDrawable arg0)
Specified by:
display in interface javax.media.opengl.GLEventListener
See Also:
GLEventListener.display(javax.media.opengl.GLAutoDrawable)

reshape

public void reshape(javax.media.opengl.GLAutoDrawable arg0,
                    int arg1,
                    int arg2,
                    int arg3,
                    int arg4)
Specified by:
reshape in interface javax.media.opengl.GLEventListener
See Also:
GLEventListener.reshape(javax.media.opengl.GLAutoDrawable, int, int, int, int)

displayChanged

public void displayChanged(javax.media.opengl.GLAutoDrawable arg0,
                           boolean arg1,
                           boolean arg2)
Do absolutely nothing...

Specified by:
displayChanged in interface javax.media.opengl.GLEventListener
See Also:
GLEventListener.displayChanged(javax.media.opengl.GLAutoDrawable, boolean, boolean)

initOpenGL

public void initOpenGL()
Initialiaze OpenGL (set the perspective, viewport, enable features, etc...)


initExtension

public void initExtension(java.lang.String glExtensionName)
Check if an OpenGL extension is available

Parameters:
glExtensionName - name of the extension

getUIManager

public UIManager getUIManager()
Returns:
the UI manager

isReady

public boolean isReady()
Returns:
the ready

setReady

public void setReady(boolean ready)
Parameters:
ready - the ready to set

getGraphicsManager

public GraphicsManager getGraphicsManager()
Returns:
the graphicsManager

transformToWorldCoordinates

public void transformToWorldCoordinates(ClickEvent event)
Description copied from interface: ClickEventListener
Invoked when the screen coordinates are transformed to world coordinates

Specified by:
transformToWorldCoordinates in interface ClickEventListener
See Also:
ClickEventListener.transformToWorldCoordinates(unc.cdva.events.clickevents.ClickEvent)