gpt4 book ai didi

Linux - 默认 OpenGL 版本

转载 作者:行者123 更新时间:2023-12-04 18:59:00 30 4
gpt4 key购买 nike

我在 Ubuntu 18.04 上工作。我没有定义 GL_GLEXT_PROTOTYPES .我使用 glXGetProcAddress 加载“核心”OpenGL 函数.我的申请链接到 /usr/lib/x86_64-linux-gnu/libGL.so .一些遗留的 OpenGL 函数无需定义 GL_GLEXT_PROTOTYPES 即可使用。或调用glXGetProcAddress ,例如 glColor3f . Linux 下默认提供哪些 OpenGL 版本(功能)?
编辑
我假设硬件支持最新的 OpenGL 版本。此外,我使用来自标准 Ubuntu 位置的兼容性配置文件和 OpenGL 头文件(gl.h, glext.h):/usr/include/GL .看起来这些 header 已由 mesa-common-dev 安装。合适的包。

最佳答案

传统上,libGL.so Linux 上的图形驱动程序供应商提供。没有真正的“默认”版本。在这方面您可以找到的最接近标准的是 OpenGL® Application Binary Interface for Linux其中指出:

3.4. The libraries must export all OpenGL 1.2, GLU 1.3, GLX 1.3, and ARB_multitexture entry points statically.



4.5. All OpenGL 1.2 and ARB_multitexture, GLU 1.3, and GLX 1.3 entry points and enumerants must be present in the corresponding header files gl.h, glu.h, and glx.h, even if only OpenGL 1.1 is implemented at runtime by the associated runtime libraries.


所以这基本上是您可以依赖的直接导出的 GL 函数集。通常,各种供应商的 GL 库导出的要多得多,但官方查询事物的方式是扩展机制。
请注意,在 Linux 上,使用 OpenGL 的现代方式是通过 vendor-neutral GL dispatch library提供 libOpenGL.so而不是 libGL.so .它似乎导出了它构建时已知的所有核心 OpenGL 函数。但这并不意味着特定的供应商实现将支持所有这些功能。

关于Linux - 默认 OpenGL 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70184950/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com