将项目移植到 OpenGL3

发布于 2024-09-04 06:05:48 字数 475 浏览 3 评论 0原文

我正在开发一个 C++ 跨平台 OpenGL 应用程序(Windows、Linux 和 MacOS),我想知道你们中的一些人是否可以分享一些关于将大型应用程序移植到 OpenGL 3 的建议。我研究 OpenGL 3 的原因是因为我认为我们可以从使用新的“同步对象”中受益匪浅。 Nvidia 自 Geforce 256 天(gl_nv_fences)以来就支持这样的扩展,但在 OpenGL 3.0+ 之前的 ATI 硬件上似乎没有等效的功能...

我们的代码大量使用了 glut/freeglut、glu 函数、OpenGL 2 扩展和CUDA(在支持的硬件上)。我现在面临的问题是“gl3.h”和“gl.h”相互不兼容(如gl3.h中所述)。你们知道是否有 GL3 过剩等价物吗?另外,查看 CUDA-toolkit 头文件,似乎 GL-CUDA 互操作性仅在使用旧版本的 OpenGL 时可用...(cuda_gl_interop.h 包括 gl.h...)。我错过了什么吗?

非常感谢您的帮助。

I'm working on a C++ cross-platform OpenGL application (Windows, Linux and MacOS) and I am wondering if some of you could share some advices on porting a large application to OpenGL 3. The reason I am looking into OpenGL 3 is because I think we could benefit a lot from using the new "Sync objects". Nvidia has supported such an extension since the Geforce 256 days (gl_nv_fences) but there seems to be no equivalent functionality on ATI hardware before OpenGL 3.0+...

Our code makes quite heavy use of glut/freeglut, glu functions, OpenGL 2 extensions and CUDA (on supported hardware). The problem I am now facing is that "gl3.h" and "gl.h" are mutually incompatible (as stated in gl3.h). Do you guys know if there is a GL3 glut equivalent ? Also, looking at the CUDA-toolkit header files, it seems that GL-CUDA interoperability is only available when using older versions of OpenGL... (cuda_gl_interop.h includes gl.h...). Am I missing something ?

Thanks a lot for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

满身野味 2024-09-11 06:05:48

glut 的最后一次更新是 3.7 版本,大约是 10 年前。考虑到这一点,我怀疑它永远是否支持OpenGL 3.x(或4.x)。

OpenGlut 的工作人员似乎正在考虑 OpenGL 3.x 支持的可能性,但还没有这样做还没有什么东西。

FLTK 有(部分)过剩模拟,但它的部分程度足以让“大量使用过剩”的程序“一开始可能无法使用它。由于 FLTK 正在积极开发中,我猜它最终会支持 OpenGL 3.x(或 4.x),但我不相信它已经提供,并且可能会质疑它要多久才能提供。

编辑:就 CUDA 而言,显而易见(尽管肯定不平凡)的答案是使用 OpenCL。这与硬件(例如,ATI/AMD 板)和较新版本的 OpenGL 的兼容性要好得多。

剩下的就是 glu。坦率地说,我认为对此没有明确或明显的答案。 OpenGL 正在放弃 不再支持 glu 之类的东西,而是放弃对更多曾经是核心 OpenGL 规范一部分的模糊类似 glu 的功能的支持(例如,所有矩阵操作基元) 。就我个人而言,我认为这是一个错误,但无论好坏,事情就是这样。不幸的是,glu 有点像 glut——该规范的最后一次更新是在 1998 年,对应于 OpenGL 1.2。这并不意味着更新似乎根本不可能。不幸的是,我也不知道有任何真正直接的替代品。显然还有其他图形库提供(至少一些)类似的功能,但我能想到的所有这些都需要大量重写。

The last update to glut was version 3.7, roughly 10 years ago. Taking that into account, I doubt that it'll ever support OpenGL 3.x (or 4.x).

The people working on OpenGlut seem to be considering the possibility of OpenGL 3.x support, but haven't done anything with it yet.

FLTK has a (partial) glut simulation, but it's partial enough that a program that "makes heavy use of glut" may not work with it in the first place. Since FLTK is in active development, I'd guess it'll eventually support OpenGL 3.x (or 4.x), but I don't believe it's provided yet, and it may be open to question how soon it will be either.

Edit: As far as CUDA goes, the obvious (though certainly non-trivial) answer would be to use OpenCL instead. This is considerably more compatible both with hardware (e.g., with ATI/AMD boards) and with newer versions of OpenGL.

That leaves glu. Frankly, I don't think there is a clear or obvious answer to this. OpenGL is moving away from supporting things like glu, and instead dropping support for even more of the vaguely glu-like functionality that used to be part of the core OpenGL spec (e.g., all the matrix manipulation primitives). Personally, I think this is a mistake, but whether it's good or bad, it's how things are. Unfortunately, glu is a bit like glut -- the last update to the spec was in 1998, and corresponds to OpenGL 1.2. That doesn't make an update seem at all likely. Unfortunately, I don't know of any really direct replacements for it either. There are clearly other graphics libraries that provide (at least some) similar capabilities, but all of them I can think of would require substantial rewriting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文