public Renderer(Game game) { this.game = game; camera = game.Camera; data = game.Data; stats = new PerformanceWatch(); }
public void Show(MainWindow window, Game game, Star star) { base.Show(window); this.game = game; window.ChildNumber++; data = game.Data; this.window = window; oldTime = game.Running; game.Stop(); game.Sim.WaitForIdle(); editStar = star; editStar.Editor = this; textBoxName.Text = star.Name; textBoxMass.Text = "" + star.Mass; textBoxDensity.Text = "" + star.Density; updateComboBox(); if (data.RefStar != null && editStar != data.RefStar) { comboBox1.SelectedIndex = 3; } else { comboBox1.SelectedIndex = 2; } readEnabled = true; }
public void Show(MainWindow window, Game game) { base.Show(window); this.game = game; window.ChildNumber++; this.window = window; this.simulation = game.Data; this.stars = simulation.Stars; oldTime = game.Running; game.Stop(); game.Sim.WaitForIdle(); SetStars(stars); }
public Simulation(Camera camera, SimData data) { this.camera = camera; this.data = data; GravitationalConstant = 0.001; //Math.Pow(6.674*10, -11); //Console.WriteLine(GravitationalConstant); TaskCount = Environment.ProcessorCount; Stats = new PerformanceWatch(); TaskStats = new PerformanceWatch[TaskCount]; for (int i = 0; i < TaskCount; i++) { TaskStats[i] = new PerformanceWatch(); } }
public MainWindow() { InitializeComponent(); MouseWheel += new MouseEventHandler(Window_MouseWheel); SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); DoubleBuffered = true; game = new Game(); camera = game.Camera; data = game.Data; renderer = new Renderer(game); game.Start(); TimerDraw.Start(); }