private void InitResources(ResourceFactory factory)
        {
            _cl.Begin();
            _cl.UpdateBuffer(_screenSizeBuffer, 0, new Vector4(_window.Width, _window.Height, 0, 0));

            ParticleInfo[] initialParticles = new ParticleInfo[ParticleCount];
            System.Random  r = new System.Random();
            for (int i = 0; i < ParticleCount; i++)
            {
                ParticleInfo pi = new ParticleInfo();
                pi.Position         = new Vector2((float)(r.NextDouble() * _window.Width), (float)(r.NextDouble() * _window.Height));
                pi.Velocity         = new Vector2((float)(r.NextDouble() * 0.03), (float)(r.NextDouble() * 0.03));
                pi.Color            = new Vector4(0.4f + (float)r.NextDouble() * .6f, 0.4f + (float)r.NextDouble() * .6f, 0.4f + (float)r.NextDouble() * .6f, 1);
                initialParticles[i] = pi;
            }
            _cl.UpdateBuffer(_particleBuffer, 0, initialParticles);

            _cl.End();
            _gd.ExecuteCommands(_cl);
            _gd.WaitForIdle();
        }
        private void InitResources(ResourceFactory factory)
        {
            _cl.Begin();
            _cl.UpdateBuffer(_screenSizeBuffer, 0, new Vector4(Window.Width, Window.Height, 0, 0));

            ParticleInfo[] initialParticles = new ParticleInfo[ParticleCount];
            Random         r = new Random();

            for (int i = 0; i < ParticleCount; i++)
            {
                ParticleInfo pi = new ParticleInfo(
                    new Vector2((float)(r.NextDouble() * Window.Width), (float)(r.NextDouble() * Window.Height)),
                    new Vector2((float)(r.NextDouble() * 3), (float)(r.NextDouble() * 3)),
                    new Vector4(0.4f + (float)r.NextDouble() * .6f, 0.4f + (float)r.NextDouble() * .6f, 0.4f + (float)r.NextDouble() * .6f, 1));
                initialParticles[i] = pi;
            }
            _cl.UpdateBuffer(_particleBuffer, 0, initialParticles);

            _cl.End();
            GraphicsDevice.SubmitCommands(_cl);
            GraphicsDevice.WaitForIdle();
        }