de.javagl.simplerenderer
Interface SimpleRenderer

All Known Implementing Classes:
AbstractSimpleRenderer, SimpleRendererJOGL, SimpleRendererLWJGL

public interface SimpleRenderer

Interface for a simple renderer. Hence the name...


Field Summary
static int CL_CGL_SHAREGROUP_KHR
          OpenCL constant for getCLContextProperties()
static int CL_EGL_DISPLAY_KHR
          OpenCL constant for getCLContextProperties()
static int CL_GL_CONTEXT_KHR
          OpenCL constant for getCLContextProperties()
static int CL_GLX_DISPLAY_KHR
          OpenCL constant for getCLContextProperties()
static int CL_WGL_HDC_KHR
          OpenCL constant for getCLContextProperties()
 
Method Summary
 java.nio.FloatBuffer acquireBuffer(int vbo)
          Map the buffer for the specified vertex buffer object
 void addPostRenderCallback(java.lang.Runnable runnable)
          Add the given runnable to the rendering callbacks that will be called after each rendering pass.
 void addPreRenderCallback(java.lang.Runnable runnable)
          Add the given runnable to the rendering callbacks that will be called before each rendering pass.
 void addSimpleObject(SimpleObject simpleObject)
          Add a task to add the given object to this renderer.
 void clearSimpleObjects()
          Add a task to remove all objects before the next rendering pass.
 long[] getCLContextProperties()
          Return the OpenCL context properties for the OpenGL context that is backing this renderer.
 java.awt.Component getRenderComponent()
          Returns the component that is used for rendering
 java.util.concurrent.Semaphore getRenderingSemaphore()
          Returns the Semaphore that will be acquired before the rendering, and released after the rendering.
 SimpleObjectGL getSimpleObjectGL(SimpleObject simpleObject)
          Returns the internal representation of the given object.
 java.util.List<SimpleObject> getSimpleObjects()
          Returns an immutable list of all SimpleObjects.
 void invokeLater(java.lang.Runnable runnable)
          Add the given runnable to be executed on the rendering thread before the next rendering pass.
 void releaseBuffer(int vbo)
          Unmap the buffer for the specified vertex buffer object
 void removePostRenderCallback(java.lang.Runnable runnable)
          Remove the given runnable from the rendering callbacks.
 void removePreRenderCallback(java.lang.Runnable runnable)
          Remove the given runnable from the rendering callbacks.
 void removeSimpleObject(SimpleObject simpleObject)
          Add a task to remove the given object.
 

Field Detail

CL_GL_CONTEXT_KHR

static final int CL_GL_CONTEXT_KHR
OpenCL constant for getCLContextProperties()

See Also:
Constant Field Values

CL_EGL_DISPLAY_KHR

static final int CL_EGL_DISPLAY_KHR
OpenCL constant for getCLContextProperties()

See Also:
Constant Field Values

CL_GLX_DISPLAY_KHR

static final int CL_GLX_DISPLAY_KHR
OpenCL constant for getCLContextProperties()

See Also:
Constant Field Values

CL_WGL_HDC_KHR

static final int CL_WGL_HDC_KHR
OpenCL constant for getCLContextProperties()

See Also:
Constant Field Values

CL_CGL_SHAREGROUP_KHR

static final int CL_CGL_SHAREGROUP_KHR
OpenCL constant for getCLContextProperties()

See Also:
Constant Field Values
Method Detail

getRenderComponent

java.awt.Component getRenderComponent()
Returns the component that is used for rendering

Returns:
The component that is used for rendering

addSimpleObject

void addSimpleObject(SimpleObject simpleObject)
Add a task to add the given object to this renderer. The object will be added before the next rendering pass.

Parameters:
simpleObject - The object to add

removeSimpleObject

void removeSimpleObject(SimpleObject simpleObject)
Add a task to remove the given object. The object will be removed before the next rendering pass.

Parameters:
simpleObject - The object to remove.

clearSimpleObjects

void clearSimpleObjects()
Add a task to remove all objects before the next rendering pass.


getSimpleObjects

java.util.List<SimpleObject> getSimpleObjects()
Returns an immutable list of all SimpleObjects. This list only contains the objects for which an internal representation has already been created. That is, it contains only the objects which have been added before the previous rendering pass.

Returns:
An immutable list of all SimpleObjects.

getSimpleObjectGL

SimpleObjectGL getSimpleObjectGL(SimpleObject simpleObject)
Returns the internal representation of the given object. This internal representation only exists if the object had been added before the previous rendering pass.

Parameters:
simpleObject - The object whose internal representation should be obtained.
Returns:
The internal representation of the given object, or null if the given object is not handled by this renderer.

addPreRenderCallback

void addPreRenderCallback(java.lang.Runnable runnable)
Add the given runnable to the rendering callbacks that will be called before each rendering pass.

Parameters:
runnable - The runnable to add.

removePreRenderCallback

void removePreRenderCallback(java.lang.Runnable runnable)
Remove the given runnable from the rendering callbacks.

Parameters:
runnable - The runnable to remove.

addPostRenderCallback

void addPostRenderCallback(java.lang.Runnable runnable)
Add the given runnable to the rendering callbacks that will be called after each rendering pass.

Parameters:
runnable - The runnable to add.

removePostRenderCallback

void removePostRenderCallback(java.lang.Runnable runnable)
Remove the given runnable from the rendering callbacks.

Parameters:
runnable - The runnable to remove.

invokeLater

void invokeLater(java.lang.Runnable runnable)
Add the given runnable to be executed on the rendering thread before the next rendering pass.

Parameters:
runnable - The runnable to add

getCLContextProperties

long[] getCLContextProperties()
Return the OpenCL context properties for the OpenGL context that is backing this renderer.

Returns:
The OpenCL context properties

getRenderingSemaphore

java.util.concurrent.Semaphore getRenderingSemaphore()
Returns the Semaphore that will be acquired before the rendering, and released after the rendering.

Returns:
The rendering samaphore

acquireBuffer

java.nio.FloatBuffer acquireBuffer(int vbo)
Map the buffer for the specified vertex buffer object

Parameters:
vbo - The VBO identifier
Returns:
The mapped buffer

releaseBuffer

void releaseBuffer(int vbo)
Unmap the buffer for the specified vertex buffer object

Parameters:
vbo - The VBO identifier