예제 #1
0
        public void TestBeginEnd()
        {
            MockedGraphicsDeviceService service = new MockedGraphicsDeviceService();

            using (IDisposable keeper = service.CreateDevice()) {
#if XNA_4
                using (BasicEffect effect = new BasicEffect(service.GraphicsDevice)) {
                    TestEffectDrawContext test = new TestEffectDrawContext(effect);

                    for (int pass = 0; pass < test.Passes; ++pass)
                    {
                        test.Apply(pass);
                    }
                }
#else
                using (EffectPool pool = new EffectPool()) {
                    using (BasicEffect effect = new BasicEffect(service.GraphicsDevice, pool)) {
                        TestEffectDrawContext test = new TestEffectDrawContext(effect);

                        test.Begin();
                        try {
                            for (int pass = 0; pass < test.Passes; ++pass)
                            {
                                test.BeginPass(pass);
                                test.EndPass();
                            }
                        }
                        finally {
                            test.End();
                        }
                    }
                }
#endif
            }
        }
        public void TestBeginEnd()
        {
            MockedGraphicsDeviceService service = new MockedGraphicsDeviceService();

            using (IDisposable keeper = service.CreateDevice()) {
                using (BasicEffect effect = new BasicEffect(service.GraphicsDevice)) {
                    TestEffectDrawContext test = new TestEffectDrawContext(effect);

                    for (int pass = 0; pass < test.Passes; ++pass)
                    {
                        test.Apply(pass);
                    }
                }
            }
        }
    public void TestBeginEnd() {
      MockedGraphicsDeviceService service = new MockedGraphicsDeviceService();
      using(IDisposable keeper = service.CreateDevice()) {
#if XNA_4
        using(BasicEffect effect = new BasicEffect(service.GraphicsDevice)) {
          TestEffectDrawContext test = new TestEffectDrawContext(effect);

          for(int pass = 0; pass < test.Passes; ++pass) {
            test.Apply(pass);
          }
        }
#else
        using(EffectPool pool = new EffectPool()) {
          using(BasicEffect effect = new BasicEffect(service.GraphicsDevice, pool)) {
            TestEffectDrawContext test = new TestEffectDrawContext(effect);

            test.Begin();
            try {
              for(int pass = 0; pass < test.Passes; ++pass) {
                test.BeginPass(pass);
                test.EndPass();
              }
            }
            finally {
              test.End();
            }
          }
        }
#endif
      }
    }