Fixed accelerometer joystick, added on-screen keyboard DPAD acting as a joystick

This commit is contained in:
pelya
2010-10-15 19:41:13 +03:00
parent 11d99e03fb
commit a6dba1278e
9 changed files with 197 additions and 102 deletions

View File

@@ -192,6 +192,7 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer {
System.loadLibrary("application");
System.loadLibrary("sdl_main");
Settings.Apply(context);
accelerometer = new AccelerometerReader(context);
// Tweak video thread priority, if user selected big audio buffer
if(Globals.AudioBufferConfig >= 2)
Thread.currentThread().setPriority( (Thread.NORM_PRIORITY + Thread.MIN_PRIORITY) / 2 ); // Lower than normal
@@ -225,6 +226,7 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer {
public native void nativeGlContextRecreated();
private Activity context = null;
private AccelerometerReader accelerometer = null;
private EGL10 mEgl = null;
private EGLDisplay mEglDisplay = null;
@@ -242,7 +244,6 @@ class DemoGLSurfaceView extends GLSurfaceView_SDL {
mParent = context;
touchInput = DifferentTouchInput.getInstance();
setEGLConfigChooser(Globals.NeedDepthBuffer);
accelerometer = new AccelerometerReader(context);
mRenderer = new DemoRenderer(context);
setRenderer(mRenderer);
}
@@ -292,7 +293,6 @@ class DemoGLSurfaceView extends GLSurfaceView_SDL {
DemoRenderer mRenderer;
Activity mParent;
AccelerometerReader accelerometer = null;
DifferentTouchInput touchInput = null;
public static native void nativeMouse( int x, int y, int action, int pointerId, int pressure, int radius );