de.javagl.swogl
Interface SwoglRenderer

All Superinterfaces:
SwoglComponentHandler

public interface SwoglRenderer
extends SwoglComponentHandler

This interface is a SwoglComponentHandler that additionally allows accessing and rendering the individual SwoglComponents. Instances of classes implementing this interface are part of a SwoglApplication.


Method Summary
 java.util.List<SwoglComponent> getSwoglComponents()
          Returns an immutable list of all SwoglComponents.
 void renderAllSwoglComponents()
          Shortcut for
for (SwoglComponent s : getSwoglComponents()) renderSwoglComponent(s);
 void renderSwoglComponent(SwoglComponent swoglComponent)
          Causes a rendering of the current state of the given SwoglComponent.
 
Methods inherited from interface de.javagl.swogl.SwoglComponentHandler
handleSwoglComponent, releaseSwoglComponent
 

Method Detail

getSwoglComponents

java.util.List<SwoglComponent> getSwoglComponents()
Returns an immutable list of all SwoglComponents. This list also contains the SwoglComponents that have been passed to SwoglComponentHandler.handleSwoglComponent(SwoglComponent) but for which no internal representation has been created yet. The implementation must make sure that when one of the components from this list is passed to the renderSwoglComponent(SwoglComponent) method, the component can actually be rendered.

Returns:
An immutable list of all SwoglComponents.

renderAllSwoglComponents

void renderAllSwoglComponents()
Shortcut for
for (SwoglComponent s : getSwoglComponents()) renderSwoglComponent(s);


renderSwoglComponent

void renderSwoglComponent(SwoglComponent swoglComponent)
Causes a rendering of the current state of the given SwoglComponent.
This method should only be called on the thread that is responsible for rendering and for maintaining the internal representation of the SwoglComponents.
Note that call itself does not necessarily cause the rendering of the specific component, e.g. when the component is internally maintained as a node in a scene graph. But this method should also make sure that that the dirty regions of Texture and the Geometry are updated if necessary. Thus, it should be called for every SwoglComponent that should be rendered, even if the call may only update the internal representation.

Parameters:
swoglComponent - The SwoglComponent to render
Throws:
java.lang.IllegalArgumentException - If the given SwoglComponent is not handled by this class.