commit c840136bf95e5957f4686821b38081c957c5101f
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Wed Dec 8 01:22:51 2021 +0100

    Add info about FPS.

diff --git a/src/main/java/org/distorted/library/main/DistortedScreen.java b/src/main/java/org/distorted/library/main/DistortedScreen.java
index 28cd1b0..84dc688 100644
--- a/src/main/java/org/distorted/library/main/DistortedScreen.java
+++ b/src/main/java/org/distorted/library/main/DistortedScreen.java
@@ -70,6 +70,8 @@ public class DistortedScreen extends DistortedFramebuffer
   private int mToBeBlittedFBO;    // FBO one we have rendered. Then, we keep blitting the one we
   private boolean mFirstCircle;   // rendered FBO_QUEUE_SIZE ago.
 
+  private int mDebugWidth, mDebugHeight, mDebugGap, mDebugTextColor, mDebugBackColor;
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // PUBLIC API
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -119,36 +121,33 @@ public class DistortedScreen extends DistortedFramebuffer
         frameNumber++;
         }
 
-      int width = (int)(mWidth*DEBUG_SCR_FRAC);
-      int height= (int)(mWidth*DEBUG_SCR_FRAC*DEBUG_FRAC);
-
       if( !mDebugAllocated )
-       {
-       mDebugAllocated = true;
-       debugString = "";
-
-       debugBitmap = Bitmap.createBitmap( width, height, Bitmap.Config.ARGB_8888);
-       debugMesh = new MeshQuad();
-       debugTexture = new DistortedTexture();
-       debugTexture.setTexture(debugBitmap);
-       debugCanvas = new Canvas(debugBitmap);
-       debugEffects = new DistortedEffects();
-       debugEffects.apply( new MatrixEffectScale( new Static3D(width,height,1) ) );
-       debugEffects.apply(mMoveEffect);
-
-       mPaint = new Paint();
-       mPaint.setAntiAlias(true);
-       mPaint.setTextAlign(Paint.Align.CENTER);
-       mPaint.setTextSize(0.7f*height);
-       }
-
-      mPaint.setColor(0xffffffff);
-      debugCanvas.drawRect(0, 0, width, height, mPaint);
-      mPaint.setColor(0xff000000);
-      debugCanvas.drawText(debugString, 0.5f*width, 0.75f*height, mPaint);
+        {
+        mDebugAllocated = true;
+        debugString = "";
+
+        debugBitmap = Bitmap.createBitmap( mDebugWidth, mDebugHeight, Bitmap.Config.ARGB_8888);
+        debugMesh = new MeshQuad();
+        debugTexture = new DistortedTexture();
+        debugTexture.setTexture(debugBitmap);
+        debugCanvas = new Canvas(debugBitmap);
+        debugEffects = new DistortedEffects();
+        debugEffects.apply( new MatrixEffectScale( new Static3D(mDebugWidth,mDebugHeight,1) ) );
+        debugEffects.apply(mMoveEffect);
+
+        mPaint = new Paint();
+        mPaint.setAntiAlias(true);
+        mPaint.setTextAlign(Paint.Align.CENTER);
+        mPaint.setTextSize(0.7f*mDebugHeight);
+        }
+
+      mPaint.setColor(mDebugBackColor);
+      debugCanvas.drawRect(0, 0, mDebugWidth, mDebugHeight, mPaint);
+      mPaint.setColor(mDebugTextColor);
+      debugCanvas.drawText(debugString, 0.5f*mDebugWidth, 0.75f*mDebugHeight, mPaint);
       debugTexture.setTexture(debugBitmap);
 
-      mMoveVector.set( (-mWidth+width)*0.5f +5, (mHeight-height)*0.5f -5, 0);
+      mMoveVector.set( (-mWidth+mDebugWidth)*0.5f +mDebugGap, (mHeight-mDebugHeight)*0.5f -mDebugGap, 0);
 
       lastTime = time;
       }
@@ -202,6 +201,29 @@ public class DistortedScreen extends DistortedFramebuffer
  */
   public void showFPS()
     {
+    int width     = (int)(mWidth*DEBUG_SCR_FRAC);
+    int height    = (int)(mWidth*DEBUG_SCR_FRAC*DEBUG_FRAC);
+    int gap       = 5;
+    int textColor = 0xffffffff;
+    int backColor = 0xff000000;
+
+    showFPS(width,height,gap,textColor,backColor);
+    }
+
+///////////////////////////////////////////////////////////////////////////////////////////////////
+/**
+ * Make the library show Frames Per Second in the upper-left corner.
+ * Set appropriate params.
+ * <p>
+ */
+  public void showFPS(int width, int height, int gap, int textColor, int backColor)
+    {
+    mDebugWidth     = width;
+    mDebugHeight    = height;
+    mDebugGap       = gap;
+    mDebugBackColor = backColor;
+    mDebugTextColor = textColor;
+
     if( mDebugMode!=DEBUG_MODE_FPS )
       {
       mDebugMode = DEBUG_MODE_FPS;
