org.newdawn.slick.opengl.renderer
Class VAOGLRenderer

java.lang.Object
  extended by org.newdawn.slick.opengl.renderer.ImmediateModeOGLRenderer
      extended by org.newdawn.slick.opengl.renderer.VAOGLRenderer
All Implemented Interfaces:
SGL

public class VAOGLRenderer
extends ImmediateModeOGLRenderer

A renderer that caches all operations into an array, creates an opengl vertex array when required and spits the data down to the card in batch mode

Author:
kevin

Field Summary
static int MAX_VERTS
          The maximum number of vertices draw in one batch
static int NONE
          Indicates there is no current geometry buffer
 
Fields inherited from class org.newdawn.slick.opengl.renderer.ImmediateModeOGLRenderer
alphaScale
 
Fields inherited from interface org.newdawn.slick.opengl.renderer.SGL
GL_ALWAYS, GL_BGRA, GL_BLEND, GL_CLAMP, GL_CLIP_PLANE0, GL_CLIP_PLANE1, GL_CLIP_PLANE2, GL_CLIP_PLANE3, GL_COLOR_BUFFER_BIT, GL_COLOR_CLEAR_VALUE, GL_COLOR_SUM_EXT, GL_COMPILE, GL_COMPILE_AND_EXECUTE, GL_DEPTH_BUFFER_BIT, GL_DEPTH_TEST, GL_DST_ALPHA, GL_EQUAL, GL_LINE_SMOOTH, GL_LINE_STRIP, GL_LINE_WIDTH, GL_LINEAR, GL_LINES, GL_MAX_TEXTURE_SIZE, GL_MIRROR_CLAMP_TO_EDGE_EXT, GL_MODELVIEW_MATRIX, GL_MODULATE, GL_NEAREST, GL_NOTEQUAL, GL_ONE, GL_ONE_MINUS_DST_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE_MINUS_SRC_COLOR, GL_POINT_SMOOTH, GL_POINTS, GL_POLYGON_SMOOTH, GL_QUADS, GL_RGB, GL_RGBA, GL_RGBA16, GL_RGBA8, GL_SCISSOR_TEST, GL_SRC_ALPHA, GL_SRC_COLOR, GL_TEXTURE_2D, GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T, GL_TRIANGLE_FAN, GL_TRIANGLES, GL_UNSIGNED_BYTE
 
Constructor Summary
VAOGLRenderer()
           
 
Method Summary
 void flush()
          Flush the current state of the renderer down to GL
 float[] getCurrentColor()
          Get the current colour being rendered
 void glBegin(int geomType)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glBindTexture(int target, int id)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glBlendFunc(int src, int dest)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glCallList(int id)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glClear(int value)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glClipPlane(int plane, java.nio.DoubleBuffer buffer)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glColor4f(float r, float g, float b, float a)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glColorMask(boolean red, boolean green, boolean blue, boolean alpha)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glDisable(int item)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glEnable(int item)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glEnd()
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glEndList()
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glLineWidth(float width)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glLoadMatrix(java.nio.FloatBuffer buffer)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glNewList(int id, int option)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glPointSize(float size)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glPopMatrix()
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glPushMatrix()
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glRotatef(float angle, float x, float y, float z)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glScalef(float x, float y, float z)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glScissor(int x, int y, int width, int height)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glTexCoord2f(float u, float v)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glTexEnvi(int target, int mode, int value)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glTranslatef(float x, float y, float z)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glVertex2f(float x, float y)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void glVertex3f(float x, float y, float z)
          OpenGL Method - @url http://www.opengl.org/documentation/
 void initDisplay(int width, int height)
          Initialise the display
 
Methods inherited from class org.newdawn.slick.opengl.renderer.ImmediateModeOGLRenderer
canSecondaryColor, canTextureMirrorClamp, enterOrtho, glClearColor, glClearDepth, glCopyTexImage2D, glDeleteLists, glDeleteTextures, glDepthFunc, glDepthMask, glGenLists, glGenTextures, glGetError, glGetFloat, glGetInteger, glGetTexImage, glLoadIdentity, glReadPixels, glSecondaryColor3ubEXT, glTexImage2D, glTexParameteri, glTexSubImage2D, setGlobalAlphaScale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
Indicates there is no current geometry buffer

See Also:
Constant Field Values

MAX_VERTS

public static final int MAX_VERTS
The maximum number of vertices draw in one batch

See Also:
Constant Field Values
Constructor Detail

VAOGLRenderer

public VAOGLRenderer()
Method Detail

initDisplay

public void initDisplay(int width,
                        int height)
Description copied from interface: SGL
Initialise the display

Specified by:
initDisplay in interface SGL
Overrides:
initDisplay in class ImmediateModeOGLRenderer
Parameters:
width - The width of the display
height - The height of the display
See Also:
ImmediateModeOGLRenderer.initDisplay(int, int)

flush

public void flush()
Description copied from interface: SGL
Flush the current state of the renderer down to GL

