示例#1
0
        public void RenderSystem_RenderFail_Test()
        {
            var rs = new RenderSystem(Device, SpriteRenderer);

            Assert.IsTrue(
                TestHelpers.CatchException(typeof(ArgumentNullException),
                () => rs.Render(rs.PrimaryRenderTarget, null, null, null, new Light(), false)));
            Assert.IsTrue(
                TestHelpers.CatchException(typeof(ArgumentNullException),
                () => rs.Render(rs.PrimaryRenderTarget, null, null, new Camera(), null, false)));
        }
示例#2
0
        public void RenderSystem_Render_Test()
        {
            var rs = new RenderSystem(Device, SpriteRenderer);

            var renderable = TestHelpers.CreateRenderableMock(Device);
            int numRenderCalled = 0;
            renderable.RenderCalled += ((o, e) => ++numRenderCalled);
            var renderables = new List<IRenderable>() { renderable };

            var sprite = TestHelpers.CreateSpriteMock(Device);
            sprite.RenderCalled += ((o, e) => ++numRenderCalled);
            var sprites = new List<ISprite>() { sprite };

            Assert.IsTrue(rs.Render(rs.PrimaryRenderTarget, renderables, sprites, new Camera(), new Light(), false));
            Assert.AreEqual(2, numRenderCalled);
            Assert.AreEqual(0.0f, rs.PrimaryRenderTarget.LastFps);
        }
示例#3
0
 public bool Render(RenderSystem renderSystem, IRenderTarget renderTarget, bool present)
 {
     return renderSystem.Render(renderTarget, renderables, sprites, Camera, Light, present);
 }