package com.rabenauge.gl;

import android.opengl.GLU;
import java.nio.FloatBuffer;
import javax.microedition.khronos.opengles.GL10;

/*
 * A class for various static helper methods.
 */
public class Helper {
    // Vertices and texture coordinates for rendering a bitmap in order LR, LL, UL, UR.
    private static final float w=1, h=1;
    private static final FloatBuffer v=FloatBuffer.allocate(8).put(w).put(h).put(0).put(h).put(0).put(0).put(w).put(0);

    public static void drawScreenSpaceTexture(Texture2D tex) {
        tex.makeCurrent();

        tex.gl.glMatrixMode(GL10.GL_PROJECTION);
        tex.gl.glLoadIdentity();
        GLU.gluOrtho2D(tex.gl, 0, w, h, 0);

        tex.gl.glVertexPointer(2, GL10.GL_FLOAT, 0, v);
        tex.gl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, v);

        tex.gl.glDrawArrays(GL10.GL_TRIANGLE_FAN, 0, 4);
    }

    public static void toggleState(GL10 gl, int cap, boolean state) {
        if (state) {
            gl.glEnable(cap);
        }
        else {
            gl.glDisable(cap);
        }
    }
}

@@ -507,76 +507,33 @@
 pace
-Texture(Texture2D tex) %7B%0D%0A        tex.makeCurrent();%0D%0A%0D%0A        tex.
+Quad(GL10 gl) %7B%0D%0A        
 gl.g
@@ -570,28 +570,24 @@
 );%0D%0A        
-tex.
 gl.glLoadIde
@@ -619,20 +619,16 @@
 Ortho2D(
-tex.
 gl, 0, w
@@ -643,28 +643,24 @@
 %0D%0A%0D%0A        
-tex.
 gl.glVertexP
@@ -688,24 +688,179 @@
 AT, 0, v);%0D%0A
+        gl.glDrawArrays(GL10.GL_TRIANGLE_FAN, 0, 4);%0D%0A    %7D%0D%0A%0D%0A    public static void drawScreenSpaceTexture(Texture2D tex) %7B%0D%0A        tex.makeCurrent();%0D%0A
         tex.
@@ -920,54 +920,34 @@
     
-tex.gl.glDrawArrays(GL10.GL_TRIANGLE_FAN, 0, 4
+drawScreenSpaceQuad(tex.gl
 );%0D%0A

Add a method to draw a screen space aligned (untextured) quad