3

How to set OpenGl version in OpenTk 4.6.4 using .NET Core 5.0 using NativeWindowSettings class? and how to implement it correctly in this code

var nativeWindowSettings = new NativeWindowSettings
        {
            Size = new Vector2i(width, height),
            Title = title,
            API = ContextAPI.OpenGL,
            Profile = ContextProfile.Core,
            // APIVersion = ??
        };

1 Answers1

3

You can set the APIVersion property (see also OpenTK_hello_triangle. e.g.:

var nativeWindowSettings = new NativeWindowSettings()
{
    // [...]

    APIVersion = new System.Version(4, 6)
};
Rabbid76
  • 202,892
  • 27
  • 131
  • 174