我可以在单个渲染中同时使用已弃用的 OpenGL 和现代 OpenGL window 吗?

Can I use both deprecated OpenGL and modern OpenGL in a single rendering window?

我正在通过 OpenTK 使用现代 OpenGL 开发一个项目。我想在我的项目中使用 Gwen dot net GUI 库。不幸的是,Gwen dot net 使用旧的 OpenGL 来渲染它的小部件。我已经尝试合并现代 OpenGL 和 Gwen 点网,但到目前为止,都没有成功。在我浪费时间调试我的代码之前,我想知道,是否可以合并旧的 OpenGL 和现代的 OpenGL?

如果您创建兼容性配置文件上下文,它应该支持所有所有遗留功能。来自 OpenGL 4.3 compatibility spec、1.2.4:

Older generations of graphics hardware were not programmable using shaders, although they were configurable by setting state controlling specific details of their operation. The compatibility profile of OpenGL continues to support the legacy OpenGL commands developed for such fixed-function hardware, although they are typically implemented by writing shaders which reproduce the operation of such hardware. Fixed-function OpenGL commands and operations are described as alternative interfaces following descriptions of the corresponding shader stages.

现在最好避免混合使用旧样式和新样式的 OpenGL。在 MS Windows 和 Linux 上你可以,但奇怪的事情往往会发生。

对于 MacOS,Apple 已声明他们根本不支持兼容性上下文,因此您不能混用。

由于您坚持使用 GUI 工具包,我会尝试将所有新样式的 OpenGL 代码隔离在单独的上下文中并渲染到屏幕外目标,然后将其 blit 到主显示器。

GWEN 的 OpenTK 渲染是一个单独的 class。只需以现代方式重写它即可。这没有问题。