Example usage for com.badlogic.gdx.backends.android AndroidApplicationConfiguration AndroidApplicationConfiguration

List of usage examples for com.badlogic.gdx.backends.android AndroidApplicationConfiguration AndroidApplicationConfiguration

Introduction

In this page you can find the example usage for com.badlogic.gdx.backends.android AndroidApplicationConfiguration AndroidApplicationConfiguration.

Prototype

AndroidApplicationConfiguration

Source Link

Usage

From source file:com.softwaresemantics.diyglsllwp.ShaderGalleryActivity.java

License:Creative Commons License

private void createGDXPreview(String code) {
    cfg = new AndroidApplicationConfiguration();
    cfg.useGL20 = true;//  w w w .ja  v a  2 s  . co m
    cfg.resolutionStrategy = new PreviewResStrategy(this, _200_PX);

    // TODO : settings for preview
    DIYGslSurface.setRenderGuard(true);

    mySurface = new DIYGslSurface(code, true, 4, true, true, true, 4, true, 60, true, 1.0f);
    mySurface.setScreenshotProc(this);

    // impossible to check immediately for GL20 / Surface is created
    // asynchronously we had a callback to get a chance to notify the user
    mySurface.setNativeCallback(this);

    glslView = initializeForView(mySurface, cfg);

    DIYGslSurface.setRenderGuard(false);

    // Add callback for click in preview mode
    mySurface.addClickHandler(this);

    currentFragShaderProgram = code;

    glayout.addView(glslView, 0);
}

From source file:com.softwaresemantics.diyglsllwp.ShaderGalleryActivity.java

License:Creative Commons License

/**
 * setupFullScreenView// w  ww.jav  a 2  s  . c om
 */
public void setupFullScreenView() {

    if (glslView != null) {
        // Remove previously created view
        glayout.removeView(glslView);
    }

    cfg = new AndroidApplicationConfiguration();
    cfg.useGL20 = true;

    // TODO more dynamic layout for this screen
    cfg.resolutionStrategy = new AlmostFSResStrategy(this,
            (int) (2 * FS_BUTTON_HEIGHT * getResources().getDisplayMetrics().density));

    mySurface = new DIYGslSurface(currentFragShaderProgram, prefs.isReductionFactorEnabled(),
            prefs.getReductionFactor(), true, true, prefs.isTimeDithering(), prefs.getTimeDitheringFactor(),
            prefs.getTimeLoopPeriod() != null,
            prefs.getTimeLoopPeriod() != null ? prefs.getTimeLoopPeriod() : 60, prefs.isForceMediumP(),
            prefs.getSpeedFactor());

    glslView = initializeForView(mySurface, cfg);

    cancelButton = new Button(this);
    cancelButton.setHeight(FS_BUTTON_HEIGHT);
    cancelButton.setText(getResources().getString(R.string.cancel));

    setAsLWPButton = new Button(this);
    setAsLWPButton.setHeight(FS_BUTTON_HEIGHT);
    setAsLWPButton.setText(getResources().getString(R.string.setAsLWP));

    setAsLWPButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            ShaderGalleryActivity.this.setAsLWP();
            backToMainView();
        }

    });

    cancelButton.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            backToMainView();
        }

    });

    glayout.removeView(rootMainView);
    glayout.addView(setAsLWPButton);
    glayout.addView(cancelButton);
    glayout.addView(glslView, 0);

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

}

From source file:com.strategames.catchdastars.activities.MainActivity.java

License:Open Source License

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
    cfg.useAccelerometer = true;/*from  www .j a va  2 s  . c om*/
    cfg.useCompass = false;

    CatchDaStars game = new CatchDaStars();
    game.setExporterImporter(this);
    game.setMusicSelector(this);
    initialize(game, cfg);
}

From source file:com.sturdyhelmetgames.roomforchange.MainActivity.java

License:Apache License

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
    cfg.useGL20 = false;/*from  w ww  .  java 2s . c o m*/

    initialize(new RoomForChangeGame(), cfg);
}

From source file:com.subzero.runners.android.AndroidLauncher.java

License:Open Source License

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    //       Create the GameHelper
    _gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
    _gameHelper.enableDebugLog(false);//from  w  w  w .  jav a2  s .c  o m

    GameHelperListener gameHelperListener = new GameHelper.GameHelperListener() {

        @Override
        public void onSignInSucceeded() {
            // TODO Auto-generated method stub

        }

        @Override
        public void onSignInFailed() {
            // TODO Auto-generated method stub

        }
    };

    _gameHelper.setup(gameHelperListener);

    //      signIn();

    Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
    serviceIntent.setPackage("com.android.vending");
    bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
    //      queryPurchases();

    AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
    config.useImmersiveMode = true;
    initialize(new Runners(this), config);
}

From source file:com.theinvader360.racegame.AndroidStarter.java

License:Apache License

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // prevent the screen from dimming/sleeping (no permission required)
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
    cfg.useGL20 = false;//from   w  ww .  j  av a2s .  c o m

    initialize(new RaceGame(), cfg);
}

From source file:com.theosirian.ppioo.android.AndroidLauncher.java

License:Open Source License

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
    initialize(new Puno(), config);
}

From source file:com.torrosoft.sopistan.AndroidLauncher.java

License:Open Source License

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
    initialize(new SopistanMain(), config);
}

From source file:com.torrosoft.triviazo.TriviazoAndroidLauncher.java

License:Open Source License

@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // prevent the screen from dimming/sleeping (no permission required)
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    final AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
    cfg.useGL20 = true;/*from   w w  w . ja v a2s  . c om*/
    cfg.useAccelerometer = false;
    cfg.useCompass = false;

    initialize(new TriviazoGame(new DatabaseAndroid(getBaseContext())), cfg);
}

From source file:com.trgk.touchwave.AndroidLauncher.java

License:Open Source License

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    MessageBox.setImpl(new MessageBoxAndroid(this));
    AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
    initialize(new TouchWave(), config);
}