commit e1e94682ff0b647fa269444447ea120b334d73b9
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Mon Dec 17 00:01:32 2018 +0000

    New MeshQuad class.

diff --git a/src/main/java/org/distorted/library/main/DistortedScreen.java b/src/main/java/org/distorted/library/main/DistortedScreen.java
index 0dceac6..423580e 100644
--- a/src/main/java/org/distorted/library/main/DistortedScreen.java
+++ b/src/main/java/org/distorted/library/main/DistortedScreen.java
@@ -27,8 +27,7 @@ import android.graphics.Paint;
 import android.opengl.GLES31;
 
 import org.distorted.library.effect.MatrixEffectMove;
-import org.distorted.library.mesh.MeshBase;
-import org.distorted.library.mesh.MeshFlat;
+import org.distorted.library.mesh.MeshQuad;
 import org.distorted.library.type.Static3D;
 
 /**
@@ -43,7 +42,7 @@ public class DistortedScreen extends DistortedFramebuffer
 
   private static final int NUM_FRAMES  = 100;
 
-  private MeshBase fpsMesh;
+  private MeshQuad fpsMesh;
   private DistortedTexture fpsTexture;
   private DistortedEffects fpsEffects;
   private Canvas fpsCanvas;
@@ -162,7 +161,7 @@ public class DistortedScreen extends DistortedFramebuffer
 
       fpsString = "";
       fpsBitmap = Bitmap.createBitmap(fpsW, fpsH, Bitmap.Config.ARGB_8888);
-      fpsMesh = new MeshFlat(1, 1);
+      fpsMesh = new MeshQuad();
       fpsTexture = new DistortedTexture(fpsW, fpsH);
       fpsTexture.setTexture(fpsBitmap);
       fpsCanvas = new Canvas(fpsBitmap);
diff --git a/src/main/java/org/distorted/library/mesh/MeshQuad.java b/src/main/java/org/distorted/library/mesh/MeshQuad.java
new file mode 100644
index 0000000..90294d2
--- /dev/null
+++ b/src/main/java/org/distorted/library/mesh/MeshQuad.java
@@ -0,0 +1,70 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2018 Leszek Koltunski                                                               //
+//                                                                                               //
+// This file is part of Distorted.                                                               //
+//                                                                                               //
+// Distorted is free software: you can redistribute it and/or modify                             //
+// it under the terms of the GNU General Public License as published by                          //
+// the Free Software Foundation, either version 2 of the License, or                             //
+// (at your option) any later version.                                                           //
+//                                                                                               //
+// Distorted is distributed in the hope that it will be useful,                                  //
+// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
+// GNU General Public License for more details.                                                  //
+//                                                                                               //
+// You should have received a copy of the GNU General Public License                             //
+// along with Distorted.  If not, see <http://www.gnu.org/licenses/>.                            //
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+package org.distorted.library.mesh;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+/**
+ * Create a quad, i.e. two triangles with vertices at (+-0.5,+-0.5).
+ * <p>
+ * Mainly to have a simple example showing how to create a Mesh; otherwise a MeshQuad can be perfectly
+ * emulated by a MeshFlat(1,1) or a MeshCubes(1,1,0).
+ */
+public class MeshQuad extends MeshBase
+  {
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  private void addVertex(int vertex, float x, float y, float[] attribs)
+    {
+    attribs[VERT_ATTRIBS*vertex + POS_ATTRIB  ] = x-0.5f;
+    attribs[VERT_ATTRIBS*vertex + POS_ATTRIB+1] = 0.5f-y;
+    attribs[VERT_ATTRIBS*vertex + POS_ATTRIB+2] = 0.0f;
+
+    attribs[VERT_ATTRIBS*vertex + NOR_ATTRIB  ] = 0.0f;
+    attribs[VERT_ATTRIBS*vertex + NOR_ATTRIB+1] = 0.0f;
+    attribs[VERT_ATTRIBS*vertex + NOR_ATTRIB+2] = 1.0f;
+
+    attribs[VERT_ATTRIBS*vertex + INF_ATTRIB  ] = (x-0.5f);
+    attribs[VERT_ATTRIBS*vertex + INF_ATTRIB+1] = (0.5f-y);
+    attribs[VERT_ATTRIBS*vertex + INF_ATTRIB+2] = 0.01f   ;  // Inflated surface needs to be slightly in front
+
+    attribs[VERT_ATTRIBS*vertex + TEX_ATTRIB  ] = x;
+    attribs[VERT_ATTRIBS*vertex + TEX_ATTRIB+1] = 1.0f-y;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// PUBLIC API
+///////////////////////////////////////////////////////////////////////////////////////////////////
+  /**
+   * Creates the underlying grid of 4 vertices, normals, inflates and texture coords.
+   */
+  public MeshQuad()
+    {
+    super(0.0f);
+
+    float[] attribs= new float[VERT_ATTRIBS*4];
+
+    addVertex(0, 0.0f,0.0f, attribs);
+    addVertex(1, 0.0f,1.0f, attribs);
+    addVertex(2, 1.0f,0.0f, attribs);
+    addVertex(3, 1.0f,1.0f, attribs);
+
+    setAttribs(attribs);
+    }
+  }
\ No newline at end of file
