예제 #1
0
        protected override void Initialize()
        {
            _Booru         = new BooruClient();
            _Textures      = new List <FallingBooruTexture>();
            _Font          = new BitmapFontRenderer(GraphicsDevice);
            _BackgroundHue = R.NextDouble() * 360;

            if (_Options.Debug)
            {
                string  productName = ScreensaverHelper.GetAssemblyAttribute <AssemblyProductAttribute>(x => x.Product);
                Version version     = Assembly.GetExecutingAssembly().GetName().Version;
                _ProductNameAndVersion = string.Format("{0} V{1}", productName, version);
            }

            graphics.PreferredBackBufferWidth       = W;
            graphics.PreferredBackBufferHeight      = H;
            graphics.PreferMultiSampling            = true;
            graphics.SynchronizeWithVerticalRetrace = !_Options.NoVSync;
            graphics.ApplyChanges();
            graphics.ToggleFullScreen();

            if (_Options.FPSLimit > 0)
            {
                TargetElapsedTime = new TimeSpan(10000000L / _Options.FPSLimit);
            }
            else
            {
                IsFixedTimeStep = false;
            }

            IsMouseVisible = false;

            base.Initialize();
        }
예제 #2
0
        public string GetUsage()
        {
            StringBuilder sb = new StringBuilder();

            string  productName = ScreensaverHelper.GetAssemblyAttribute <AssemblyProductAttribute>(x => x.Product);
            Version version     = Assembly.GetExecutingAssembly().GetName().Version;

            sb.AppendFormat("{0} V{1}", productName, version);
            sb.AppendLine();
            string copyright = ScreensaverHelper.GetAssemblyAttribute <AssemblyCopyrightAttribute>(x => x.Copyright);

            sb.Append(copyright);
            sb.AppendLine();
            sb.AppendLine();

            sb.AppendLine("  -s, --server <srv>[:prt] Server to connect to [localhost]");
            sb.AppendLine("  -u, --username <un>      Username for auto login");
            sb.AppendLine("  -p, --password <pw>      Password for auto login");
            sb.AppendLine("  -q  --search <str>       Search string [All posts]");
            sb.AppendLine("  -l  --image-limit <n>    Download max. n images [500]");
            //sb.AppendLine("  -f  --fps-limit <n>      Limit the FPS to n, (0 = unlimited) [60]");
            //sb.AppendLine("  -v  --no-vsync           Disable VSync");
            sb.AppendLine("  -i  --use-images         Use images instead of thumbnails");
            sb.AppendLine("  -d  --debug              Show debug information");
            sb.AppendLine("  -m  --image-size <n>     Image size [300]");
            sb.AppendLine("  -c  --image-count <n>    Show n images on screen [15]");
            sb.AppendLine("All switches are optional");

            sb.AppendLine();
            return(sb.ToString());
        }