commit 758303a33be794c95c206aea742c0a1b311e6b9c
Author: Leszek Koltunski <leszek@distorted.org>
Date:   Mon Nov 7 23:09:47 2016 +0000

    Rename Effects2D to EffectQueue

diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml
index 85d3485..bd8a22f 100644
--- a/src/main/AndroidManifest.xml
+++ b/src/main/AndroidManifest.xml
@@ -27,7 +27,7 @@
         <activity android:name=".movingeffects.MovingEffectsActivity" />    
         <activity android:name=".differenteffects.DifferentEffectsActivity" />    
         <activity android:name=".differentbitmaps.DifferentBitmapsActivity" />    
-        <activity android:name=".effects2d.Effects2DActivity" />
+        <activity android:name=".effectqueue.EffectQueueActivity" />
         <activity android:name=".check.CheckActivity" />    
         <activity android:name=".fbo.FBOActivity" />    
         <activity android:name=".starwars.StarWarsActivity" />      
diff --git a/src/main/java/org/distorted/examples/TableOfContents.java b/src/main/java/org/distorted/examples/TableOfContents.java
index 1d2a284..8485327 100644
--- a/src/main/java/org/distorted/examples/TableOfContents.java
+++ b/src/main/java/org/distorted/examples/TableOfContents.java
@@ -46,7 +46,7 @@ import org.distorted.examples.movingeffects.MovingEffectsActivity;
 import org.distorted.examples.olimpic.OlimpicActivity;
 import org.distorted.examples.differenteffects.DifferentEffectsActivity;
 import org.distorted.examples.differentbitmaps.DifferentBitmapsActivity;
-import org.distorted.examples.effects2d.Effects2DActivity;
+import org.distorted.examples.effectqueue.EffectQueueActivity;
 import org.distorted.examples.check.CheckActivity;
 import org.distorted.examples.bean.BeanActivity;
 import org.distorted.examples.fbo.FBOActivity;
