MainActivity.cs 924 B

1234567891011121314151617181920212223242526272829303132
  1. using Android.App;
  2. using Android.Content.PM;
  3. using Android.OS;
  4. using Android.Views;
  5. using Microsoft.Xna.Framework;
  6. namespace Graphics3DSample
  7. {
  8. [Activity(
  9. Label = "Graphics3DSample",
  10. MainLauncher = true,
  11. Icon = "@drawable/icon",
  12. AlwaysRetainTaskState = true,
  13. LaunchMode = LaunchMode.SingleInstance,
  14. ScreenOrientation = ScreenOrientation.UserLandscape,
  15. ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize
  16. )]
  17. public class MainActivity : AndroidGameActivity
  18. {
  19. private Graphics3DSampleGame _game;
  20. protected override void OnCreate(Bundle bundle)
  21. {
  22. base.OnCreate(bundle);
  23. _game = new Graphics3DSampleGame();
  24. SetContentView((View)_game.Services.GetService(typeof(View)));
  25. _game.Run();
  26. }
  27. }
  28. }