MainBBWIWARG.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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);
  27. }
  28. else
  29. {
  30. while (true) {
  31. inputHandler.updateFrame();
  32. Thread.Sleep(1000 / Constants.OutputFrameRate);
  33. }
  34. }
  35. inputProvider.stop();
  36. }
  37. }
  38. }