OpenGL 版本在 ContextAttribs() 值更改时更改
OpenGL version changes when ContextAttribs() value is changed
我想将我正在使用的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版本。
我正在2013 MacBook Air上运行此应用程序,根据 https://support.apple.com/en-us/HT202823,OpenGL功能高达4.1
创建显示后,我放置了以下代码
System.out.println("OpenGL version " + GL11.glGetString(GL11.GL_VERSION));
这允许我检查我正在使用哪个版本的OpenGL。 这是棘手的部分。 当我放 ContextAttribs(3, 2) 时,它会打印出来
OpenGL 版本 4.1 英特尔-10.12.13
但是,如果我将其更改为上下文Attribs(3,3),我的应用程序崩溃并打印出来
OpenGL 版本 2.1 英特尔-10.12.13
我不知道如何解决这个问题,如果有人可以,将不胜感激。 感谢您阅读本文。
看看 LWJGL ContextAttribs 类的文档。它指出:
但是,为了在 MacOS X 10.7 或更高版本上启用 GL 3.2 上下文,必须将此类的实例传递给 LWJGL。唯一有效的配置是 ContextAttribs(3, 2, CONTEXT_CORE_PROFILE_BIT_ARB),其他任何配置都将被忽略。
相关文章:
- 为cl.exe(Visual Studio代码)指定命令行C++版本
- 导入库可以跨dll版本工作吗
- 在调用FreeLibrary后,释放动态链接到具有相同版本的CRT堆的DLL的内存
- 在clang++预处理器中确定gcc工具链版本
- 码头化的C++应用程序是否向后兼容早期的内核版本
- 不同的Visual Studio版本中缺少.dll
- 用符号版本替换对函数的所有调用
- luaL_dofile在已知良好的字节码上失败,可以使用未编译的版本
- 正在解码MSVC 32位版本的程序集(作业).没有手术做什么
- 我需要分发哪些版本的可再分发文件
- CV_OCL_RUN宏如何在OpenCV(版本3.4.5)的goodFeaturesToTrack实现中工作?
- 在运行时读取 libstdc++ 版本
- 如何声明一个可以在整个程序中使用的全局 2d 3d 4d .. 数组(堆版本)变量?
- FindPackageHandleStandardArgs.cmake:137 的 CMake 错误(消息):找不到 Boost (缺少:正则表达式)(找到合适的版本"1.72.0",
- Vulkan SDK 版本 1.1.85.0 在 Kubuntu 18.10 上链接
- 如何正确实现与基类不同的版本?
- 从预处理器获取 Windows 版本(C++ Win32)
- 表达式 SFINAE:如何根据类型是否包含具有一个或多个参数的函数来选择模板版本
- 如何在C++中将 Python 字符串转换为其转义版本?
- Qt版本应该在其他计算机上运行吗?