Пример #1
0
 public WindowsTouch(Window window, ScreenSpace screen)
 {
     var positionTranslator = new CursorPositionTranslater(window, screen);
     touches = new TouchCollection(positionTranslator);
     hook = new TouchHook(window);
     IsAvailable = CheckIfWindows7OrHigher();
 }
Пример #2
0
 private void CheckQuadraticSpaceInLandscape(ScreenSpace screen)
 {
     var quadSize = screen.FromPixelSpace(new Point(0, 0));
     Assert.AreEqual(new Point(0f, 0.2f), quadSize);
     quadSize = screen.FromPixelSpace(new Point(800, 480));
     Assert.AreEqual(new Point(1, 0.8f), quadSize);
 }
Пример #3
0
 private void CheckPixelSpaceInPortrait(ScreenSpace screen)
 {
     var pixelSize = screen.ToPixelSpace(new Point(0.2f, 0));
     Assert.AreEqual(Point.Zero, pixelSize);
     pixelSize = screen.ToPixelSpace(new Point(0.8f, 1));
     Assert.AreEqual(new Point(480, 800), pixelSize);
 }
Пример #4
0
 private void CheckPixelSpaceInLandscape(ScreenSpace screen)
 {
     var pixelSize = screen.ToPixelSpace(new Point(0f, 0.2f));
     Assert.AreEqual(Point.Zero, pixelSize);
     pixelSize = screen.ToPixelSpace(new Point(1, 0.8f));
     Assert.AreEqual(new Point(800, 480), pixelSize);
 }
 public TouchCollectionUpdater(ScreenSpace screen)
 {
     this.screen = screen;
     states = new State[MaxNumberOfTouches];
     locations = new Point[MaxNumberOfTouches];
     ids = new int[MaxNumberOfTouches];
     for (int index = 0; index < MaxNumberOfTouches; index++)
         ids[index] = -1;
 }
 public CursorPositionTranslater(Window window, ScreenSpace screen)
 {
     this.window = window;
     this.screen = screen;
 }
Пример #7
0
 public XnaMockTouch(Window window, ScreenSpace screen)
 {
     TouchPanel.WindowHandle = window.Handle;
     IsAvailable = TouchPanel.GetCapabilities().IsConnected;
     touches = new TouchCollectionUpdater(screen);
 }
Пример #8
0
 private void CheckQuadraticSpaceInPortrait(ScreenSpace screen)
 {
     var quadSize = screen.FromPixelSpace(new Point(0, 0));
     Assert.AreEqual(new Point(0.2f, 0f), quadSize);
     quadSize = screen.FromPixelSpace(new Point(480, 800));
     Assert.AreEqual(new Point(0.8f, 1), quadSize);
 }