From http://www.jwz.org/xscreensaver/xscreensaver-5.31.tar.gz
[xscreensaver] / android / project / xscreensaver / src / org / jwz / xscreensaver / gen / HilbertWallpaper.java
1 package org.jwz.xscreensaver.gen;
2 import javax.microedition.khronos.egl.EGLConfig;
3 import javax.microedition.khronos.opengles.GL10;
4 import net.rbgrn.android.glwallpaperservice.*;
5 import android.opengl.GLU;
6 import android.content.Context;
7 import android.content.SharedPreferences;
8 import org.jwz.xscreensaver.*;
9 public class HilbertWallpaper extends ARenderer {
10     private static native void nativeSettings(String hack, String hackPref, int draw);
11     public static final String SHARED_PREFS_NAME="hilbertsettings";
12     CallNative cn;
13     public void onSurfaceCreated(GL10 gl, EGLConfig config) {
14         super.onSurfaceCreated(gl, config);
15         cn = new CallNative();
16         NonSurfaceCreated();
17     }
18     public void onDrawFrame(GL10 gl) {
19         super.onDrawFrame(gl);
20         nativeSettings("bogus", "bogus", 1);
21         NonDrawFrame();
22     }
23     void NonDrawFrame() {
24         cn.nativeRender();
25     }
26     void doSP(SharedPreferences sspp) {
27         //String hackPref = sspp.getString("hilbert_quad", "75"); // key
28         String hackPref = sspp.getString("hilbert_mode", "3d"); // key
29         String hack = "hilbert";
30         nativeSettings(hack, hackPref, 0);
31     }
32     static
33     {
34         System.loadLibrary ("xscreensaver");
35     }
36 }