Exemplo n.º 1
0
            public void OneResize()
            {
                CreateDrawer();
                const int         width   = 1000;
                const int         height  = 700;
                DirectXFormDrawer drawer1 = _drawers[0];

                SetFormSize(drawer1, width, height);
                CheckSwapChainSize(drawer1, width, height);
                const double aspectRatio = width / (double)height;

                CheckEqual(aspectRatio, drawer1.AspectRatio);
                CheckEqual(aspectRatio, drawer1._camera.AspectRatio);
            }
Exemplo n.º 2
0
            public void StaticSize()
            {
                CreateDrawer();
                DirectXFormDrawer drawer = _drawers[0];
                var form   = _forms[0];
                int width  = form.ClientSize.Width;
                int height = form.ClientSize.Height;

                CheckSwapChainSize(drawer, width, height);
                double aspectRatio = width / (double)height;

                CheckEqual(aspectRatio, drawer.AspectRatio);
                CheckEqual(aspectRatio, drawer._camera.AspectRatio);
            }
Exemplo n.º 3
0
            public void ResizeTwice()
            {
                CreateDrawer();
                int width  = 1000;
                int height = 700;

                SetFormSize(_drawers[0], width, height);
                CheckSwapChainSize(_drawers[0], width, height);
                double            aspectRatio = width / (double)height;
                DirectXFormDrawer drawer1     = _drawers[0];

                CheckEqual(aspectRatio, drawer1.AspectRatio);
                CheckEqual(aspectRatio, drawer1._camera.AspectRatio);
                width  = 120;
                height = 70;
                SetFormSize(_drawers[0], width, height);
                CheckSwapChainSize(_drawers[0], width, height);
                CheckDeviceSize(_drawers[0], width, height);
                aspectRatio = width / (double)height;
                CheckEqual(aspectRatio, drawer1.AspectRatio);
                CheckEqual(aspectRatio, drawer1._camera.AspectRatio);
            }
Exemplo n.º 4
0
			// ReSharper restore UnusedParameter.Local

			private void SetFormSize(DirectXFormDrawer drawer, int width, int height)
			{
				_forms[_drawers.IndexOf(drawer)].EasyInvoke(x => x.ClientSize = new Size(width, height));
			}
Exemplo n.º 5
0
			private static void CheckSwapChainSize(DirectXFormDrawer drawer, int width, int height)
			{
				Assert.AreEqual(width, drawer._swapChain.PresentParameters.BackBufferWidth);
				Assert.AreEqual(height, drawer._swapChain.PresentParameters.BackBufferHeight);
			}
Exemplo n.º 6
0
			private static void CheckDeviceSize(DirectXFormDrawer drawer, int width, int height)
			{
				Assert.AreEqual(width, drawer._deviceWorker.DeviceSize.Width);
				Assert.AreEqual(height, drawer._deviceWorker.DeviceSize.Height);
			}
Exemplo n.º 7
0
            // ReSharper restore UnusedParameter.Local

            private void SetFormSize(DirectXFormDrawer drawer, int width, int height)
            {
                _forms[_drawers.IndexOf(drawer)].EasyInvoke(x => x.ClientSize = new Size(width, height));
            }
Exemplo n.º 8
0
 private static void CheckSwapChainSize(DirectXFormDrawer drawer, int width, int height)
 {
     Assert.AreEqual(width, drawer._swapChain.PresentParameters.BackBufferWidth);
     Assert.AreEqual(height, drawer._swapChain.PresentParameters.BackBufferHeight);
 }
Exemplo n.º 9
0
 private static void CheckDeviceSize(DirectXFormDrawer drawer, int width, int height)
 {
     Assert.AreEqual(width, drawer._deviceWorker.DeviceSize.Width);
     Assert.AreEqual(height, drawer._deviceWorker.DeviceSize.Height);
 }