commit febb61bad7309735e1822e5e2b55c74bcccff51e
Author: Leszek Koltunski <leszek@distoretedandroid.org>
Date:   Fri Mar 31 14:59:00 2017 +0100

    Still several problems, but the core of Multiblur works now.

diff --git a/src/main/java/org/distorted/examples/multiblur/MultiblurActivity.java b/src/main/java/org/distorted/examples/multiblur/MultiblurActivity.java
index 9285027..02a22e1 100644
--- a/src/main/java/org/distorted/examples/multiblur/MultiblurActivity.java
+++ b/src/main/java/org/distorted/examples/multiblur/MultiblurActivity.java
@@ -22,6 +22,8 @@ package org.distorted.examples.multiblur;
 import android.app.Activity;
 import android.opengl.GLSurfaceView;
 import android.os.Bundle;
+import android.view.View;
+import android.widget.CheckBox;
 import android.widget.SeekBar;
 
 import org.distorted.examples.R;
@@ -101,4 +103,24 @@ public class MultiblurActivity extends Activity implements SeekBar.OnSeekBarChan
     public void onStopTrackingTouch(SeekBar bar)  { }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
+
+  public void onClick(View view)
+    {
+    CheckBox box = (CheckBox)view;
+    int id = box.getId();
+    boolean checked = box.isChecked();
+    MultiblurSurfaceView sView = (MultiblurSurfaceView) this.findViewById(R.id.multiblurSurfaceView);
+
+    switch(id)
+      {
+      case R.id.multiblurCheckBox0  : sView.getRenderer().pressed(0,checked); break;
+      case R.id.multiblurCheckBox1  : sView.getRenderer().pressed(1,checked); break;
+      case R.id.multiblurCheckBox2  : sView.getRenderer().pressed(2,checked); break;
+      case R.id.multiblurCheckBox3  : sView.getRenderer().pressed(3,checked); break;
+      case R.id.multiblurCheckBox4  : sView.getRenderer().pressed(4,checked); break;
+      case R.id.multiblurCheckBox5  : sView.getRenderer().pressed(5,checked); break;
+      case R.id.multiblurCheckBox6  : sView.getRenderer().pressed(6,checked); break;
+      case R.id.multiblurCheckBox7  : sView.getRenderer().pressed(7,checked); break;
+      }
+    }
 }
diff --git a/src/main/java/org/distorted/examples/multiblur/MultiblurRenderer.java b/src/main/java/org/distorted/examples/multiblur/MultiblurRenderer.java
index 39c31ea..79619ef 100644
--- a/src/main/java/org/distorted/examples/multiblur/MultiblurRenderer.java
+++ b/src/main/java/org/distorted/examples/multiblur/MultiblurRenderer.java
@@ -69,6 +69,7 @@ class MultiblurRenderer implements GLSurfaceView.Renderer
     private Static3D[]  mMoveVector;
     private Dynamic3D[] mMoveDynamic;
     private Static1D  mBlurVector;
+    private Dynamic1D  mBlurDynamic;
     private DistortedScreen mScreen;
     private DynamicQuat mQuatInt1, mQuatInt2;
     private int mDistance;
@@ -96,11 +97,11 @@ class MultiblurRenderer implements GLSurfaceView.Renderer
         mMoveDynamic[i].add(mMoveVector[i]);
         }
 
-      Dynamic1D blurDynamic= new Dynamic1D();
+      mBlurDynamic= new Dynamic1D();
       mBlurVector = new Static1D(10);
-      blurDynamic.add(mBlurVector);
+      mBlurDynamic.add(mBlurVector);
 
-      mEffects[0].blur(blurDynamic);
+      mEffects[0].blur(mBlurDynamic);
 
       MeshCubes mesh = new MeshCubes(1,1,false);
 
@@ -221,4 +222,39 @@ class MultiblurRenderer implements GLSurfaceView.Renderer
       mBlurVector.set(range);
       android.util.Log.e("renderer", "range: "+range);
       }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   void pressed(int number, boolean checked)
