且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Lwjgl 3,如何在当前线程中获取OpenGL上下文当前信息?

更新时间:2023-01-28 08:32:16

createWindow方法的末尾添加对GLContext.createFromCurrent()的调用.

Add a call to GLContext.createFromCurrent() at the end of the createWindow method.

需要这种方法来设置LWJGL GL **类在幕后使用的上下文.

This method is needed to set the context used by the LWJGL GL** classes under the hood.

自最近的夜间版本(3.0.0b#11)起,此功能不再起作用,因为GLContext类不再存在.而是在createWindow方法的末尾添加GL.createCapabilities().

Since the latest nightly (3.0.0b #11) this no longer works, as the GLContext class no more exists. Instead, add GL.createCapabilities() at the end of the createWindow method.