private void Form1_Load(object sender, EventArgs e) { #region Cria a Câmera engine2D.CriarCamera(picScreen.ClientRectangle.Width, picScreen.ClientRectangle.Height); #endregion #region Define os atributos dos controles txtPosX.Maximum = txtCamZoom.Maximum = txtEscalaY.Maximum = txtEscalaX.Maximum = txtCamPosY.Maximum = txtCamPosX.Maximum = txtPosY.Maximum = txtAngulo.Maximum = txtRaio.Maximum = decimal.MaxValue; txtPosY.Minimum = txtCamZoom.Minimum = txtEscalaX.Minimum = txtCamPosY.Minimum = txtCamPosX.Minimum = txtPosY.Minimum = txtAngulo.Minimum = txtRaio.Minimum = decimal.MinValue; BtnCirculo_Click(sender, e); AtualizarControles(null); AtualizarComboObjetos2D(); debugToolStripMenuItem.Checked = engine2D.Debug = true; desligarZoomToolStripMenuItem.Checked = engine2D.Camera.DesligarSistemaZoom = true; cboCamera.DisplayMember = "Nome"; cboCamera.ValueMember = "Cam"; cboCamera.DataSource = engine2D.Cameras.Select( Cam => new { Cam.Id, Cam.Nome, Cam }).ToList(); #endregion Show(); #region Loop principal de rotinas do simulador 2D while (!_sair) { // Use o tempo delta em todos os cálculos que alteram o comportamento dos objetos 2d // para que rode em processadores de baixo e alto desempenho sem alterar a qualidade do simulador // TODO: Insira toda sua rotina aqui if (moveCamera) { engine2D.Camera.Pos.x += -(float)((cameraDrag.X - Cursor.Position.X) * engine2D.Camera.TempoDelta * 0.000001); engine2D.Camera.Pos.y += -(float)((cameraDrag.Y - Cursor.Position.Y) * engine2D.Camera.TempoDelta * 0.000001); } if (engine2D.Camera.ResWidth != picScreen.ClientRectangle.Width || engine2D.Camera.ResHeigth != picScreen.ClientRectangle.Height) { engine2D.Camera.RedefinirResolucao(picScreen.ClientRectangle.Width, picScreen.ClientRectangle.Height); } picScreen.Image = engine2D.Camera.Renderizar(); Application.DoEvents(); } #endregion }