private void glControl1_Load(object sender, EventArgs e)
 {
     //Ensures that the OPENGL form is in place before assigning any functions
     Draw.loaded = true;
     Draw.Load();
     popCB();
     comboBox1.SelectedIndex = 0;
     comboBox2.SelectedIndex = 0;
     Draw.UpdateImage(Width, Height); //Show First Frame
     timer1.Start();                  // Begin Timer
 }
        public void Rotate()
        {//ROTATES THE CAMERA
            //Adjusts image based on mouse positioning
            if (mouselock)
            {
                delta = lastMousePos - new OpenTK.Vector2(OpenTK.Input.Mouse.GetState().X, OpenTK.Input.Mouse.GetState().Y);

                ResetCursor();
                Draw.UpdateImage(Width, Height);
            }
            Main.cam.AddRotation(delta.X, delta.Y);
            PosData();
        }
 private void glControl1_Resize(object sender, EventArgs e)
 {
     //Updates the image according to to updated window parameters
     Draw.UpdateImage(Width, Height);
 }
        private void glControl1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)
        {//Keyboard control
            base.OnKeyPress(e);

            if (e.KeyChar == 27)
            {
                //Escape
                this.Close();
            }

            switch (e.KeyChar.ToString().ToLower()[0])
            {
            case 'w':    //Forward
                Main.cam.Move(0f, 0.1f, 0f);
                Draw.UpdateImage(Width, Height);
                PosData();
                break;

            case 'a':    //Left
                Main.cam.Move(-0.1f, 0f, 0f);
                Draw.UpdateImage(Width, Height);
                PosData();
                break;

            case 's':    //Backward
                Main.cam.Move(0f, -0.1f, 0f);
                Draw.UpdateImage(Width, Height);
                PosData();
                break;

            case 'd':    //Right
                Main.cam.Move(0.1f, 0f, 0f);
                Draw.UpdateImage(Width, Height);
                PosData();
                break;

            case 'e':    //Up
                Main.cam.Move(0f, 0f, 0.1f);
                Draw.UpdateImage(Width, Height);
                PosData();
                break;

            case 'q':    //Down
                Main.cam.Move(0f, 0f, -0.1f);
                Draw.UpdateImage(Width, Height);
                PosData();
                break;

            case 'u':    //Zoom In
                if (zo)
                {
                    Main.cam.Zoom        -= 40;
                    Main.cam.Speed       /= 3;
                    Main.cam.Sensitivity /= 3;
                    zo = false;
                }
                Draw.UpdateImage(Width, Height);
                break;

            case 'i':    //Zoom Out
                if (!zo)
                {
                    Main.cam.Zoom        += 40;
                    Main.cam.Speed       *= 3;
                    Main.cam.Sensitivity *= 3;
                    zo = true;
                }
                Draw.UpdateImage(Width, Height);
                break;

            case 'j':    //Previous Iteration
                LastIt();
                break;

            case 'k':    //Next Iteration
                NextIt();
                break;

            case 'm':    //Mini Map
                if (Main.MiniMap)
                {
                    Main.MiniMap = false;
                    Main.Map     = Main.FEmpty.hollow().toDisplay();
                }
                else
                {
                    Main.MiniMap = true;
                }
                break;
            }
        }