draw Rect with OpenGL - Java 2D Graphics

Java examples for 2D Graphics:Rectangle

Description

draw Rect with OpenGL

Demo Code


import java.util.ArrayList;
import java.util.List;
import javax.microedition.khronos.opengles.GL10;

public class Main{
    public static void drawRect(GL10 gl, float[] rectCoords) {
        gl.glVertexPointer(3, GL10.GL_FLOAT, 0,
                BufferUtil.arr2FloatBuffer(rectCoords));
        gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, rectCoords.length / 3);
    }// w ww .j a v a  2s.c om
}

Related Tutorials