commit f203ffa08da06fb5c4fdc56f4ad5be02c2e04b9b
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Wed Mar 30 17:13:37 2022 +0200

    Create the bandaged 3x3 icon: works now.

diff --git a/src/main/java/org/distorted/bandaged/BandagedCreatorRenderer.java b/src/main/java/org/distorted/bandaged/BandagedCreatorRenderer.java
index a5b29b2e..207a47e0 100644
--- a/src/main/java/org/distorted/bandaged/BandagedCreatorRenderer.java
+++ b/src/main/java/org/distorted/bandaged/BandagedCreatorRenderer.java
@@ -57,7 +57,6 @@ public class BandagedCreatorRenderer implements GLSurfaceView.Renderer, Distorte
 {
    public static final float BRIGHTNESS = 0.333f;
    private static final int DURATION = 1000;
-   private static final int FBO_SIZE = 100;
 
    static final int COLOR_DEFAULT = 0xffffff55;
    static final int COLOR_MARKED  = 0xffff0000;
@@ -110,8 +109,6 @@ public class BandagedCreatorRenderer implements GLSurfaceView.Renderer, Distorte
    private DistortedFramebuffer mFramebuffer;
    private String mPath;
 
-private int sW, sH;
-
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
    BandagedCreatorRenderer(BandagedCreatorView v)
@@ -235,8 +232,8 @@ private int sW, sH;
 
      if( mSaveIcon>=0 )
        {
-       if( mSaveIcon==0 ) renderIcon(time);
-       mSaveIcon++;
+       renderIcon(time); // for some reason we need to call render() twice here, otherwise the
+       mSaveIcon++;      // icon turns out black. Probably some problem with binding the texture.
        }
      if( mSaveIcon>=2 )
        {
@@ -265,9 +262,6 @@ private int sW, sH;
           mScreen.attach(node);
           }
 
-sW = width;
-sH = height;
-
       mScale.set( mScaleValue,mScaleValue,mScaleValue );
       mView.setScreenSize(width,height);
       mScreen.resize(width,height);
@@ -445,14 +439,19 @@ sH = height;
 
    private void setupIconCreation(Activity act)
      {
-     TwistyObject object = new TwistyBandagedGeneric(ShapeHexahedron.DEFAULT_ROT, 0.9f, TwistyObject.MODE_ICON);
+     final float R=1.0f;
+     final int FBO_WIDTH  = (int)(R*240);
+     final int FBO_HEIGHT = (int)(R*360);
+     final float OBJECT_SIZE = R*0.38f;
+
+     TwistyObject object = new TwistyBandagedGeneric(ShapeHexahedron.DEFAULT_ROT, OBJECT_SIZE, TwistyObject.MODE_ICON);
      DistortedEffects effects = object.getObjectEffects();
      DistortedNode node = object.getNode();
 
      if( mFramebuffer==null )
        {
-       mFramebuffer = new DistortedFramebuffer(sW,sH,1, InternalOutputSurface.DEPTH_NO_STENCIL);
-       mFramebuffer.glClearColor(BRIGHTNESS, BRIGHTNESS, 0.0f, 1.0f);
+       mFramebuffer = new DistortedFramebuffer(FBO_WIDTH,FBO_HEIGHT,1, InternalOutputSurface.DEPTH_NO_STENCIL);
+       mFramebuffer.glClearColor(BRIGHTNESS, BRIGHTNESS, BRIGHTNESS, 1.0f);
        }
 
      mFramebuffer.detachAll();
