com.threed.jpct
Class GLRenderer

java.lang.Object
  extended bycom.threed.jpct.GLBase
      extended bycom.threed.jpct.GLRenderer
All Implemented Interfaces:
IRenderer

public final class GLRenderer
extends com.threed.jpct.GLBase
implements IRenderer

This is the renderer to support hardware acceleration via OpenGL using the LWJGL.
All available parameters in the Config-class for configuring this renderer are marked with the prefix "gl".


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.
 VideoMode[] getAvailableVideoModes()
          Get all available video modes.
 void init(int x, int y, int cbpp, int zbpp, int samples)
          Initialize the renderer.
 boolean isInitialized()
          Returns true, if the Renderer has been initialized and false otherwise.
 void removeBuffer(int bufferID)
           
 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
 
Methods inherited from interface com.threed.jpct.IRenderer
getAvailableVideoModes, isInitialized, setPaintListener
 

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

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

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

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

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

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

removeBuffer

public void removeBuffer(int bufferID)

setPaintListener

public final void setPaintListener(IPaintListener listener)

isInitialized

public final boolean isInitialized()

getAvailableVideoModes

public VideoMode[] getAvailableVideoModes()