Search in sources :

Example 1 with GL10

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

the class Libgdx2dCameraTransformImpl method apply.

public void apply() {
    GL10 gl = Gdx.gl10;
    gl.glMatrixMode(GL10.GL_PROJECTION);
    gl.glLoadMatrixf(projectionMatrix.val, 0);
    calculateTransform(transform);
    gl.glMatrixMode(GL10.GL_MODELVIEW);
    gl.glLoadMatrixf(transform.val, 0);
}
Also used : GL10(com.badlogic.gdx.graphics.GL10)

Example 2 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, int count, FloatBuffer verticesBuffer, FloatBuffer colorsBuffer) {
    GL10 gl = Gdx.gl10;
    // gl.glPolygonMode(GL10.GL_FRONT_AND_BACK, GL10.GL_LINE);
    gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
    gl.glVertexPointer(3, GL10.GL_FLOAT, 0, verticesBuffer);
    if (colorsBuffer != null) {
        gl.glEnableClientState(GL10.GL_COLOR_ARRAY);
        gl.glColorPointer(4, GL10.GL_FLOAT, 0, colorsBuffer);
    }
    gl.glDrawArrays(primitiveType, 0, count);
    if (colorsBuffer != null) {
        gl.glDisableClientState(GL10.GL_COLOR_ARRAY);
        gl.glColorPointer(4, GL10.GL_FLOAT, 0, colorsBuffer);
    }
}
Also used : GL10(com.badlogic.gdx.graphics.GL10)

Example 3 with GL10

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

the class Libgdx2dCameraTransformImpl method push.

public void push() {
    GL10 gl = Gdx.gl10;
    gl.glMatrixMode(GL10.GL_MODELVIEW);
    gl.glPushMatrix();
    calculateTransform(transform);
    gl.glLoadIdentity();
    gl.glMultMatrixf(transform.val, 0);
}
Also used : GL10(com.badlogic.gdx.graphics.GL10)

Example 4 with GL10

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

the class Libgdx2dCameraTransformImpl method pop.

public void pop() {
    GL10 gl = Gdx.gl10;
    gl.glPopMatrix();
}
Also used : GL10(com.badlogic.gdx.graphics.GL10)

Example 5 with GL10

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

the class ImmediateModeRendererUtils method drawPolygon.

public static void drawPolygon(Vector2[] vertices, 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_LINE_LOOP);
    for (int i = 0; i < vertices.length; i++) {
        Vector2 v = vertices[i];
        renderer.color(color.r, color.g, color.b, color.a);
        renderer.vertex(v.x, v.y, 0);
    }
    renderer.end();
    gl.glPopMatrix();
}
Also used : ImmediateModeRenderer(com.badlogic.gdx.graphics.glutils.ImmediateModeRenderer) GL10(com.badlogic.gdx.graphics.GL10) Vector2(com.badlogic.gdx.math.Vector2)

Aggregations

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