internal void InternalDeviceReady(ExEnAndroidSurfaceView gameView, int width, int height, ExEnInterfaceOrientation orientation) { Point size = new Point(width, height); if(GraphicsDevice == null) { GraphicsDevice = new GraphicsDevice(new ExEnScaler(orientation, size, size)); OnDeviceCreated(this, EventArgs.Empty); } else { // NOTE: Should the graphics device scaler be updated here? } }
internal void StartGame(ExEnAndroidActivity activity) { if(activity.surface != null) throw new InvalidOperationException("Game has already been started"); this.activity = activity; // Note: If the handling of the graphics device gets more complicated, // this may have to be split into functions around what needs to be done before, // during and after graphics device creation: ApplyChanges(); // Create the game's view: surfaceView = new ExEnAndroidSurfaceView(game, this, activity); activity.surface = surfaceView; // Start the game running in the rendering thread surfaceView.StartGame(); // Now that Game has started, make the view visible: activity.SetContentView(surfaceView); // Return outwards to the activity's OnCreate method... }