+     {
+     if( number>=0 && number<=7 && mEffects!=null )
+       {
+       if( checked )
+         {
+         long effectNum = mEffects[number].blur(mBlurDynamic);
+
+         if( effectNum<0 )
+           {
+           android.util.Log.e("renderer", "Error, failed to add BLUR effect, number: "+number );
+           }
+         else
+           {
+           android.util.Log.e("renderer", "Successfully added BLUR effect, number: "+number );
+           }
+         }
+       else
+         {
+         int numAborted = mEffects[number].abortEffects(EffectNames.BLUR);
+
+         if( numAborted!=1 )
+           {
+           android.util.Log.e("renderer", "Error, number: "+number+" unexpected number of effects aborted ("+numAborted+" - should have been 1)" );
+           }
+         }
+       }
+     else
+       {
+       android.util.Log.e("renderer", "Error, number: "+number+" checked: "+checked+" mEffects="+ (mEffects==null ? "null":"not null") );
+       }
+     }
 }
diff --git a/src/main/res/layout/multiblurlayout.xml b/src/main/res/layout/multiblurlayout.xml
index fbcbb4a..dde2b33 100644
--- a/src/main/res/layout/multiblurlayout.xml
+++ b/src/main/res/layout/multiblurlayout.xml
@@ -15,26 +15,103 @@
         android:layout_width="fill_parent"
         android:layout_height="wrap_content"
         android:gravity="center|fill_horizontal"
-        android:orientation="horizontal"
+        android:orientation="vertical"
+        android:background="@color/blue"
         android:paddingBottom="10dp"
         android:paddingTop="10dp" >
 
         <SeekBar
             android:id="@+id/multiblurDistanceSeek"
             android:layout_weight="1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="fill_parent"
+            android:layout_height="0dp"
             android:paddingLeft="10dp"
             android:paddingRight="10dp" />
 
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/linearLayout2"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center|fill_horizontal"
+        android:orientation="vertical"
+        android:background="@color/red"
+        android:paddingBottom="10dp"
+        android:paddingTop="10dp" >
+
         <SeekBar
             android:id="@+id/multiblurRangeSeek"
             android:layout_weight="1"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
+            android:layout_width="fill_parent"
+            android:layout_height="0dp"
             android:paddingLeft="10dp"
             android:paddingRight="10dp" />
 
+        <LinearLayout
+            android:orientation="horizontal"
+            android:layout_width="match_parent"
+            android:layout_height="0dp"
+            android:layout_weight="1">
+
+            <CheckBox
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:id="@+id/multiblurCheckBox0"
+                android:onClick="onClick"
+                android:layout_weight="1"
+                android:checked="true"/>
+            <CheckBox
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:id="@+id/multiblurCheckBox1"
+                android:onClick="onClick"
+                android:layout_weight="1"
+                android:checked="false"/>
+            <CheckBox
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:id="@+id/multiblurCheckBox2"
+                android:onClick="onClick"
+                android:layout_weight="1"
+                android:checked="false"/>
+            <CheckBox
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:id="@+id/multiblurCheckBox3"
+                android:onClick="onClick"
+                android:layout_weight="1"
+                android:checked="false"/>
+             <CheckBox
+                 android:layout_width="wrap_content"
+                 android:layout_height="match_parent"
+                 android:id="@+id/multiblurCheckBox4"
+                 android:onClick="onClick"
+                 android:layout_weight="1"
+                 android:checked="false"/>
+             <CheckBox
+                 android:layout_width="wrap_content"
+                 android:layout_height="match_parent"
+                 android:id="@+id/multiblurCheckBox5"
+                 android:onClick="onClick"
+                 android:layout_weight="1"
+                 android:checked="false"/>
+             <CheckBox
+                 android:layout_width="wrap_content"
+                 android:layout_height="match_parent"
+                 android:id="@+id/multiblurCheckBox6"
+                 android:onClick="onClick"
+                 android:layout_weight="1"
+                 android:checked="false"/>
+             <CheckBox
+                 android:layout_width="wrap_content"
+                 android:layout_height="match_parent"
+                 android:id="@+id/multiblurCheckBox7"
+                 android:onClick="onClick"
+                 android:layout_weight="1"
+                 android:checked="false"/>
+        </LinearLayout>
+
     </LinearLayout>
 
 </LinearLayout>
\ No newline at end of file