@@ -191,11 +191,11 @@ public class TableOfContents extends ListActivity
    
    {
       final Map<String, Object> item = new HashMap<>();
-      item.put(ITEM_IMAGE, R.drawable.icon_example_effects2d);
-      item.put(ITEM_TITLE, (i+1)+". "+getText(R.string.example_effects2d));
-      item.put(ITEM_SUBTITLE, getText(R.string.example_effects2d_subtitle));
+      item.put(ITEM_IMAGE, R.drawable.icon_example_effectqueue);
+      item.put(ITEM_TITLE, (i+1)+". "+getText(R.string.example_effectqueue));
+      item.put(ITEM_SUBTITLE, getText(R.string.example_effectqueue_subtitle));
       data.add(item);
-      activityMapping.put(i++, Effects2DActivity.class);
+      activityMapping.put(i++, EffectQueueActivity.class);
    }
    
    {
diff --git a/src/main/java/org/distorted/examples/effectqueue/EffectQueueActivity.java b/src/main/java/org/distorted/examples/effectqueue/EffectQueueActivity.java
new file mode 100644
index 0000000..6e98e23
--- /dev/null
+++ b/src/main/java/org/distorted/examples/effectqueue/EffectQueueActivity.java
@@ -0,0 +1,298 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2016 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.examples.effectqueue;
+
+import org.distorted.library.Distorted;
+import org.distorted.examples.R;
+import org.distorted.library.EffectNames;
+import org.distorted.library.EffectTypes;
+
+import android.app.Activity;
+import android.opengl.GLSurfaceView;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Spinner;
+import android.widget.TableLayout;
+import android.widget.TableRow;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public class EffectQueueActivity extends Activity implements AdapterView.OnItemSelectedListener
+  {
+  private Spinner mAdd, mID, mName, mType;
+  private static ArrayAdapter<Long> mAdapterID;
+
+  private int mPosID, mPosName, mPosType;
+  private TableLayout mLayoutList;
+
+  private HashMap<Long,TableRow> mMap = new HashMap<>();
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  @Override
+  protected void onCreate(Bundle savedInstanceState) 
+    {
+    super.onCreate(savedInstanceState);
+ 
+    setContentView(R.layout.effects2dlayout);
+
+    mPosID   = 0;
+    mPosName = 0;
+    mPosType = 0;
+
+    mAdd  = (Spinner)findViewById(R.id.effects2d_spinnerAdd );
+    mID   = (Spinner)findViewById(R.id.effects2d_spinnerID  );
+    mName = (Spinner)findViewById(R.id.effects2d_spinnerName);
+    mType = (Spinner)findViewById(R.id.effects2d_spinnerType);
+
+    mAdd.setOnItemSelectedListener(this);
+    mID.setOnItemSelectedListener(this);
+    mName.setOnItemSelectedListener(this);
+    mType.setOnItemSelectedListener(this);
+
+    ArrayList<Long> itemsID  = new ArrayList<>();
+
+    String[] itemsName = new String[] { getText(R.string.distort   ).toString(),
+                                        getText(R.string.sink      ).toString(),
+                                        getText(R.string.alpha     ).toString(),
+                                        getText(R.string.saturation).toString(),
+                                        getText(R.string.chroma).toString()};
+
+    String[] itemsType = new String[] {"VERTEX", "FRAGMENT"};
+
+
+    mAdapterID = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, itemsID);
+    mAdapterID.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+    mID.setAdapter(mAdapterID);
+
+    ArrayAdapter<String> adapterAdd = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, itemsName);
+    adapterAdd.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+    mAdd.setAdapter(adapterAdd);
+
+    ArrayAdapter<String> adapterName = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, itemsName);
+    adapterName.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+    mName.setAdapter(adapterName);
+
+    ArrayAdapter<String> adapterType = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, itemsType);
+    adapterType.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+    mType.setAdapter(adapterType);
+
+    mLayoutList = (TableLayout)findViewById(R.id.effects2dTableList);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  @Override
+  protected void onResume() 
+    {
+    super.onResume();
+      
+    GLSurfaceView mView = (GLSurfaceView) this.findViewById(R.id.effects2dSurfaceView);
+    mView.onResume();
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  @Override
+  protected void onPause() 
+    {
+    GLSurfaceView mView = (GLSurfaceView) this.findViewById(R.id.effects2dSurfaceView);
+    mView.onPause();
+      
+    super.onPause();
+    }
+    
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  @Override
+  public void onStop()
+    {
+    super.onStop();
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  @Override
+  public void onDestroy()
+    {
+    Distorted.onDestroy();
+    super.onDestroy();
+    }     
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void onItemSelected(AdapterView<?> parent, View view, int pos, long id)
+    {
+    switch(parent.getId())
+      {
+      case R.id.effects2d_spinnerAdd : EffectQueueSurfaceView v = (EffectQueueSurfaceView) this.findViewById(R.id.effects2dSurfaceView);
+                                       v.setEffect(pos); break;
+      case R.id.effects2d_spinnerID  : mPosID   = pos; break;
+      case R.id.effects2d_spinnerName: mPosName = pos; break;
+      case R.id.effects2d_spinnerType: mPosType = pos; break;
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void onNothingSelected(AdapterView<?> parent)
+    {
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void removeByID(View view)
+    {
+    Long currID = (Long)mID.getItemAtPosition(mPosID);
+
+    EffectQueueSurfaceView v = (EffectQueueSurfaceView) this.findViewById(R.id.effects2dSurfaceView);
+    v.getRenderer().mBackground.abortEffect(currID);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void removeByName(View view)
+    {
+    EffectNames name;
+
+    switch(mPosName)
+      {
+      case  0: name = EffectNames.DISTORT      ; break;
+      case  1: name = EffectNames.SINK         ; break;
+      case  2: name = EffectNames.SMOOTH_ALPHA ; break;
+      case  3: name = EffectNames.SATURATION   ; break;
+      case  4: name = EffectNames.SMOOTH_CHROMA; break;
+      default: name = EffectNames.CONTRAST     ;
+      }
+
+    EffectQueueSurfaceView v = (EffectQueueSurfaceView) this.findViewById(R.id.effects2dSurfaceView);
+    v.getRenderer().mBackground.abortEffects(name);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void removeByType(View view)
+    {
+    EffectTypes type;
+
+    switch(mPosType)
+      {
+      case  0: type = EffectTypes.VERTEX  ; break;
+      case  1: type = EffectTypes.FRAGMENT; break;
+      default: type = EffectTypes.MATRIX;
+      }
+
+    EffectQueueSurfaceView v = (EffectQueueSurfaceView) this.findViewById(R.id.effects2dSurfaceView);
+    v.getRenderer().mBackground.abortEffects(type);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void effectAdded(final long id, final EffectNames name, final EffectTypes type)
+    {
+    if( id>=0 )  // we really added a new effect
+      {
+      mAdapterID.add(id);
+      mAdapterID.notifyDataSetChanged();
+
+      TableRow tr = new TableRow(this);
+      tr.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
+
+      TextView b1 = new TextView(this);
+      b1.setText("ID: "+id);
+      b1.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
+      tr.addView(b1);
+
+      TextView b2 = new TextView(this);
+      b2.setText(name.name());
+      b2.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
+      tr.addView(b2);
+
+      TextView b3 = new TextView(this);
+      b3.setText(type.name());
+      b3.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
+      tr.addView(b3);
+
+      TextView b4 = new TextView(this);
+      b4.setText("LIVE");
+      b4.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
+      tr.addView(b4);
+
+      mMap.put(id,tr);
+
+      mLayoutList.addView(tr, new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT));
+      }
+    else // id=-1, i.e. we failed to add new effect due to too many effects already
+      {
+      Toast.makeText(this, R.string.example_effects2d_toast , Toast.LENGTH_LONG).show();
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void effectRemoved(final long id)
+    {
+    runOnUiThread(new Runnable()
+      {
+      public void run()
+        {
+        mAdapterID.remove(id);
+        mAdapterID.notifyDataSetChanged();
+
+        TableRow row = mMap.remove(id);
+
+        if( row!=null )
+          {
+          mLayoutList.removeView(row);
+          }
+        else
+          {
+          android.util.Log.e("EFFECTS2D", "Impossible: id="+id+" not in the map!");
+          }
+        }
+      });
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void effectFinished(final long id)
+    {
+    runOnUiThread(new Runnable()
+      {
+      public void run()
+        {
+        TableRow row = mMap.get(id);
+
+        if( row!=null )
+          {
+          TextView v = (TextView)row.getVirtualChildAt(3);
+          v.setText("FINISHED");
+          }
+        }
+      });
+    }
+  }
diff --git a/src/main/java/org/distorted/examples/effectqueue/EffectQueueRenderer.java b/src/main/java/org/distorted/examples/effectqueue/EffectQueueRenderer.java
new file mode 100644
index 0000000..ee74fa2
--- /dev/null
+++ b/src/main/java/org/distorted/examples/effectqueue/EffectQueueRenderer.java
@@ -0,0 +1,132 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2016 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.examples.effectqueue;
+
+import javax.microedition.khronos.egl.EGLConfig;
+import javax.microedition.khronos.opengles.GL10;
+
+import android.graphics.Bitmap;
+import android.graphics.Canvas;
+import android.graphics.Paint;
+import android.graphics.Paint.Style;
+import android.opengl.GLES20;
+import android.opengl.GLSurfaceView;
+
+import org.distorted.library.DistortedBitmap;
+import org.distorted.library.Distorted;
+import org.distorted.library.EffectNames;
+import org.distorted.library.EffectTypes;
+import org.distorted.library.message.EffectListener;
+import org.distorted.library.message.EffectMessage;
+import org.distorted.library.type.Static3D;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public class EffectQueueRenderer implements GLSurfaceView.Renderer, EffectListener
+  {  
+  private static final int NUMLINES =  10;
+  static final int BWID = 300;
+  static final int BHEI = 400;
+   
+  private EffectQueueSurfaceView mView;
+  private Paint mPaint;
+  private int texWidth, texHeight;
+
+  DistortedBitmap mBackground;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  EffectQueueRenderer(EffectQueueSurfaceView v)
+    {    
+    mPaint = new Paint();
+    mPaint.setAntiAlias(true);
+    mPaint.setFakeBoldText(true);
+    mPaint.setStyle(Style.FILL);
+      
+    mView = v;
+      
+    texWidth = BWID;
+    texHeight= BHEI;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+   
+  public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
+    {      
+    mBackground = new DistortedBitmap(texWidth,texHeight, 80);
+    Bitmap bitmap = Bitmap.createBitmap(texWidth,texHeight, Bitmap.Config.ARGB_8888);
+    Canvas canvas = new Canvas(bitmap);  
+      
+    mPaint.setColor(0xff008800);
+    canvas.drawRect(0, 0, texWidth, texHeight, mPaint);
+    mPaint.setColor(0xffffffff);
+         
+    for(int i=0; i<=NUMLINES ; i++ )
+      {
+      canvas.drawRect(texWidth*i/NUMLINES - 1,                       0,  texWidth*i/NUMLINES + 1,  texHeight               , mPaint);
+      canvas.drawRect(                      0, texHeight*i/NUMLINES -1,  texWidth               ,  texHeight*i/NUMLINES + 1, mPaint);  
+      }
+          
+    mBackground.setBitmap(bitmap);
+    mBackground.addEventListener(this);
+
+    try
+      {
+      Distorted.onSurfaceCreated(mView.getContext());
+      }
+    catch(Exception ex)
+      {
+      android.util.Log.e("Effects2D", ex.getMessage() );
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void onSurfaceChanged(GL10 glUnused, int width, int height)
+    {
+    mBackground.abortEffects(EffectTypes.MATRIX);
+    mBackground.scale( new Static3D((float)width/texWidth,(float)height/texHeight,1) );
+    Distorted.onSurfaceChanged(width,height);
+    mView.setScreenSize(width,height);
+    }
+   
+///////////////////////////////////////////////////////////////////////////////////////////////////
+   
+  public void onDrawFrame(GL10 glUnused)
+    {   
+    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
+    mBackground.draw(System.currentTimeMillis());
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// the library sending messages to us. This is running on a library 'MessageSender' thread.
+
+  public void effectMessage(final EffectMessage em, final long effectID, final EffectNames effectName, final long objectID, final String message)
+    {
+    EffectQueueActivity act = (EffectQueueActivity)mView.getContext();
+
+    switch(em)
+      {
+      case EFFECT_REMOVED : act.effectRemoved(effectID) ; break;
+      case EFFECT_FINISHED: act.effectFinished(effectID); break;
+      default             : break;
+      }
+    }
+  }
diff --git a/src/main/java/org/distorted/examples/effectqueue/EffectQueueSurfaceView.java b/src/main/java/org/distorted/examples/effectqueue/EffectQueueSurfaceView.java
new file mode 100644
index 0000000..63edbb1
--- /dev/null
+++ b/src/main/java/org/distorted/examples/effectqueue/EffectQueueSurfaceView.java
@@ -0,0 +1,172 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Copyright 2016 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.examples.effectqueue;
+
+import android.content.Context;
+import android.opengl.GLSurfaceView;
+import android.os.Build;
+import android.view.MotionEvent;
+import android.util.AttributeSet;
+
+import org.distorted.library.EffectNames;
+import org.distorted.library.EffectTypes;
+import org.distorted.library.type.Dynamic1D;
+import org.distorted.library.type.Static1D;
+import org.distorted.library.type.Static2D;
+import org.distorted.library.type.Static3D;
+import org.distorted.library.type.Static4D;
+import org.distorted.library.type.Dynamic3D;
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+public class EffectQueueSurfaceView extends GLSurfaceView
+  {
+  private EffectQueueRenderer mRenderer;
+  private int mCurrentEffect;
+  private int mScrW, mScrH;
+    
+  private Static4D mRegionV, mRegionF;
+  private Static2D mPoint;
+  private Dynamic1D mInterA, mInterB, mInterC, mInterS;
+  private Dynamic3D mInterD;
+
+  private final static Static3D mRED = new Static3D(1,0,0);
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+  public EffectQueueSurfaceView(Context c, AttributeSet attrs)
+    {
+    super(c, attrs);
+      
+    int duration = 10000;
+    float count  = 1.0f;
+    int h = 30;
+    int r = 20;
+
+    mInterD = new Dynamic3D(duration,count);
+
+    mInterD.add(new Static3D( 0, r, h ));
+    mInterD.add(new Static3D(-r, 0, h ));
+    mInterD.add(new Static3D( 0,-r, h ));
+    mInterD.add(new Static3D( r, 0, h ));
+
+    mInterA = new Dynamic1D(duration,count);
+    mInterA.add(new Static1D(1));
+    mInterA.add(new Static1D(0));
+
+    mInterS = new Dynamic1D(duration,count);
+    mInterS.add(new Static1D(1.0f));
+    mInterS.add(new Static1D(0.3f));
+
+    mInterC = new Dynamic1D(duration,count);
+    mInterC.add(new Static1D(1));
+    mInterC.add(new Static1D(0));
+
+    mInterB = new Dynamic1D(duration,count);
+    mInterB.add(new Static1D(0));
+    mInterB.add(new Static1D(1));
+
+    if(!isInEditMode())
+      {
+      setFocusable(true);
+      setFocusableInTouchMode(true);
+       
+      setEGLContextClientVersion(2);
+        
+      if( Build.FINGERPRINT.startsWith("generic") ) // when running on the emulator, insert a magic line that is
+        {                                           // supposed to cure the 'no config chosen' crash on emulator startup
+        setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
+        }
+        
+      mRenderer = new EffectQueueRenderer(this);
+      setRenderer(mRenderer);
+
+      mPoint  = new Static2D(0,0);
+      mRegionV= new Static4D(0,0,60,60);
+      mRegionF= new Static4D(0,0,60,60);
+        
+      setEffect(0);  
+      }
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  EffectQueueRenderer getRenderer()
+    {
+    return mRenderer;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void setScreenSize(int width, int height)
+    {
+    mScrW = width;
+    mScrH = height;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void setEffect(int effect)
+    {
+    mCurrentEffect = effect;
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+    
+  @Override public boolean onTouchEvent(MotionEvent event) 
+    {
+    int action = event.getAction();
+    int x, y;
+    long id;
+
+    switch(action)
+      {
+      case MotionEvent.ACTION_DOWN: x = (int)event.getX()* mRenderer.BWID/mScrW;
+                                    y = (int)event.getY()* mRenderer.BHEI/mScrH;
+                                    mPoint.set(x,y);
+                                    mRegionF.set(x,y,60,60);
+                                    EffectQueueActivity act = (EffectQueueActivity)getContext();
+
+                                    switch(mCurrentEffect)
+                                      {
+                                      case 0: id = mRenderer.mBackground.distort(mInterD, mPoint, mRegionV);
+                                              act.effectAdded(id, EffectNames.DISTORT, EffectTypes.VERTEX);
+                                              break;
+                                      case 1: id = mRenderer.mBackground.sink(mInterS, mPoint, mRegionV);
+                                              act.effectAdded(id, EffectNames.SINK, EffectTypes.VERTEX);
+                                              break;
+                                      case 2: id = mRenderer.mBackground.alpha(mInterA, mRegionF, true);
+                                              act.effectAdded(id, EffectNames.ALPHA, EffectTypes.FRAGMENT);
+                                              break;
+                                      case 3: id = mRenderer.mBackground.saturation(mInterB, mRegionF, false);
+                                              act.effectAdded(id, EffectNames.SATURATION, EffectTypes.FRAGMENT);
+                                              break;
+                                      case 4: id = mRenderer.mBackground.chroma(mInterC, mRED, mRegionF, true);
+                                              act.effectAdded(id, EffectNames.CHROMA, EffectTypes.FRAGMENT);
+                                              break;
+                                      }
+
+                                    break;
+      }
+
+    return true;
+    }
+
+  }
diff --git a/src/main/java/org/distorted/examples/effects2d/Effects2DActivity.java b/src/main/java/org/distorted/examples/effects2d/Effects2DActivity.java
deleted file mode 100644
index b1120c3..0000000
--- a/src/main/java/org/distorted/examples/effects2d/Effects2DActivity.java
+++ /dev/null
@@ -1,298 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2016 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.examples.effects2d;
-
-import org.distorted.library.Distorted;
-import org.distorted.examples.R;
-import org.distorted.library.EffectNames;
-import org.distorted.library.EffectTypes;
-
-import android.app.Activity;
-import android.opengl.GLSurfaceView;
-import android.os.Bundle;
-import android.view.View;
-import android.widget.AdapterView;
-import android.widget.ArrayAdapter;
-import android.widget.Spinner;
-import android.widget.TableLayout;
-import android.widget.TableRow;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-public class Effects2DActivity extends Activity implements AdapterView.OnItemSelectedListener
-  {
-  private Spinner mAdd, mID, mName, mType;
-  private static ArrayAdapter<Long> mAdapterID;
-
-  private int mPosID, mPosName, mPosType;
-  private TableLayout mLayoutList;
-
-  private HashMap<Long,TableRow> mMap = new HashMap<>();
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  @Override
-  protected void onCreate(Bundle savedInstanceState) 
-    {
-    super.onCreate(savedInstanceState);
- 
-    setContentView(R.layout.effects2dlayout);
-
-    mPosID   = 0;
-    mPosName = 0;
-    mPosType = 0;
-
-    mAdd  = (Spinner)findViewById(R.id.effects2d_spinnerAdd );
-    mID   = (Spinner)findViewById(R.id.effects2d_spinnerID  );
-    mName = (Spinner)findViewById(R.id.effects2d_spinnerName);
-    mType = (Spinner)findViewById(R.id.effects2d_spinnerType);
-
-    mAdd.setOnItemSelectedListener(this);
-    mID.setOnItemSelectedListener(this);
-    mName.setOnItemSelectedListener(this);
-    mType.setOnItemSelectedListener(this);
-
-    ArrayList<Long> itemsID  = new ArrayList<>();
-
-    String[] itemsName = new String[] { getText(R.string.distort   ).toString(),
-                                        getText(R.string.sink      ).toString(),
-                                        getText(R.string.alpha     ).toString(),
-                                        getText(R.string.saturation).toString(),
-                                        getText(R.string.chroma).toString()};
-
-    String[] itemsType = new String[] {"VERTEX", "FRAGMENT"};
-
-
-    mAdapterID = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, itemsID);
-    mAdapterID.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
-    mID.setAdapter(mAdapterID);
-
-    ArrayAdapter<String> adapterAdd = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, itemsName);
-    adapterAdd.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
-    mAdd.setAdapter(adapterAdd);
-
-    ArrayAdapter<String> adapterName = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, itemsName);
-    adapterName.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
-    mName.setAdapter(adapterName);
-
-    ArrayAdapter<String> adapterType = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, itemsType);
-    adapterType.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
-    mType.setAdapter(adapterType);
-
-    mLayoutList = (TableLayout)findViewById(R.id.effects2dTableList);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  @Override
-  protected void onResume() 
-    {
-    super.onResume();
-      
-    GLSurfaceView mView = (GLSurfaceView) this.findViewById(R.id.effects2dSurfaceView);
-    mView.onResume();
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  @Override
-  protected void onPause() 
-    {
-    GLSurfaceView mView = (GLSurfaceView) this.findViewById(R.id.effects2dSurfaceView);
-    mView.onPause();
-      
-    super.onPause();
-    }
-    
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  @Override
-  public void onStop()
-    {
-    super.onStop();
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  @Override
-  public void onDestroy()
-    {
-    Distorted.onDestroy();
-    super.onDestroy();
-    }     
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void onItemSelected(AdapterView<?> parent, View view, int pos, long id)
-    {
-    switch(parent.getId())
-      {
-      case R.id.effects2d_spinnerAdd : Effects2DSurfaceView v = (Effects2DSurfaceView) this.findViewById(R.id.effects2dSurfaceView);
-                                       v.setEffect(pos); break;
-      case R.id.effects2d_spinnerID  : mPosID   = pos; break;
-      case R.id.effects2d_spinnerName: mPosName = pos; break;
-      case R.id.effects2d_spinnerType: mPosType = pos; break;
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void onNothingSelected(AdapterView<?> parent)
-    {
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void removeByID(View view)
-    {
-    Long currID = (Long)mID.getItemAtPosition(mPosID);
-
-    Effects2DSurfaceView v = (Effects2DSurfaceView) this.findViewById(R.id.effects2dSurfaceView);
-    v.getRenderer().mBackground.abortEffect(currID);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void removeByName(View view)
-    {
-    EffectNames name;
-
-    switch(mPosName)
-      {
-      case  0: name = EffectNames.DISTORT      ; break;
-      case  1: name = EffectNames.SINK         ; break;
-      case  2: name = EffectNames.SMOOTH_ALPHA ; break;
-      case  3: name = EffectNames.SATURATION   ; break;
-      case  4: name = EffectNames.SMOOTH_CHROMA; break;
-      default: name = EffectNames.CONTRAST     ;
-      }
-
-    Effects2DSurfaceView v = (Effects2DSurfaceView) this.findViewById(R.id.effects2dSurfaceView);
-    v.getRenderer().mBackground.abortEffects(name);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void removeByType(View view)
-    {
-    EffectTypes type;
-
-    switch(mPosType)
-      {
-      case  0: type = EffectTypes.VERTEX  ; break;
-      case  1: type = EffectTypes.FRAGMENT; break;
-      default: type = EffectTypes.MATRIX;
-      }
-
-    Effects2DSurfaceView v = (Effects2DSurfaceView) this.findViewById(R.id.effects2dSurfaceView);
-    v.getRenderer().mBackground.abortEffects(type);
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void effectAdded(final long id, final EffectNames name, final EffectTypes type)
-    {
-    if( id>=0 )  // we really added a new effect
-      {
-      mAdapterID.add(id);
-      mAdapterID.notifyDataSetChanged();
-
-      TableRow tr = new TableRow(this);
-      tr.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
-
-      TextView b1 = new TextView(this);
-      b1.setText("ID: "+id);
-      b1.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
-      tr.addView(b1);
-
-      TextView b2 = new TextView(this);
-      b2.setText(name.name());
-      b2.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
-      tr.addView(b2);
-
-      TextView b3 = new TextView(this);
-      b3.setText(type.name());
-      b3.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
-      tr.addView(b3);
-
-      TextView b4 = new TextView(this);
-      b4.setText("LIVE");
-      b4.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.WRAP_CONTENT, TableRow.LayoutParams.WRAP_CONTENT));
-      tr.addView(b4);
-
-      mMap.put(id,tr);
-
-      mLayoutList.addView(tr, new TableLayout.LayoutParams(TableLayout.LayoutParams.WRAP_CONTENT, TableLayout.LayoutParams.WRAP_CONTENT));
-      }
-    else // id=-1, i.e. we failed to add new effect due to too many effects already
-      {
-      Toast.makeText(this, R.string.example_effects2d_toast , Toast.LENGTH_LONG).show();
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void effectRemoved(final long id)
-    {
-    runOnUiThread(new Runnable()
-      {
-      public void run()
-        {
-        mAdapterID.remove(id);
-        mAdapterID.notifyDataSetChanged();
-
-        TableRow row = mMap.remove(id);
-
-        if( row!=null )
-          {
-          mLayoutList.removeView(row);
-          }
-        else
-          {
-          android.util.Log.e("EFFECTS2D", "Impossible: id="+id+" not in the map!");
-          }
-        }
-      });
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void effectFinished(final long id)
-    {
-    runOnUiThread(new Runnable()
-      {
-      public void run()
-        {
-        TableRow row = mMap.get(id);
-
-        if( row!=null )
-          {
-          TextView v = (TextView)row.getVirtualChildAt(3);
-          v.setText("FINISHED");
-          }
-        }
-      });
-    }
-  }
diff --git a/src/main/java/org/distorted/examples/effects2d/Effects2DRenderer.java b/src/main/java/org/distorted/examples/effects2d/Effects2DRenderer.java
deleted file mode 100644
index e3c2568..0000000
--- a/src/main/java/org/distorted/examples/effects2d/Effects2DRenderer.java
+++ /dev/null
@@ -1,132 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2016 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.examples.effects2d;
-
-import javax.microedition.khronos.egl.EGLConfig;
-import javax.microedition.khronos.opengles.GL10;
-
-import android.graphics.Bitmap;
-import android.graphics.Canvas;
-import android.graphics.Paint;
-import android.graphics.Paint.Style;
-import android.opengl.GLES20;
-import android.opengl.GLSurfaceView;
-
-import org.distorted.library.DistortedBitmap;
-import org.distorted.library.Distorted;
-import org.distorted.library.EffectNames;
-import org.distorted.library.EffectTypes;
-import org.distorted.library.message.EffectListener;
-import org.distorted.library.message.EffectMessage;
-import org.distorted.library.type.Static3D;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-public class Effects2DRenderer implements GLSurfaceView.Renderer, EffectListener
-  {  
-  private static final int NUMLINES =  10;
-  static final int BWID = 300;
-  static final int BHEI = 400;
-   
-  private Effects2DSurfaceView mView;
-  private Paint mPaint;
-  private int texWidth, texHeight;
-
-  DistortedBitmap mBackground;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  Effects2DRenderer(Effects2DSurfaceView v)
-    {    
-    mPaint = new Paint();
-    mPaint.setAntiAlias(true);
-    mPaint.setFakeBoldText(true);
-    mPaint.setStyle(Style.FILL);
-      
-    mView = v;
-      
-    texWidth = BWID;
-    texHeight= BHEI;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-   
-  public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
-    {      
-    mBackground = new DistortedBitmap(texWidth,texHeight, 80);
-    Bitmap bitmap = Bitmap.createBitmap(texWidth,texHeight, Bitmap.Config.ARGB_8888);
-    Canvas canvas = new Canvas(bitmap);  
-      
-    mPaint.setColor(0xff008800);
-    canvas.drawRect(0, 0, texWidth, texHeight, mPaint);
-    mPaint.setColor(0xffffffff);
-         
-    for(int i=0; i<=NUMLINES ; i++ )
-      {
-      canvas.drawRect(texWidth*i/NUMLINES - 1,                       0,  texWidth*i/NUMLINES + 1,  texHeight               , mPaint);
-      canvas.drawRect(                      0, texHeight*i/NUMLINES -1,  texWidth               ,  texHeight*i/NUMLINES + 1, mPaint);  
-      }
-          
-    mBackground.setBitmap(bitmap);
-    mBackground.addEventListener(this);
-
-    try
-      {
-      Distorted.onSurfaceCreated(mView.getContext());
-      }
-    catch(Exception ex)
-      {
-      android.util.Log.e("Effects2D", ex.getMessage() );
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void onSurfaceChanged(GL10 glUnused, int width, int height)
-    {
-    mBackground.abortEffects(EffectTypes.MATRIX);
-    mBackground.scale( new Static3D((float)width/texWidth,(float)height/texHeight,1) );
-    Distorted.onSurfaceChanged(width,height);
-    mView.setScreenSize(width,height);
-    }
-   
-///////////////////////////////////////////////////////////////////////////////////////////////////
-   
-  public void onDrawFrame(GL10 glUnused)
-    {   
-    GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT | GLES20.GL_DEPTH_BUFFER_BIT);
-    mBackground.draw(System.currentTimeMillis());
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// the library sending messages to us. This is running on a library 'MessageSender' thread.
-
-  public void effectMessage(final EffectMessage em, final long effectID, final EffectNames effectName, final long objectID, final String message)
-    {
-    Effects2DActivity act = (Effects2DActivity)mView.getContext();
-
-    switch(em)
-      {
-      case EFFECT_REMOVED : act.effectRemoved(effectID) ; break;
-      case EFFECT_FINISHED: act.effectFinished(effectID); break;
-      default             : break;
-      }
-    }
-  }
diff --git a/src/main/java/org/distorted/examples/effects2d/Effects2DSurfaceView.java b/src/main/java/org/distorted/examples/effects2d/Effects2DSurfaceView.java
deleted file mode 100644
index 522fded..0000000
--- a/src/main/java/org/distorted/examples/effects2d/Effects2DSurfaceView.java
+++ /dev/null
@@ -1,172 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////////////////////////
-// Copyright 2016 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.examples.effects2d;
-
-import android.content.Context;
-import android.opengl.GLSurfaceView;
-import android.os.Build;
-import android.view.MotionEvent;
-import android.util.AttributeSet;
-
-import org.distorted.library.EffectNames;
-import org.distorted.library.EffectTypes;
-import org.distorted.library.type.Dynamic1D;
-import org.distorted.library.type.Static1D;
-import org.distorted.library.type.Static2D;
-import org.distorted.library.type.Static3D;
-import org.distorted.library.type.Static4D;
-import org.distorted.library.type.Dynamic3D;
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-public class Effects2DSurfaceView extends GLSurfaceView
-  {
-  private Effects2DRenderer mRenderer;
-  private int mCurrentEffect;
-  private int mScrW, mScrH;
-    
-  private Static4D mRegionV, mRegionF;
-  private Static2D mPoint;
-  private Dynamic1D mInterA, mInterB, mInterC, mInterS;
-  private Dynamic3D mInterD;
-
-  private final static Static3D mRED = new Static3D(1,0,0);
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-  public Effects2DSurfaceView(Context c, AttributeSet attrs)
-    {
-    super(c, attrs);
-      
-    int duration = 10000;
-    float count  = 1.0f;
-    int h = 30;
-    int r = 20;
-
-    mInterD = new Dynamic3D(duration,count);
-
-    mInterD.add(new Static3D( 0, r, h ));
-    mInterD.add(new Static3D(-r, 0, h ));
-    mInterD.add(new Static3D( 0,-r, h ));
-    mInterD.add(new Static3D( r, 0, h ));
-
-    mInterA = new Dynamic1D(duration,count);
-    mInterA.add(new Static1D(1));
-    mInterA.add(new Static1D(0));
-
-    mInterS = new Dynamic1D(duration,count);
-    mInterS.add(new Static1D(1.0f));
-    mInterS.add(new Static1D(0.3f));
-
-    mInterC = new Dynamic1D(duration,count);
-    mInterC.add(new Static1D(1));
-    mInterC.add(new Static1D(0));
-
-    mInterB = new Dynamic1D(duration,count);
-    mInterB.add(new Static1D(0));
-    mInterB.add(new Static1D(1));
-
-    if(!isInEditMode())
-      {
-      setFocusable(true);
-      setFocusableInTouchMode(true);
-       
-      setEGLContextClientVersion(2);
-        
-      if( Build.FINGERPRINT.startsWith("generic") ) // when running on the emulator, insert a magic line that is
-        {                                           // supposed to cure the 'no config chosen' crash on emulator startup
-        setEGLConfigChooser(8, 8, 8, 8, 16, 0);   
-        }
-        
-      mRenderer = new Effects2DRenderer(this);
-      setRenderer(mRenderer);
-
-      mPoint  = new Static2D(0,0);
-      mRegionV= new Static4D(0,0,60,60);
-      mRegionF= new Static4D(0,0,60,60);
-        
-      setEffect(0);  
-      }
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  Effects2DRenderer getRenderer()
-    {
-    return mRenderer;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void setScreenSize(int width, int height)
-    {
-    mScrW = width;
-    mScrH = height;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-
-  public void setEffect(int effect)
-    {
-    mCurrentEffect = effect;
-    }
-
-///////////////////////////////////////////////////////////////////////////////////////////////////
-    
-  @Override public boolean onTouchEvent(MotionEvent event) 
-    {
-    int action = event.getAction();
-    int x, y;
-    long id;
-
-    switch(action)
-      {
-      case MotionEvent.ACTION_DOWN: x = (int)event.getX()* mRenderer.BWID/mScrW;
-                                    y = (int)event.getY()* mRenderer.BHEI/mScrH;
-                                    mPoint.set(x,y);
-                                    mRegionF.set(x,y,60,60);
-                                    Effects2DActivity act = (Effects2DActivity)getContext();
-
-                                    switch(mCurrentEffect)
-                                      {
-                                      case 0: id = mRenderer.mBackground.distort(mInterD, mPoint, mRegionV);
-                                              act.effectAdded(id, EffectNames.DISTORT, EffectTypes.VERTEX);
-                                              break;
-                                      case 1: id = mRenderer.mBackground.sink(mInterS, mPoint, mRegionV);
-                                              act.effectAdded(id, EffectNames.SINK, EffectTypes.VERTEX);
-                                              break;
-                                      case 2: id = mRenderer.mBackground.alpha(mInterA, mRegionF, true);
-                                              act.effectAdded(id, EffectNames.ALPHA, EffectTypes.FRAGMENT);
-                                              break;
-                                      case 3: id = mRenderer.mBackground.saturation(mInterB, mRegionF, false);
-                                              act.effectAdded(id, EffectNames.SATURATION, EffectTypes.FRAGMENT);
-                                              break;
-                                      case 4: id = mRenderer.mBackground.chroma(mInterC, mRED, mRegionF, true);
-                                              act.effectAdded(id, EffectNames.CHROMA, EffectTypes.FRAGMENT);
-                                              break;
-                                      }
-
-                                    break;
-      }
-
-    return true;
-    }
-
-  }
diff --git a/src/main/res/drawable-hdpi/icon_example_effectqueue.png b/src/main/res/drawable-hdpi/icon_example_effectqueue.png
new file mode 100644
index 0000000..c3edd62
Binary files /dev/null and b/src/main/res/drawable-hdpi/icon_example_effectqueue.png differ
diff --git a/src/main/res/drawable-hdpi/icon_example_effects2d.png b/src/main/res/drawable-hdpi/icon_example_effects2d.png
deleted file mode 100644
index c3edd62..0000000
Binary files a/src/main/res/drawable-hdpi/icon_example_effects2d.png and /dev/null differ
diff --git a/src/main/res/layout/effects2dlayout.xml b/src/main/res/layout/effects2dlayout.xml
index 5fd165b..b270160 100644
--- a/src/main/res/layout/effects2dlayout.xml
+++ b/src/main/res/layout/effects2dlayout.xml
@@ -4,7 +4,7 @@
     android:layout_height="fill_parent"
     android:orientation="vertical" >
 
-    <org.distorted.examples.effects2d.Effects2DSurfaceView
+    <org.distorted.examples.effectqueue.EffectQueueSurfaceView
         android:id="@+id/effects2dSurfaceView"
         android:layout_width="fill_parent"
         android:layout_height="0dp"
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index 54767d6..f33bdbb 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -82,8 +82,8 @@
     <string name="example_differenteffects_subtitle">See how to draw the same bitmap multiple times, each time with different set of effects applied.</string>
     <string name="example_differentbitmaps">Different Bitmaps</string>  
     <string name="example_differentbitmaps_subtitle">Draw 3 different bitmaps, apply the same set of effects to each one in one go.</string>
-    <string name="example_effects2d">Effects 2D</string>
-    <string name="example_effects2d_subtitle">Add, remove and list all effects currently acting on a Bitmap.</string>
+    <string name="example_effectqueue">Effect Queue</string>
+    <string name="example_effectqueue_subtitle">Add, remove and list all effects currently acting on a Bitmap.</string>
     <string name="example_check">Check</string>  
     <string name="example_check_subtitle">Check the maximum number of effects (separately for vertex and fragment shaders) we can apply to a single bitmap.</string>
     <string name="example_fbo">Bitmap Tree</string>  
