示例#1
0
        public Form1()
        {
            InitializeComponent();

            var timer = new Timer();
            timer.Tick += new EventHandler(timer_Tick);
            timer.Interval = 10;
            timer.Start();
            
            panel1.MouseMove += panel1_MouseMove;
            panel1.MouseDown += panel1_MouseDown;
            panel1.MouseUp += panel1_MouseUp;

            /* Create a new DirectCanvasFactory.  This is the root class 
             * where almost all resources are created */
            m_directCanvasFactory = new DirectCanvasFactory();

            /* Create a new WindowsFromsPresenter, passing it our factory 
             * and our Winforms control that we want to render to */
            m_presenter = new WindowsFormsPresenter(m_directCanvasFactory, panel1);

            m_d3dScene = new D3DScene(m_presenter);
            m_currentScene = m_d3dScene;

            _touchHandler = Factory.CreateHandler<Windows7.Multitouch.TouchHandler>(panel1);

            _touchHandler.TouchDown += OnTouchDownHandler;
            _touchHandler.TouchMove += OnTouchMoveHandler;
            _touchHandler.TouchUp += OnTouchUpHandler;
        }
示例#2
0
        public MainForm()
        {
            InitializeComponent();
        
            _touchHandler = Factory.CreateHandler<Windows7.Multitouch.TouchHandler>(this);

            _touchHandler.TouchDown += OnTouchDownHandler;
            _touchHandler.TouchMove += OnTouchMoveHandler;
            _touchHandler.TouchUp += OnTouchUpHandler;

            Paint += new PaintEventHandler(this.OnPaintHandler);
        }