Exemplo n.º 1
0
 /// <summary>
 /// .ctor
 /// </summary>
 public ScreenSaverEngine(ScreenSaverSettings settings)
 {
     _viewPorts = new ViewPortCollection(settings.IsFullscreen, settings.IsMultiMonitorEnabled);
     _canvas    = new RenderTexture((uint)_viewPorts.WorkingArea.Width, (uint)_viewPorts.WorkingArea.Height, false);
     _canvas.Clear(Color.Black);
     _canvas.Display(); // Needed due to FBO causing inverted co-ords otherwise
     _chrono     = new Chrono();
     _fpsLimiter = new FpsLimiter(settings.MaxFps);
 }
Exemplo n.º 2
0
        public ViewPort(ViewPortCollection parent, Screen screen, int id, bool isFullScreen)
        {
            ID     = id;
            Parent = parent;

            Styles style;

            if (isFullScreen)
            {
                style       = Styles.Fullscreen;
                WorkingArea = new Rectangle(
                    screen.Bounds.X,
                    screen.Bounds.Y,
                    screen.Bounds.Width,   // - 1
                    screen.Bounds.Height); // - 1
            }
            else
            {
                style       = Styles.Resize;
                WorkingArea = new Rectangle(
                    screen.WorkingArea.Left,
                    screen.WorkingArea.Top,
                    (int)(screen.WorkingArea.Width * 0.5),
                    (int)(screen.WorkingArea.Height * 0.5)
                    );
            }

            Window = new RenderWindow(
                new VideoMode(
                    (uint)WorkingArea.Width,
                    (uint)WorkingArea.Height
                    ),
                "Screensaver [debug]",
                style,
                new ContextSettings(32, 0, 0)
                );

            Window.Position = new Vector2i(WorkingArea.Left, WorkingArea.Top);
            Window.SetTitle(Window.Position.X + "," + Window.Position.Y);
        }