安装:
Install-Package OpenTK
using OpenTK.Graphics.OpenGL4;
using OpenTK.Windowing.Common;
using OpenTK.Windowing.Desktop;
using OpenTK.Windowing.GraphicsLibraryFramework;
using (Game game = new Game(800, 600, "LearnOpenTK"))
{
game.Run();
}
public class Game : GameWindow
{
public Game(int width, int height, string title) : base(GameWindowSettings.Default, new NativeWindowSettings() { Size = (width, height), Title = title })
{
}
protected override void OnUpdateFrame(FrameEventArgs e)
{
base.OnUpdateFrame(e);
if (KeyboardState.IsKeyDown(Keys.Escape))
{
Close();
}
}
}
标签:2Cgamewindow,笔记,Game,试用,opentk4%,using,OpenTK,Windowing
From: https://www.cnblogs.com/wzwyc/p/18499241