public void glControl_MouseUp(object sender, MouseEventArgs e) { Program.Camera.MouseUp(e); int x = e.X; int y = Program.GLControl.ClientSize.Height - e.Y; if (e.Button == MouseButtons.Left) { Selection.LeftMouseUp(x, y); Creation.LeftMouseUp(x, y); } }
public void glControl_Update(object sender, EventArgs e) { //For frame-independent stuff Program.DeltaCounter.Stop(); Program.ElapsedSeconds = Program.DeltaCounter.Elapsed.TotalSeconds; Program.ElapsedMilliseconds = Program.DeltaCounter.Elapsed.TotalMilliseconds; Program.DeltaCounter.Reset(); Program.DeltaCounter.Start(); Program.Camera.Update(); Program.Camera.UpdatePanning(); Creation.UpdateObjectAtCursor(); Selection.Update(); }
public void glControl_Load(object sender, EventArgs e) { Log.WriteLine("Initializing..."); Texture.Init(); Importer.Init(); Renderer.Init(); HWData.ParseDataPaths(); Background.LoadBackgroundFades(); Creation.Init(); Selection.Init(); LuaMap.SetupInterpreter(); Application.Idle += glControl_Update; Program.DeltaCounter.Start(); FPSCounter.LabelFPS = labelFPS; Loaded = true; gridProblems.RowTemplate.DefaultCellStyle.WrapMode = DataGridViewTriState.True; gridProblems.DefaultCellStyle.WrapMode = DataGridViewTriState.True; gridProblems.Columns[0].DefaultCellStyle.WrapMode = DataGridViewTriState.True; this.WindowState = Settings.LastWindowState; this.Location = Settings.LastWindowLocation; this.Size = Settings.LastWindowSize; Map.Clear(); Program.Camera.ResetCamera(); if (Updater.CheckForUpdatesOnStart) { Updater.CheckForUpdates(); } Program.main.UpdateProblems(); Renderer.InvalidateMeshData(); Renderer.InvalidateView(); Renderer.Invalidate(); }