c# - 如何在 OpenTK .NET Core 中设置 OpenGL API 版本?

标签 c# .net opengl opentk

如何使用 NativeWindowSettings 类使用 .NET Core 5.0 在 OpenTk 4.6.4 中设置 OpenGl 版本?以及如何在这段代码中正确实现它

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

最佳答案

您可以设置 APIVersion 属性(另请参阅 OpenTK_hello_triangle。例如:

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

    APIVersion = new System.Version(4, 6)
};

关于c# - 如何在 OpenTK .NET Core 中设置 OpenGL API 版本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67976008/

相关文章:

c - 从不同的角度进行绘画

c++ - GLUT 和 freeglut includes 不能一起工作 (MinGW)

c# - 如何使用 DOT 文件导出数据?

javascript - Razor 语法中的 "data"Ajax 选项在哪里?

c# - 使用 OleDbParameter 在 Access 中插入日期/时间值

.net - pdb 文件实际上是做什么的?

c++ - 在类中使用 OpenGL glutDisplayFunc

c# - 如何使用 SQL Server 2005、ASP.NET MVC 和 EF 进行身份验证

c# - tempDirectory编译配置

.net - 绑定(bind)重定向的框架配置在哪里?