Example #1
0
        protected override void Initialize(AppConfiguration appConfiguration)
        {
            base.Initialize(appConfiguration);

            RenderTarget2D.AntialiasMode = AntialiasMode.Aliased;

            AddObjects();
        }
Example #2
0
        protected override void Initialize(AppConfiguration appConfiguration)
        {
            base.Initialize(appConfiguration);
            Factory2D = new Factory();
            using (var surface = BackBuffer.QueryInterface<Surface>())
            {
                RenderTarget2D = new RenderTarget(Factory2D, surface, new RenderTargetProperties(new PixelFormat(Format.Unknown, AlphaMode.Premultiplied)));
            }
            RenderTarget2D.AntialiasMode = AntialiasMode.PerPrimitive;

            FactoryDWrite = new SharpDX.DirectWrite.Factory();

            SceneColorBrush = new SolidColorBrush(RenderTarget2D, Color.Black);
        }
Example #3
0
        protected override void Initialize(AppConfiguration demoConfiguration)
        {
            // SwapChain description
            var desc = new SwapChainDescription()
            {
                BufferCount = 1,
                ModeDescription =
                    new ModeDescription(demoConfiguration.Width, demoConfiguration.Height,
                                        new Rational(60, 1), Format.R8G8B8A8_UNorm),
                IsWindowed = true,
                OutputHandle = DisplayHandle,
                SampleDescription = new SampleDescription(1, 0),
                SwapEffect = SwapEffect.Discard,
                Usage = Usage.RenderTargetOutput
            };

            // Create Device and SwapChain
            SharpDX.Direct3D11.Device.CreateWithSwapChain(DriverType.Hardware, DeviceCreationFlags.BgraSupport, new[] { FeatureLevel.Level_10_0 }, desc, out device, out swapChain);

            // Ignore all windows events
            Factory factory = swapChain.GetParent<Factory>();
            factory.MakeWindowAssociation(DisplayHandle, WindowAssociationFlags.IgnoreAll);

            // New RenderTargetView from the backbuffer
            backBuffer = Texture2D.FromSwapChain<Texture2D>(swapChain, 0);

            backBufferView = new RenderTargetView(device, backBuffer);
        }
Example #4
0
        protected override void Initialize(AppConfiguration appConfiguration)
        {
            base.Initialize(appConfiguration);

            RenderedObjects.Initializate(RenderingSize, RenderTarget2D);
        }
Example #5
0
 public override void Run()
 {
     var config = new AppConfiguration("ChainSdx");
     config.FPSLimit = 120;
     Run(config);
 }