public void Initialize(DeviceManager deviceManager) { _deviceManager = deviceManager; // Remove previous buffer //SafeDispose(ref constantBuffer); // Setup local variables var d3dDevice = deviceManager.DeviceDirect3D; var d3dContext = deviceManager.ContextDirect3D; spriteBatch.Initialize(d3dDevice, d3dContext, 5000); //// Load texture and create sampler using (var bitmap = TextureLoader.LoadBitmap(deviceManager.WICFactory, "Assets\\DotPink.png")) _textureDot = TextureLoader.CreateTexture2DFromBitmap(d3dDevice, bitmap); spriteBatch.AddTexture(_textureDot); using (var bitmap = TextureLoader.LoadBitmap(deviceManager.WICFactory, "Assets\\gold-star.png")) _textureStar = TextureLoader.CreateTexture2DFromBitmap(d3dDevice, bitmap); spriteBatch.AddTexture(_textureStar); GestureService.OnGestureRaised += (o, a) => { CustomGestureArgs gestureArgs = (CustomGestureArgs)a; if (gestureArgs.ManipulationStartedArgs != null) { } else if (gestureArgs.ManipulationInertiaStartingArgs != null) { } else if (gestureArgs.ManipulationUpdatedArgs != null) { } else if (gestureArgs.ManipulationCompletedArgs != null) { } else if (gestureArgs.TappedEventArgs != null) { } else if (gestureArgs.PressedPointerRoutedEventArgs != null) { //spriteBatch.IsEnabled = true; //moveDot(gestureArgs.PressedPointerRoutedEventArgs.GetCurrentPoint(null).Position); } else if (gestureArgs.MovedPointerRoutedEventArgs != null) { //moveDot(gestureArgs.MovedPointerRoutedEventArgs.GetCurrentPoint(null).Position); } else if (gestureArgs.ReleasedPointerRoutedEventArgs != null) { //spriteBatch.IsEnabled = false; //moveDot(gestureArgs.ReleasedPointerRoutedEventArgs.GetCurrentPoint(null).Position); } }; clock = new Stopwatch(); clock.Start(); }