|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.threed.jpct.GLBase com.threed.jpct.AWTGLRenderer
This is the renderer to support hardware acceleration via OpenGL into a
Canvas using the LWJGL.
To be more precise, it renders into an AWTGLCanvas provided by LWJGL.
Therefore, all rendering has to be done in the AWT event dispatch thread.
jPCT itself doesn't care for this thread and works totally independant from
it. To get them both together, this renderer does quite a lot of work to
queue jPCT's rendering commands until the Canvas gets repainted. The
consequence is, that a call to FrameBuffer.display(...) no longer renders the
image when using this renderer but just signals the renderer that the queue
is ready for rendering. The actual rendering of the queued commands is done,
when the Canvas gets repainted.
When using this renderer, it's required to execute the render(...);
draw(...);display(...)-sequence for each frame or in other words: It's not a
good idea to leave out the display(...)-step for a frame, because that will
cause the queue to overflow.
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 buf,
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. |
java.lang.Object |
getLock()
|
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. |
boolean |
isPrewarmTextures()
|
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. |
void |
setPrewarmTextures(boolean prewarmTextures)
|
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 |
public java.lang.Object getLock()
public void init(int x, int y, int cbpp, int zbpp, int samples)
IRenderer
init
in interface IRenderer
x
- the width of the videomode/framebuffery
- the height of the videomode/framebuffercbpp
- the minimal colordepthzbpp
- the minimal depthbuffer-depthsamples
- the number of samples to take when using multi sampling AApublic void dispose()
IRenderer
dispose
in interface IRenderer
public void execute(int mode, java.lang.Object[] params)
IRenderer
execute
in interface IRenderer
mode
- the modeparams
- the parameters for this modepublic void drawStrip(VisList visList, int ind, int length, FrameBuffer buffer, World world)
IRenderer
drawStrip
in interface IRenderer
visList
- the VisibilityListind
- the index of the striplength
- the length of the stripbuffer
- the current FrameBufferworld
- the current instance of Worldpublic void drawPolygon(VisList visList, int ind, FrameBuffer buf, World world)
IRenderer
drawPolygon
in interface IRenderer
visList
- the VisibilityListind
- the index of the polygonbuf
- the current FrameBufferworld
- the current instance of Worldpublic void drawVertexArray(VisList visList, int start, int end, FrameBuffer buffer, World world)
IRenderer
drawVertexArray
in interface IRenderer
visList
- the VisibilityListstart
- the index of the first polygonend
- the index of the last polygonbuffer
- the current FrameBufferworld
- the current instance of Worldpublic void drawWireframe(VisList visList, int ind, int color, FrameBuffer buffer, World world)
IRenderer
drawWireframe
in interface IRenderer
visList
- the VisibilityListind
- the index of the polygoncolor
- the wireframe's colorbuffer
- the current FrameBufferpublic boolean isPrewarmTextures()
public void setPrewarmTextures(boolean prewarmTextures)
public void removeBuffer(int bufferID)
public final void setPaintListener(IPaintListener listener)
public final boolean isInitialized()
public VideoMode[] getAvailableVideoModes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |