com.threed.jpct
Class SoftGLRenderer

java.lang.Object
  extended bycom.threed.jpct.SoftGLRenderer
All Implemented Interfaces:
IRenderer, java.io.Serializable

public final class SoftGLRenderer
extends java.lang.Object
implements IRenderer, java.io.Serializable

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.threed.jpct.IRenderer
MODE_LEGACY, MODE_OPENGL, RENDERER_OPENGL, RENDERER_SOFTWARE
 
Method Summary
 void dispose()
          Disposes the renderer and all its resources if it's not used any longer.
 void drawPolygon(VisList visList, int ind, FrameBuffer buffer, World world)
          Draws a polygon.
 void drawStrip(VisList visList, int ind, int length, FrameBuffer buffer, World world)
          Draws a triangle strip.
 void drawVertexArray(VisList visList, int start, int end, FrameBuffer buffer, World world)
          Draws a vertex array.
 void drawWireframe(VisList visList, int ind, int color, FrameBuffer buffer, World world)
          Draws a polygon's wireframe.
 void execute(int mode, java.lang.Object[] params)
          Executes the renderer specific function.
 void finalize()
           
 VideoMode[] getAvailableVideoModes()
          Get all available video modes.
 void init(int x, int y, int cbpp, int zbpp, int samples)
          Initialize the renderer.
 Worker initWorker()
           
 boolean isInitialized()
          Returns true, if the Renderer has been initialized and false otherwise.
 void setPaintListener(IPaintListener listener)
          Sets a listener that will be called before the actual painting starts and after it has finished.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public void init(int x,
                 int y,
                 int cbpp,
                 int zbpp,
                 int samples)
Description copied from interface: IRenderer
Initialize the renderer. This method is called by the FrameBuffer class and there should be no need to call it directly.

Specified by:
init in interface IRenderer
Parameters:
x - the width of the videomode/framebuffer
y - the height of the videomode/framebuffer
cbpp - the minimal colordepth
zbpp - the minimal depthbuffer-depth
samples - the number of samples to take when using multi sampling AA

setPaintListener

public void setPaintListener(IPaintListener listener)
Description copied from interface: IRenderer
Sets a listener that will be called before the actual painting starts and after it has finished.

Specified by:
setPaintListener in interface IRenderer
Parameters:
listener - IPaintListener the listener or null to remove it

dispose

public void dispose()
Description copied from interface: IRenderer
Disposes the renderer and all its resources if it's not used any longer. Will be called automatically if needed...there's no need to call it directly from inside an application.

Specified by:
dispose in interface IRenderer

finalize

public void finalize()

execute

public void execute(int mode,
                    java.lang.Object[] params)
Description copied from interface: IRenderer
Executes the renderer specific function. As usual, there is no need to call this directly so the functions are not documented here.

Specified by:
execute in interface IRenderer
Parameters:
mode - the mode
params - the parameters for this mode

drawStrip

public void drawStrip(VisList visList,
                      int ind,
                      int length,
                      FrameBuffer buffer,
                      World world)
Description copied from interface: IRenderer
Draws a triangle strip. No need to call this method directly.

Specified by:
drawStrip in interface IRenderer
Parameters:
visList - the VisibilityList
ind - the index of the strip
length - the length of the strip
buffer - the current FrameBuffer
world - the current instance of World

initWorker

public Worker initWorker()

drawVertexArray

public void drawVertexArray(VisList visList,
                            int start,
                            int end,
                            FrameBuffer buffer,
                            World world)
Description copied from interface: IRenderer
Draws a vertex array. No need to call this method directly.

Specified by:
drawVertexArray in interface IRenderer
Parameters:
visList - the VisibilityList
start - the index of the first polygon
end - the index of the last polygon
buffer - the current FrameBuffer
world - the current instance of World

drawPolygon

public void drawPolygon(VisList visList,
                        int ind,
                        FrameBuffer buffer,
                        World world)
Description copied from interface: IRenderer
Draws a polygon. No need to call this method directly.

Specified by:
drawPolygon in interface IRenderer
Parameters:
visList - the VisibilityList
ind - the index of the polygon
buffer - the current FrameBuffer
world - the current instance of World

drawWireframe

public void drawWireframe(VisList visList,
                          int ind,
                          int color,
                          FrameBuffer buffer,
                          World world)
Description copied from interface: IRenderer
Draws a polygon's wireframe. No need to call this method directly.

Specified by:
drawWireframe in interface IRenderer
Parameters:
visList - the VisibilityList
ind - the index of the polygon
color - the wireframe's color
buffer - the current FrameBuffer

getAvailableVideoModes

public VideoMode[] getAvailableVideoModes()
Description copied from interface: IRenderer
Get all available video modes. Will be called from the FrameBuffer class when calling getVideoModes(int). For the OpenGL renderer, the returned z-buffer value is NOT what the driver tells but simply the value from Config.glZBufferDepth. The reason for this is, that LWJGL (which is used for the OpenGL binding) doesn't return this value anymore since version 0.6.

Specified by:
getAvailableVideoModes in interface IRenderer
Returns:
the video modes the renderer supports (only valid for OpenGL at the moment, software renderer will return an empty array).
See Also:
FrameBuffer.getVideoModes(int)

isInitialized

public boolean isInitialized()
Description copied from interface: IRenderer
Returns true, if the Renderer has been initialized and false otherwise.

Specified by:
isInitialized in interface IRenderer
Returns:
initialized...or not