コード例 #1
0
ファイル: Form1.cs プロジェクト: treytomes/DirectCanvas
        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
 private void Button_Click_4(object sender, RoutedEventArgs e)
 {
     if (m_superBlurScene != null)
         m_scene = m_transitionScene;
 }
コード例 #3
0
 private void Button_Click_2(object sender, RoutedEventArgs e)
 {
     if (m_compositorScene != null)
         m_scene = m_compositorScene;
 }
コード例 #4
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     if (m_geometryScene != null)
         m_scene = m_geometryScene;
 }
コード例 #5
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (m_shaderScene != null)
         m_scene = m_shaderScene;
 }
コード例 #6
0
        private void InitDirectCanvas()
        {
            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 WPFPresenter(m_directCanvasFactory,
                                           (int)Width /* Pixel width of our presenter */,
                                           (int)Height /* Pixel height of our presenter */,
                                           wpfImage /* The WPF Image to render to */);
            m_presenter.CurrentScene = m_scene;
            m_presenter.StartRendering();

            m_shaderScene = new PixelShaderScene(m_presenter);
            m_geometryScene = new GeometryScene(m_presenter);
            m_compositorScene = new CompositorScene(m_presenter);
            m_superBlurScene = new SuperBlur(m_presenter);
            m_transitionScene = new TransitionEffectScene(m_presenter);

            m_scene = m_geometryScene;
        }
コード例 #7
0
ファイル: Form1.cs プロジェクト: treytomes/DirectCanvas
 private void button5_Click(object sender, EventArgs e)
 {
     m_currentScene = m_transitionScene;
     
 }
コード例 #8
0
ファイル: Form1.cs プロジェクト: treytomes/DirectCanvas
 private void button4_Click(object sender, EventArgs e)
 {
     m_currentScene = m_superblurScene;
 }
コード例 #9
0
ファイル: Form1.cs プロジェクト: treytomes/DirectCanvas
 private void button3_Click(object sender, EventArgs e)
 {
     m_currentScene = m_geometryScene;
 }
コード例 #10
0
ファイル: Form1.cs プロジェクト: treytomes/DirectCanvas
 private void button2_Click(object sender, EventArgs e)
 {
     m_currentScene = m_shaderScene;
 }
コード例 #11
0
ファイル: Form1.cs プロジェクト: treytomes/DirectCanvas
 private void button1_Click(object sender, EventArgs e)
 {
     m_currentScene = m_compositorScene;
 }