package xaero.rotatenjump;

import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.content.res.AssetManager;
import android.os.Bundle;
import android.support.annotation.Nullable;

/**
 * Created by xaero on 06/07/2017.
 */

public class MainActivity extends Activity {

    private GameView gameView;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        AssetManager assetManager = getAssets();
        gameView = new GameView(this, assetManager);
        setContentView(gameView);
        setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        //float[] test = {0, 0};
        //Transformations.rotate(0, -0.25f, -2141.55f, test);
        //Transformations.reflect(-1 , -1, 0, -1, test);
        //System.out.println(Arrays.toString(test));
    }

    @Override
    public void onBackPressed() {
        if(!gameView.onBackPressed()) {
            super.onBackPressed();
            System.exit(0);//so that the game doesn't continue without VBOs
        }
    }

    @Override
    public void onPause() {
        super.onPause();
        GameView.instance.onBackPressed();
    }

    /*@Override
    protected void onDestroy() {
        super.onDestroy();
    }*/
}
