-
Notifications
You must be signed in to change notification settings - Fork 114
/
Program.cs
28 lines (25 loc) · 869 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using OpenTK.Mathematics;
using OpenTK.Windowing.Common;
using OpenTK.Windowing.Desktop;
namespace LearnOpenTK
{
public static class Program
{
private static void Main()
{
var nativeWindowSettings = new NativeWindowSettings()
{
ClientSize = new Vector2i(800, 600),
Title = "LearnOpenTK - Creating a Window",
// This is needed to run on macos
Flags = ContextFlags.ForwardCompatible,
};
// To create a new window, create a class that extends GameWindow, then call Run() on it.
using (var window = new Window(GameWindowSettings.Default, nativeWindowSettings))
{
window.Run();
}
// And that's it! That's all it takes to create a window with OpenTK.
}
}
}