【发布时间】:2016-02-23 23:30:30
【问题描述】:
我想将我使用的 OpenGL 版本从 3.2 更改为 3.3,以便实现实例化渲染。目前我的 OpenGL 初始化代码如下所示。
ContextAttribs attribs = new ContextAttribs(3, 2).withForwardCompatible(true).withProfileCore(true);
所以我把它改成了……
ContextAttribs attribs = new ContextAttribs(3, 3).withForwardCompatible(true).withProfileCore(true);
唯一的区别是我放入 ContextAttribs() 中的 OpenGL 版本。
根据https://support.apple.com/en-us/HT202823,我在 2013 年 MacBook Air 上运行此应用程序,它的 OpenGL 功能高达 4.1
创建显示后,我放置了以下代码
System.out.println("OpenGL version " + GL11.glGetString(GL11.GL_VERSION));
这让我可以检查我使用的是哪个版本的 OpenGL。这是棘手的部分。当我把 ContextAttribs(3, 2) 打印出来
OpenGL 4.1 版 INTEL-10.12.13
但是,如果我将其更改为 ContextAttribs(3, 3),我的应用程序会崩溃并打印出来
OpenGL 2.1 版 INTEL-10.12.13
我不知道如何解决这个问题,如果有人可以的话,将不胜感激。感谢您阅读本文。
【问题讨论】: