@ -8,6 +8,7 @@ import android.content.DialogInterface;
import android.content.pm.ActivityInfo ;
import android.content.pm.ActivityInfo ;
import android.opengl.GLSurfaceView ;
import android.opengl.GLSurfaceView ;
import android.os.Bundle ;
import android.os.Bundle ;
import android.view.Display ;
import android.view.SurfaceView ;
import android.view.SurfaceView ;
import android.view.View ;
import android.view.View ;
import android.view.Window ;
import android.view.Window ;
@ -56,7 +57,17 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
* /
* /
protected boolean eglConfigVerboseLogging = false ;
protected boolean eglConfigVerboseLogging = false ;
/ * *
* If true MouseEvents are generated from TouchEvents
* /
protected boolean mouseEventsEnabled = true ;
protected boolean mouseEventsEnabled = true ;
/ * *
* Flip X axis
* /
protected boolean mouseEventsInvertX = true ;
/ * *
* Flip Y axis
* /
protected boolean mouseEventsInvertY = true ;
protected boolean mouseEventsInvertY = true ;
/ * *
/ * *
@ -102,9 +113,12 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
setRequestedOrientation ( screenOrientation ) ;
setRequestedOrientation ( screenOrientation ) ;
// Create Settings
AppSettings settings = new AppSettings ( true ) ;
AppSettings settings = new AppSettings ( true ) ;
AndroidInput input = new AndroidInput ( this ) ;
// Create the input class
AndroidInput input = new AndroidInput ( this ) ;
input . setMouseEventsInvertX ( mouseEventsInvertX ) ;
input . setMouseEventsInvertY ( mouseEventsInvertY ) ;
input . setMouseEventsInvertY ( mouseEventsInvertY ) ;
input . setMouseEventsEnabled ( mouseEventsEnabled ) ;
input . setMouseEventsEnabled ( mouseEventsEnabled ) ;
@ -123,12 +137,23 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
ctx = ( OGLESContext ) app . getContext ( ) ;
ctx = ( OGLESContext ) app . getContext ( ) ;
view = ctx . createView ( input , eglConfigType , eglConfigVerboseLogging ) ;
view = ctx . createView ( input , eglConfigType , eglConfigVerboseLogging ) ;
setContentView ( view ) ;
setContentView ( view ) ;
// Set the screen reolution
WindowManager wind = this . getWindowManager ( ) ;
Display disp = wind . getDefaultDisplay ( ) ;
ctx . getSettings ( ) . setResolution ( disp . getWidth ( ) , disp . getHeight ( ) ) ;
AppSettings s = ctx . getSettings ( ) ;
logger . info ( "Settings: Width " + s . getWidth ( ) + " Height " + s . getHeight ( ) ) ;
}
}
catch ( Exception ex )
catch ( Exception ex )
{
{
handleError ( "Class " + appClass + " init failed" , ex ) ;
handleError ( "Class " + appClass + " init failed" , ex ) ;
setContentView ( new TextView ( this ) ) ;
setContentView ( new TextView ( this ) ) ;
}
}
}
}