Specified by:
flush in interface SGL
Overrides:
flush in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.flush()

glBegin

public void glBegin(int geomType)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glBegin in interface SGL
Overrides:
glBegin in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glBegin(int)

glColor4f

public void glColor4f(float r,
                      float g,
                      float b,
                      float a)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glColor4f in interface SGL
Overrides:
glColor4f in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glColor4f(float, float, float, float)

glEnd

public void glEnd()
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glEnd in interface SGL
Overrides:
glEnd in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glEnd()

glTexCoord2f

public void glTexCoord2f(float u,
                         float v)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glTexCoord2f in interface SGL
Overrides:
glTexCoord2f in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glTexCoord2f(float, float)

glVertex2f

public void glVertex2f(float x,
                       float y)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glVertex2f in interface SGL
Overrides:
glVertex2f in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glVertex2f(float, float)

glVertex3f

public void glVertex3f(float x,
                       float y,
                       float z)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glVertex3f in interface SGL
Overrides:
glVertex3f in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glVertex3f(float, float, float)

glBindTexture

public void glBindTexture(int target,
                          int id)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glBindTexture in interface SGL
Overrides:
glBindTexture in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glBindTexture(int, int)

glBlendFunc

public void glBlendFunc(int src,
                        int dest)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glBlendFunc in interface SGL
Overrides:
glBlendFunc in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glBlendFunc(int, int)

glCallList

public void glCallList(int id)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glCallList in interface SGL
Overrides:
glCallList in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glCallList(int)

glClear

public void glClear(int value)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glClear in interface SGL
Overrides:
glClear in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glClear(int)

glClipPlane

public void glClipPlane(int plane,
                        java.nio.DoubleBuffer buffer)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glClipPlane in interface SGL
Overrides:
glClipPlane in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glClipPlane(int, java.nio.DoubleBuffer)

glColorMask

public void glColorMask(boolean red,
                        boolean green,
                        boolean blue,
                        boolean alpha)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glColorMask in interface SGL
Overrides:
glColorMask in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glColorMask(boolean, boolean, boolean, boolean)

glDisable

public void glDisable(int item)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glDisable in interface SGL
Overrides:
glDisable in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glDisable(int)

glEnable

public void glEnable(int item)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glEnable in interface SGL
Overrides:
glEnable in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glEnable(int)

glLineWidth

public void glLineWidth(float width)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glLineWidth in interface SGL
Overrides:
glLineWidth in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glLineWidth(float)

glPointSize

public void glPointSize(float size)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glPointSize in interface SGL
Overrides:
glPointSize in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glPointSize(float)

glPopMatrix

public void glPopMatrix()
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glPopMatrix in interface SGL
Overrides:
glPopMatrix in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glPopMatrix()

glPushMatrix

public void glPushMatrix()
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glPushMatrix in interface SGL
Overrides:
glPushMatrix in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glPushMatrix()

glRotatef

public void glRotatef(float angle,
                      float x,
                      float y,
                      float z)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glRotatef in interface SGL
Overrides:
glRotatef in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glRotatef(float, float, float, float)

glScalef

public void glScalef(float x,
                     float y,
                     float z)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glScalef in interface SGL
Overrides:
glScalef in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glScalef(float, float, float)

glScissor

public void glScissor(int x,
                      int y,
                      int width,
                      int height)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glScissor in interface SGL
Overrides:
glScissor in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glScissor(int, int, int, int)

glTexEnvi

public void glTexEnvi(int target,
                      int mode,
                      int value)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glTexEnvi in interface SGL
Overrides:
glTexEnvi in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glTexEnvi(int, int, int)

glTranslatef

public void glTranslatef(float x,
                         float y,
                         float z)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glTranslatef in interface SGL
Overrides:
glTranslatef in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glTranslatef(float, float, float)

glEndList

public void glEndList()
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glEndList in interface SGL
Overrides:
glEndList in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glEndList()

glNewList

public void glNewList(int id,
                      int option)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glNewList in interface SGL
Overrides:
glNewList in class ImmediateModeOGLRenderer
See Also:
ImmediateModeOGLRenderer.glNewList(int, int)

getCurrentColor

public float[] getCurrentColor()
Description copied from interface: SGL
Get the current colour being rendered

Specified by:
getCurrentColor in interface SGL
Overrides:
getCurrentColor in class ImmediateModeOGLRenderer
Returns:
The current colour being rendered
See Also:
SGL.getCurrentColor()

glLoadMatrix

public void glLoadMatrix(java.nio.FloatBuffer buffer)
Description copied from interface: SGL
OpenGL Method - @url http://www.opengl.org/documentation/

Specified by:
glLoadMatrix in interface SGL
Overrides:
glLoadMatrix in class ImmediateModeOGLRenderer
See Also:
SGL.glLoadMatrix(java.nio.FloatBuffer)


Copyright © 2006 New Dawn Software. All Rights Reserved.