Search in sources :

Example 6 with GL10

use of com.badlogic.gdx.graphics.GL10 in project commons-gdx by gemserk.

the class ImmediateModeRendererUtils method draw.

public static void draw(Triangulator triangulator, float x, float y, float angle, Color color) {
    GL10 gl = Gdx.graphics.getGL10();
    gl.glPushMatrix();
    gl.glTranslatef(x, y, 0f);
    gl.glRotatef(angle, 0f, 0f, 1f);
    ImmediateModeRenderer renderer = getRenderer();
    renderer.begin(getProjectionMatrix(), GL10.GL_TRIANGLES);
    for (int i = 0; i < triangulator.getTriangleCount(); i++) {
        for (int p = 0; p < 3; p++) {
            float[] pt = triangulator.getTrianglePoint(i, p);
            renderer.color(color.r, color.g, color.b, color.a);
            renderer.vertex(pt[0], pt[1], 0f);
        }
    }
    renderer.end();
    gl.glPopMatrix();
}
Also used : ImmediateModeRenderer(com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer) GL10(com.badlogic.gdx.graphics.GL10)

Example 7 with GL10

use of com.badlogic.gdx.graphics.GL10 in project commons-gdx by gemserk.

the class Mesh2dRenderUtils method draw.

public static void draw(int primitiveType, Mesh2d mesh2d, float x, float y, float angle) {
    GL10 gl = Gdx.graphics.getGL10();
    gl.glPushMatrix();
    gl.glTranslatef(x, y, 0f);
    gl.glRotatef(angle, 0f, 0f, 1f);
    draw(primitiveType, mesh2d);
    gl.glPopMatrix();
}
Also used : GL10(com.badlogic.gdx.graphics.GL10)

Aggregations

GL10 (com.badlogic.gdx.graphics.GL10)7 ImmediateModeRenderer (com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer)2 Vector2 (com.badlogic.gdx.math.Vector2)1