Example #1
0
  @Override
  public Engine onLoadEngine() {
    // this.mCamera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
    // return new Engine(new EngineOptions(true, ScreenOrientation.LANDSCAPE, new
    // RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), this.mCamera));
    context = this.getApplicationContext();

    Camera camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
    DisplayMetrics dm = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(dm);

    final EngineOptions options =
        new EngineOptions(
                true,
                ScreenOrientation.LANDSCAPE,
                new RatioResolutionPolicy((float) dm.widthPixels, (float) dm.heightPixels),
                camera)
            .setWakeLockOptions(WakeLockOptions.SCREEN_ON);

    options.getRenderOptions().disableExtensionVertexBufferObjects();

    options.getTouchOptions().setRunOnUpdateThread(true);

    mEngine = new Engine(options);
    return mEngine;
  }