/// <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); }
void IWorldEngine.Initialise(ViewPortCollection viewports) { var area = new Vector2u( (uint)viewports.WorkingArea.Width, (uint)viewports.WorkingArea.Height); _glyphsStreams = new List <GlyphStreamManager>(); foreach (var setting in _settings.RenderLayers) { _glyphsStreams.Add(new GlyphStreamManager(setting, area)); } }
void IWorldEngine.Initialise(ViewPortCollection viewports) { var area = new Vector2u( (uint)viewports.WorkingArea.Width, (uint)viewports.WorkingArea.Height); _glyphsStreams = new List<GlyphStreamManager>(); foreach (var setting in _settings.RenderLayers) { _glyphsStreams.Add(new GlyphStreamManager(setting, area)); } }
private void New() { _scenario = new ScenarioModel(); _sim = new Core.Simulation(_scenario); ScenarioLoaded = true; SpeedRatio = 1.0D; if (ViewPortCollection.Count() > 0) { ViewPortSelectionChanged(ViewPortCollection.First().Code); } }
private void Loading(string path) { BusyContent = "Загрузка сценария..."; IsBusy = true; BackgroundWorker bw = new BackgroundWorker(); bw.RunWorkerCompleted += (s, e) => { if (e.Error != null) { System.Windows.MessageBox.Show("Сценарий поврежден и не может быть прочитан"); } _sim = new Core.Simulation(_scenario); ScenarioLoaded = true; if (ViewPortCollection.Count() > 0) { ViewPortSelectionChanged(ViewPortCollection.First().Code); } while (Properties.Settings.Default.LastScenarios.Contains(path)) { Properties.Settings.Default.LastScenarios.Remove(path); } Properties.Settings.Default.LastScenarios.Add(path); Properties.Settings.Default.Save(); OnPropertyChanged("WindowTitle"); IsBusy = false; }; bw.DoWork += (s, e) => { string p = (string)e.Argument; Scenario.IO.ScenarioStream st = new Scenario.IO.ScenarioStream(p); _scenario = st.Read(); _scenario.Map.Init(); }; bw.RunWorkerAsync(path); }
private void MapConfig() { var wnd = new View.ConfigWindows.MapConfigWindow(); wnd.Owner = Helpers.MVVM.MVVMHelper.GetActiveWindow(); var vm = new ViewModel.MapConfigViewModel(_scenario); wnd.DataContext = vm; wnd.ShowDialog(); if (vm.DialogResult == true) { _scenario.Map = vm.Map; _scenario.InputOutputPoints = vm.AllWayPoints.Select(pvm => pvm.WayPoint).ToList(); OnPropertyChanged("MapSizeInfo"); if (ViewPortCollection.Count() > 0) { ViewPortSelectionChanged(ViewPortCollection.First().Code); } } }
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); }
void IWorldEngine.Initialise(ViewPortCollection viewports) { _viewports = viewports; }