Ejemplo n.º 1
0
  // Setup
  protected void onCreate(Bundle savedInstanceState) {
    // Log.v("SDL", "onCreate()");
    super.onCreate(savedInstanceState);

    // So we can call stuff from static callbacks
    mSingleton = this;

    // Set up the surface
    mSurface = new SDLSurface(getApplication());
    setContentView(mSurface);
    SurfaceHolder holder = mSurface.getHolder();
    holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
  }
Ejemplo n.º 2
0
 public GLView(Activity context) {
   super(context);
   act = context;
   glView = this;
   initSurface = false;
   initNative = false;
   SurfaceHolder holder = getHolder();
   holder.setType(SurfaceHolder.SURFACE_TYPE_GPU); // needed for Android 1.6
   holder.addCallback(this);
   mEglHelper = new EglHelper();
   mEglHelper.start();
   if (mEglHelper.configHasAlpha) holder.setFormat(PixelFormat.TRANSLUCENT);
   // Log.i(logTag, "set surface type");
   setFocusable(true);
   setFocusableInTouchMode(true);
   setKeepScreenOn(true);
 }