package de.frajul.particlelab.main;

import android.content.Context;
import android.opengl.GLSurfaceView;

import de.frajul.particlelab.rendering.GameRenderer;

/**
 * Created by Julian on 30.07.2016.
 */
public class MyGlSurfaceView extends GLSurfaceView {

    private boolean rendererSet;

    public MyGlSurfaceView(Context context, GameRenderer gameRenderer) throws Exception {
        super(context);
        super.setEGLContextClientVersion(2);
        super.setRenderer(gameRenderer);
        rendererSet = true;
    }

    @Override
    public void onResume() {
        GameLog.i("SurfaceView: onResume");
        if (rendererSet)
            super.onResume();
    }

    @Override
    public void onPause() {
        GameLog.i("SurfaceView: onPause");
        if (rendererSet)
            super.onPause();
    }
}
