org.xith3d.render.jsr231
Class ShapeAtomPeer

java.lang.Object
  extended by org.xith3d.render.RenderAtomPeer
      extended by org.xith3d.render.jsr231.ShapeAtomPeer

public class ShapeAtomPeer
extends RenderAtomPeer

Renders a single Shape3D.


Field Summary
protected static int CARE_MAP_ALL
           
 
Constructor Summary
ShapeAtomPeer()
           
 
Method Summary
protected static int drawBuffers(javax.media.opengl.GL gl, Geometry geoArray, boolean useIndexVBO, boolean isInDisplayList, boolean isMinVersion13)
          Draws the geometry.
static int getNumTriangles(Geometry geoArray)
           
 int renderAtom(RenderAtom<?> atom, java.lang.Object glObj, RenderPeer renderPeer, OpenGLCapabilities glCaps, View view, RenderOptions options, long nanoTime, long nanoStep, RenderPeer.RenderMode renderMode, long frameId)
          Renders the geometry of the atom.
protected static int renderWithForcedVertexArrays(javax.media.opengl.GL gl, ShapeAtom shapeAtom, int texturesUseMap, Geometry geoArray, CanvasPeer canvasPeer, OpenGLCapabilities glCaps, OpenGLStatesCache statesCache)
           
static void reset()
          Prepares this instance to render the next frame.
static void selectClientTextureUnit(javax.media.opengl.GL gl, int unit, OpenGLStatesCache statesCache, boolean force)
           
protected static void setMatrix(javax.media.opengl.GL gl, View view, Transform3D transform, boolean ignoreRotation, boolean forced)
           
protected static int setStates(javax.media.opengl.GL gl, Geometry geoArray, OpenGLCapabilities glCaps, OpenGLStatesCache statesCache, boolean useTextures, int careMap)
          Sets the states, if the desired ones differ from the cached ones.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CARE_MAP_ALL

protected static final int CARE_MAP_ALL
See Also:
Constant Field Values
Constructor Detail

ShapeAtomPeer

public ShapeAtomPeer()
Method Detail

reset

public static final void reset()
Prepares this instance to render the next frame.


setMatrix

protected static final void setMatrix(javax.media.opengl.GL gl,
                                      View view,
                                      Transform3D transform,
                                      boolean ignoreRotation,
                                      boolean forced)

getNumTriangles

public static final int getNumTriangles(Geometry geoArray)

drawBuffers

protected static final int drawBuffers(javax.media.opengl.GL gl,
                                       Geometry geoArray,
                                       boolean useIndexVBO,
                                       boolean isInDisplayList,
                                       boolean isMinVersion13)
Draws the geometry. At this point the colors and textures and texture coordinates should be set prior to rendering.

Parameters:
gl -
geoArray -
useIndexVBO -
isInDisplayList -
Returns:
the number of rendered triangles

selectClientTextureUnit

public static final void selectClientTextureUnit(javax.media.opengl.GL gl,
                                                 int unit,
                                                 OpenGLStatesCache statesCache,
                                                 boolean force)

setStates

protected static final int setStates(javax.media.opengl.GL gl,
                                     Geometry geoArray,
                                     OpenGLCapabilities glCaps,
                                     OpenGLStatesCache statesCache,
                                     boolean useTextures,
                                     int careMap)
Sets the states, if the desired ones differ from the cached ones.

Parameters:
gl -
geoArray -
glCaps -
statesCache -
useTextures -
careMap -
Returns:
a a bist-maks indicating, which texture units are being used

renderWithForcedVertexArrays

protected static final int renderWithForcedVertexArrays(javax.media.opengl.GL gl,
                                                        ShapeAtom shapeAtom,
                                                        int texturesUseMap,
                                                        Geometry geoArray,
                                                        CanvasPeer canvasPeer,
                                                        OpenGLCapabilities glCaps,
                                                        OpenGLStatesCache statesCache)

renderAtom

public final int renderAtom(RenderAtom<?> atom,
                            java.lang.Object glObj,
                            RenderPeer renderPeer,
                            OpenGLCapabilities glCaps,
                            View view,
                            RenderOptions options,
                            long nanoTime,
                            long nanoStep,
                            RenderPeer.RenderMode renderMode,
                            long frameId)
Renders the geometry of the atom. It is up to the implementation to do this as efficiently as possible.

Specified by:
renderAtom in class RenderAtomPeer
Parameters:
atom - the RenderAtom to render
renderPeer - the RenderPeer to render on
frameId - the current rendered frame's id
Returns:
the number of rendered triangles