com.badlogic.gdx.graphics.glutils
Class ImmediateModeRenderer10

java.lang.Object
  extended by com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer10
All Implemented Interfaces:
ImmediateModeRenderer

public class ImmediateModeRenderer10
extends Object
implements ImmediateModeRenderer

An ImmediateModeRenderer allows you to perform immediate mode rendering as you were accustomed to in your desktop OpenGL environment. In order to draw something you first have to call begin(int) with the primitive type you want to render. Next you specify as many vertices as you want by first defining the vertex color, normal and texture coordinates followed by the vertex position which finalizes the definition of a single vertex. When you are done specifying the geometry you have to call end() to make the renderer render the geometry. Internally the renderer uses vertex arrays to render the provided geometry. This is not the best performing way to do this so use this class only for non performance critical low vertex count geometries while debugging. Note that this class of course only works with OpenGL ES 1.x.

Author:
mzechner

Constructor Summary
ImmediateModeRenderer10()
          Constructs a new ImmediateModeRenderer
ImmediateModeRenderer10(int maxVertices)
          Constructs a new ImmediateModeRenderer
 
Method Summary
 void begin(int primitiveType)
          Starts a new list of primitives.
 void begin(Matrix4 projModelView, int primitiveType)
           
 void color(float r, float g, float b, float a)
          Specifies the color of the current vertex
 void dispose()
           
 void end()
          Renders the primitives just defined.
 int getMaxVertices()
           
 int getNumVertices()
           
 void normal(float x, float y, float z)
          Specifies the normal of the current vertex
 void texCoord(float u, float v)
          Specifies the texture coordinates of the current vertex
 void vertex(float x, float y, float z)
          Specifies the position of the current vertex and finalizes it.
 void vertex(Vector3 point)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImmediateModeRenderer10

public ImmediateModeRenderer10()
Constructs a new ImmediateModeRenderer


ImmediateModeRenderer10

public ImmediateModeRenderer10(int maxVertices)
Constructs a new ImmediateModeRenderer

Method Detail

begin

public void begin(Matrix4 projModelView,
                  int primitiveType)
Specified by:
begin in interface ImmediateModeRenderer

begin

public void begin(int primitiveType)
Starts a new list of primitives. The primitiveType specifies which primitives to draw. Can be any of GL10.GL_TRIANGLES, GL10.GL_LINES and so on. A maximum of 6000 vertices can be drawn at once.

Parameters:
primitiveType - the primitive type.

color

public void color(float r,
                  float g,
                  float b,
                  float a)
Specifies the color of the current vertex

Specified by:
color in interface ImmediateModeRenderer
Parameters:
r - the red component
g - the green component
b - the blue component
a - the alpha component

normal

public void normal(float x,
                   float y,
                   float z)
Specifies the normal of the current vertex

Specified by:
normal in interface ImmediateModeRenderer
Parameters:
x - the x component
y - the y component
z - the z component

texCoord

public void texCoord(float u,
                     float v)
Specifies the texture coordinates of the current vertex

Specified by:
texCoord in interface ImmediateModeRenderer
Parameters:
u - the u coordinate
v - the v coordinate

vertex

public void vertex(float x,
                   float y,
                   float z)
Specifies the position of the current vertex and finalizes it. After a call to this method you will effectively define a new vertex afterwards.

Specified by:
vertex in interface ImmediateModeRenderer
Parameters:
x - the x component
y - the y component
z - the z component

getNumVertices

public int getNumVertices()
Specified by:
getNumVertices in interface ImmediateModeRenderer

getMaxVertices

public int getMaxVertices()
Specified by:
getMaxVertices in interface ImmediateModeRenderer

end

public void end()
Renders the primitives just defined.

Specified by:
end in interface ImmediateModeRenderer

vertex

public void vertex(Vector3 point)

dispose

public void dispose()
Specified by:
dispose in interface ImmediateModeRenderer


Copyright © 2013. All Rights Reserved.