Program.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #if WINDOWS
  2. using System;
  3. namespace SoundTest
  4. {
  5. static class Program
  6. {
  7. /// <summary>
  8. /// The main entry point for the application.
  9. /// </summary>
  10. static void Main(string[] args)
  11. {
  12. using (Game1 game = new Game1())
  13. {
  14. game.Run();
  15. }
  16. }
  17. }
  18. }
  19. #elif MACOS
  20. using MonoMac.AppKit;
  21. using MonoMac.Foundation;
  22. using MonoMac.CoreGraphics;
  23. using System.Runtime.InteropServices;
  24. namespace SoundTest
  25. {
  26. class Program
  27. {
  28. static void Main (string [] args)
  29. {
  30. NSApplication.Init ();
  31. using (var p = new NSAutoreleasePool ()) {
  32. NSApplication.SharedApplication.Delegate = new AppDelegate();
  33. NSApplication.Main(args);
  34. }
  35. }
  36. }
  37. class AppDelegate : NSApplicationDelegate
  38. {
  39. Game1 game;
  40. public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
  41. {
  42. game = new Game1();
  43. game.Run();
  44. }
  45. public override bool ApplicationShouldTerminateAfterLastWindowClosed (NSApplication sender)
  46. {
  47. return true;
  48. }
  49. }
  50. }
  51. #endif