/// <summary> /// Initialize GL Window, Shader, and Cube VAO /// </summary> private void Init() { CreateWindow(); InitInput(); InitUi(); _fps.OnFrameCount += frameCount => Console.WriteLine($"FPS: {frameCount}"); _fps.Start(); _renderer = new OpenGLRenderer(); //Gl.PolygonMode(MaterialFace.Front, PolygonMode.Line); _blockTexture = new Texture("resources/terrain.png"); _cube = NewCubeRenderable(); _axis = NewAxisGeometry(); _mainCamera = new Camera("MainCamera", _viewport); _mainCamera.MoveTo(2, 5, -10); _mainCamera.LookAt(_cube.Model, Vector3.UnitY); _chunks = InitChunks(); _chunkMeshes = CreateMeshes(_chunks); }
private void НоваяИграToolStripMenuItem_Click(object sender, EventArgs e) { game = new Game(); FPS.Start(); button1.Enabled = button2.Enabled = button3.Enabled = true; goal.Text = game.Goal.ToString(); position.Text = game.Position.ToString(); step.Text = game.Step.ToString(); }
public Form1() { InitializeComponent(); OpenTK.Toolkit.Init(); this.SuspendLayout(); glControl.CreateControl(); glControl.Width = Width - 16; glControl.Height = Height - 63; glControl.Location = new Point(0, 24); this.Controls.Add(glControl); glControl_Load(); glControl.MouseMove += glControl_MouseMove; glControl.KeyDown += Form1_KeyDown; devX = (float)screen.Width / (float)glControl.Width; devY = (float)screen.Height / (float)glControl.Height; glControl.Load += control_Load; glControl.Paint += control_Paint; glControl.MouseDown += new MouseEventHandler(Form1_MouseDown); FPS.Start(); }
public lvl() { InitializeComponent(); KeyDown += Lvl_KeyDown; FPS.Start(); X = 30; Y = 30; Graphics g = Graphics.FromImage(bmp); g.FillEllipse(Brushes.GreenYellow, X, Y, Settings.characterSize, Settings.characterSize); loc = new int[Settings.numberQuestions]; MaximumSize = new Size(1100, 1100); MinimumSize = new Size(1100, 1100); Map.Image = bmp; Map.Size = new Size(bmp.Width, bmp.Height); Map.Location = new Point(0, 0); for (int y = 0; y < VisibleZone.Height; y++) { for (int x = 0; x < VisibleZone.Width; x++) { VisibleZone.SetPixel(x, y, Color.Black); } } Visible_Zone.Size = new Size(bmp.Width, bmp.Height); Visible_Zone.Image = VisibleZone; Visible_Zone.Location = new Point(0, 0); Visible_Zone.BringToFront(); DrawVisibleZone(X, Y); Visible_Zone.Visible = true; Map.Focus(); lbl = new Label[] { label1, label2, label3, label4, label5, label6, label7, label8, label9, label10, label11, label12, label13, label14, label15, label16, label17 }; for (int i = 0; i < lbl.Length; i++) { lbl[i].Size = new Size(Settings.SizeBox, Settings.SizeBox); lbl[i].Visible = false; } DrawingTaskBox(Settings.numberQuestions, lbl.Length, loc); }