MainBBWIWARG.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Threading;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using bbiwarg.Graphics;
  9. using bbiwarg.InputProviders;
  10. namespace bbiwarg
  11. {
  12. class MainBBIWARG
  13. {
  14. static void Main(string[] args)
  15. {
  16. Console.SetWindowSize(Constants.ConsoleWidth, Constants.ConsoleHeight);
  17. InputProvider inputProvider;
  18. inputProvider = new InputProvider(); // camera
  19. //inputProvider = new VideoInputProvider("..\\..\\videos\\touch\\4.skv"); // video
  20. inputProvider.initialize();
  21. inputProvider.start();
  22. InputHandler inputHandler = new InputHandler(inputProvider);
  23. if (Constants.OutputEnabled)
  24. {
  25. OutputWindow outputWindow = new OutputWindow(inputProvider, inputHandler);
  26. outputWindow.Run(Constants.OutputFrameRate, Constants.OutputFrameRate);
  27. }
  28. else
  29. {
  30. while (true)
  31. {
  32. inputHandler.updateFrame();
  33. Thread.Sleep(1000 / Constants.OutputFrameRate);
  34. }
  35. }
  36. inputProvider.stop();
  37. }
  38. }
  39. }